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

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

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

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

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

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

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

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

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  15.8M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  15.8M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  15.8M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  15.8M|  inline const uint8_t *GetAddress(AttributeValueIndex att_index) const {
  123|  15.8M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  15.8M|    return buffer_->data() + byte_pos;
  125|  15.8M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  13.3k|  inline uint8_t *GetAddress(AttributeValueIndex att_index) {
  127|  13.3k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  13.3k|    return buffer_->data() + byte_pos;
  129|  13.3k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  47.5M|  inline bool IsAddressValid(const uint8_t *address) const {
  131|  47.5M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  47.5M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|   922k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  26.4k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  48.7k|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|    788|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|  10.0k|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|  1.37M|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  15.8M|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  15.8M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  15.8M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  15.8M|                    OutT *out_val) const {
  180|  15.8M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 15.8M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  15.8M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  15.8M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 15.8M, False: 0]
  ------------------
  197|  15.8M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  15.8M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  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: 15.8M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 15.8M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  15.8M|    }
  221|  15.8M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  15.8M|                         OutT *out_value) const {
  307|  15.8M|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  63.2M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 47.4M, False: 15.8M]
  ------------------
  311|  47.4M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 47.4M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  47.4M|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  47.4M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 47.4M]
  ------------------
  316|  47.4M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  47.4M|      src_address += sizeof(T);
  320|  47.4M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  15.8M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 15.8M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  15.8M|    return true;
  326|  15.8M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  47.4M|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  47.4M|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded - Ignored]
  ------------------
  367|       |      // Make sure the |in_value| fits within the range of values that OutT
  368|       |      // is able to represent. Perform the check only for integral types.
  369|  47.4M|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [Folded - Ignored]
  |  Branch (369:44): [Folded - Ignored]
  ------------------
  370|  47.4M|        static constexpr OutT kOutMin =
  371|  47.4M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [Folded - Ignored]
  ------------------
  372|  47.4M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 47.4M]
  |  Branch (372:35): [True: 0, False: 47.4M]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|  47.4M|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|  47.4M|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded - Ignored]
  ------------------
  379|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  380|       |        // integral type OutT is unable to represent these values.
  381|      0|        if (sizeof(in_value) > sizeof(double)) {
  ------------------
  |  Branch (381:13): [Folded - Ignored]
  ------------------
  382|      0|          if (std::isnan(static_cast<long double>(in_value)) ||
  ------------------
  |  Branch (382:15): [True: 0, False: 0]
  ------------------
  383|      0|              std::isinf(static_cast<long double>(in_value))) {
  ------------------
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|            return false;
  385|      0|          }
  386|      0|        } else if (sizeof(in_value) > sizeof(float)) {
  ------------------
  |  Branch (386:20): [Folded - Ignored]
  ------------------
  387|      0|          if (std::isnan(static_cast<double>(in_value)) ||
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|              std::isinf(static_cast<double>(in_value))) {
  ------------------
  |  Branch (388:15): [True: 0, False: 0]
  ------------------
  389|      0|            return false;
  390|      0|          }
  391|      0|        } else {
  392|      0|          if (std::isnan(static_cast<float>(in_value)) ||
  ------------------
  |  Branch (392:15): [True: 0, False: 0]
  ------------------
  393|      0|              std::isinf(static_cast<float>(in_value))) {
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            return false;
  395|      0|          }
  396|      0|        }
  397|       |
  398|       |        // Make sure the floating point |in_value| fits within the range of
  399|       |        // values that integral type OutT is able to represent.
  400|      0|        if (in_value < std::numeric_limits<OutT>::min() ||
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            in_value >= std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|          return false;
  403|      0|        }
  404|      0|      }
  405|  47.4M|    }
  406|       |
  407|  47.4M|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [Folded - Ignored]
  |  Branch (407:39): [Folded - Ignored]
  ------------------
  408|  47.4M|        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|  47.4M|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded - Ignored]
  ------------------
  414|  47.4M|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [Folded - Ignored]
  |  Branch (414:49): [True: 0, False: 0]
  ------------------
  415|       |      // Converting from floating point to a normalized integer.
  416|      0|      if (in_value > 1 || in_value < 0) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|       |        // Normalized float values need to be between 0 and 1.
  418|      0|        return false;
  419|      0|      }
  420|       |      // TODO(ostava): Consider allowing float to normalized integer conversion
  421|       |      // for 64-bit integer types. Currently it doesn't work because we don't
  422|       |      // have a floating point type that could store all 64 bit integers.
  423|      0|      if (sizeof(OutT) > 4) {
  ------------------
  |  Branch (423:11): [Folded - Ignored]
  ------------------
  424|      0|        return false;
  425|      0|      }
  426|       |      // Expand the float to the range of the output integer and round it to the
  427|       |      // nearest representable value. Use doubles for the math to ensure the
  428|       |      // integer values are represented properly during the conversion process.
  429|      0|      *out_value = static_cast<OutT>(std::floor(
  430|      0|          in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  431|      0|          0.5));
  432|  47.4M|    } else {
  433|  47.4M|      *out_value = static_cast<OutT>(in_value);
  434|  47.4M|    }
  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|  47.4M|    return true;
  442|  47.4M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  15.4k|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  15.4k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  15.4k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  15.4k|                    OutT *out_val) const {
  180|  15.4k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 15.4k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  15.4k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  15.4k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 15.4k, False: 0]
  ------------------
  197|  15.4k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  15.4k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  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: 15.4k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 15.4k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  15.4k|    }
  221|  15.4k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  15.4k|                         OutT *out_value) const {
  307|  15.4k|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  61.9k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 46.4k, False: 15.4k]
  ------------------
  311|  46.4k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 46.4k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  46.4k|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  46.4k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 46.4k]
  ------------------
  316|  46.4k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  46.4k|      src_address += sizeof(T);
  320|  46.4k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  15.4k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 15.4k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  15.4k|    return true;
  326|  15.4k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|  46.4k|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  46.4k|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded - Ignored]
  ------------------
  367|       |      // Make sure the |in_value| fits within the range of values that OutT
  368|       |      // is able to represent. Perform the check only for integral types.
  369|      0|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [Folded - Ignored]
  |  Branch (369:44): [Folded - Ignored]
  ------------------
  370|      0|        static constexpr OutT kOutMin =
  371|      0|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [Folded - Ignored]
  ------------------
  372|      0|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  |  Branch (372:35): [True: 0, False: 0]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|      0|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|      0|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded - Ignored]
  ------------------
  379|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  380|       |        // integral type OutT is unable to represent these values.
  381|      0|        if (sizeof(in_value) > sizeof(double)) {
  ------------------
  |  Branch (381:13): [Folded - Ignored]
  ------------------
  382|      0|          if (std::isnan(static_cast<long double>(in_value)) ||
  ------------------
  |  Branch (382:15): [True: 0, False: 0]
  ------------------
  383|      0|              std::isinf(static_cast<long double>(in_value))) {
  ------------------
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|            return false;
  385|      0|          }
  386|      0|        } else if (sizeof(in_value) > sizeof(float)) {
  ------------------
  |  Branch (386:20): [Folded - Ignored]
  ------------------
  387|      0|          if (std::isnan(static_cast<double>(in_value)) ||
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|              std::isinf(static_cast<double>(in_value))) {
  ------------------
  |  Branch (388:15): [True: 0, False: 0]
  ------------------
  389|      0|            return false;
  390|      0|          }
  391|      0|        } else {
  392|      0|          if (std::isnan(static_cast<float>(in_value)) ||
  ------------------
  |  Branch (392:15): [True: 0, False: 0]
  ------------------
  393|      0|              std::isinf(static_cast<float>(in_value))) {
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            return false;
  395|      0|          }
  396|      0|        }
  397|       |
  398|       |        // Make sure the floating point |in_value| fits within the range of
  399|       |        // values that integral type OutT is able to represent.
  400|      0|        if (in_value < std::numeric_limits<OutT>::min() ||
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            in_value >= std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|          return false;
  403|      0|        }
  404|      0|      }
  405|      0|    }
  406|       |
  407|  46.4k|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [Folded - Ignored]
  |  Branch (407:39): [Folded - Ignored]
  ------------------
  408|  46.4k|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 46.4k]
  ------------------
  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|  46.4k|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded - Ignored]
  ------------------
  414|  46.4k|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [Folded - Ignored]
  |  Branch (414:49): [True: 0, False: 0]
  ------------------
  415|       |      // Converting from floating point to a normalized integer.
  416|      0|      if (in_value > 1 || in_value < 0) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|       |        // Normalized float values need to be between 0 and 1.
  418|      0|        return false;
  419|      0|      }
  420|       |      // TODO(ostava): Consider allowing float to normalized integer conversion
  421|       |      // for 64-bit integer types. Currently it doesn't work because we don't
  422|       |      // have a floating point type that could store all 64 bit integers.
  423|      0|      if (sizeof(OutT) > 4) {
  ------------------
  |  Branch (423:11): [Folded - Ignored]
  ------------------
  424|      0|        return false;
  425|      0|      }
  426|       |      // Expand the float to the range of the output integer and round it to the
  427|       |      // nearest representable value. Use doubles for the math to ensure the
  428|       |      // integer values are represented properly during the conversion process.
  429|      0|      *out_value = static_cast<OutT>(std::floor(
  430|      0|          in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  431|      0|          0.5));
  432|  46.4k|    } else {
  433|  46.4k|      *out_value = static_cast<OutT>(in_value);
  434|  46.4k|    }
  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|  46.4k|    return true;
  442|  46.4k|  }

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   57|  2.98k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.74k|  bool SetQuantizationBits(int32_t q) {
   60|  2.74k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 774, False: 1.97k]
  |  Branch (60:18): [True: 213, False: 1.76k]
  ------------------
   61|    987|      return false;
   62|    987|    }
   63|  1.76k|    quantization_bits_ = q;
   64|  1.76k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.76k|    max_value_ = max_quantized_value_ - 1;
   66|  1.76k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.76k|    center_value_ = max_value_ / 2;
   68|  1.76k|    return true;
   69|  2.74k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.66M|                                           int32_t *out_t) const {
   77|  2.66M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.88k, False: 2.65M]
  |  Branch (77:20): [True: 0, False: 3.88k]
  |  Branch (77:32): [True: 3.88k, False: 2.65M]
  |  Branch (77:42): [True: 0, False: 3.88k]
  ------------------
   78|  2.66M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.81M, False: 846k]
  |  Branch (78:29): [True: 3.11k, False: 1.81M]
  ------------------
   79|  3.11k|      s = max_value_;
   80|  3.11k|      t = max_value_;
   81|  2.66M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.88k, False: 2.65M]
  |  Branch (81:26): [True: 977, False: 2.90k]
  ------------------
   82|    977|      t = center_value_ - (t - center_value_);
   83|  2.65M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.81M, False: 845k]
  |  Branch (83:35): [True: 3.07k, False: 1.81M]
  ------------------
   84|  3.07k|      t = center_value_ + (center_value_ - t);
   85|  2.65M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.81M, False: 843k]
  |  Branch (85:35): [True: 149, False: 1.81M]
  ------------------
   86|    149|      s = center_value_ + (center_value_ - s);
   87|  2.65M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 5.35k, False: 2.65M]
  |  Branch (87:26): [True: 1.91k, False: 3.44k]
  ------------------
   88|  1.91k|      s = center_value_ - (s - center_value_);
   89|  1.91k|    }
   90|       |
   91|  2.66M|    *out_s = s;
   92|  2.66M|    *out_t = t;
   93|  2.66M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.66M|                                                       int32_t *out_t) const {
  100|  2.66M|    DRACO_DCHECK_EQ(
  101|  2.66M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.66M|        center_value_);
  103|  2.66M|    int32_t s, t;
  104|  2.66M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.42M, False: 1.24M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.42M|      s = (int_vec[1] + center_value_);
  107|  1.42M|      t = (int_vec[2] + center_value_);
  108|  1.42M|    } else {
  109|       |      // Left hemisphere.
  110|  1.24M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 43.3k, False: 1.19M]
  ------------------
  111|  43.3k|        s = std::abs(int_vec[2]);
  112|  1.19M|      } else {
  113|  1.19M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.19M|      }
  115|  1.24M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 45.5k, False: 1.19M]
  ------------------
  116|  45.5k|        t = std::abs(int_vec[1]);
  117|  1.19M|      } else {
  118|  1.19M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.19M|      }
  120|  1.24M|    }
  121|  2.66M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.66M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   161k|                                                    float *out_vector) const {
  199|   161k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   161k|                                 in_t * dequantization_scale_ - 1.f,
  201|   161k|                                 out_vector);
  202|   161k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.37M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.37M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.37M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.37M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.37M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.37M|    const uint32_t st =
  212|  2.37M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.37M|    return st <= center_value_;
  214|  2.37M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.95M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.95M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.95M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.95M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.95M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.95M|    int32_t sign_s = 0;
  223|  2.95M|    int32_t sign_t = 0;
  224|  2.95M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.64M, False: 312k]
  |  Branch (224:20): [True: 2.38M, False: 265k]
  ------------------
  225|  2.38M|      sign_s = 1;
  226|  2.38M|      sign_t = 1;
  227|  2.38M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 386k, False: 192k]
  |  Branch (227:27): [True: 262k, False: 123k]
  ------------------
  228|   262k|      sign_s = -1;
  229|   262k|      sign_t = -1;
  230|   315k|    } else {
  231|   315k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 192k, False: 123k]
  ------------------
  232|   315k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 123k, False: 192k]
  ------------------
  233|   315k|    }
  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|  2.95M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.95M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.95M|    uint32_t us = *s;
  241|  2.95M|    uint32_t ut = *t;
  242|  2.95M|    us = us + us - corner_point_s;
  243|  2.95M|    ut = ut + ut - corner_point_t;
  244|  2.95M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 2.64M, False: 315k]
  ------------------
  245|  2.64M|      uint32_t temp = us;
  246|  2.64M|      us = -ut;
  247|  2.64M|      ut = -temp;
  248|  2.64M|    } else {
  249|   315k|      std::swap(us, ut);
  250|   315k|    }
  251|  2.95M|    us = us + corner_point_s;
  252|  2.95M|    ut = ut + corner_point_t;
  253|       |
  254|  2.95M|    *s = us;
  255|  2.95M|    *t = ut;
  256|  2.95M|    *s /= 2;
  257|  2.95M|    *t /= 2;
  258|  2.95M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.74M|  int32_t ModMax(int32_t x) const {
  273|  4.74M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 5.54k, False: 4.73M]
  ------------------
  274|  5.54k|      return x - this->max_quantized_value();
  275|  5.54k|    }
  276|  4.73M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.34k, False: 4.73M]
  ------------------
  277|  1.34k|      return x + this->max_quantized_value();
  278|  1.34k|    }
  279|  4.73M|    return x;
  280|  4.73M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.71k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  6.88k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  14.2M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   161k|                                           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|   161k|    float y = in_s_scaled;
  329|   161k|    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|   161k|    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|   161k|    float x_offset = -x;
  342|   161k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 99, False: 161k]
  ------------------
  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|   161k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 55.9k, False: 105k]
  ------------------
  348|   161k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 56.0k, False: 105k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   161k|    const float norm_squared = x * x + y * y + z * z;
  352|   161k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 161k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   161k|    } else {
  357|   161k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   161k|      out_vector[0] = x * d;
  359|   161k|      out_vector[1] = y * d;
  360|   161k|      out_vector[2] = z * d;
  361|   161k|    }
  362|   161k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.66M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.66M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.66M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.66M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.66M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.66M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.66M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.43M, False: 226k]
  ------------------
  181|  2.43M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.43M|    } else {
  183|   226k|      vec[0] =
  184|   226k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   226k|          abs_sum;
  186|   226k|      vec[1] =
  187|   226k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   226k|          abs_sum;
  189|   226k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 122k, False: 103k]
  ------------------
  190|   122k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   122k|      } else {
  192|   103k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   103k|      }
  194|   226k|    }
  195|  2.66M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|    363|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    360|                                                                *buffer) {
  194|    360|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    360|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    360|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 20, False: 340]
  ------------------
  196|       |    // Decode prediction mode.
  197|     20|    uint8_t mode;
  198|     20|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 19]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|     19|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 7, False: 12]
  ------------------
  203|       |      // Unsupported mode.
  204|      7|      return false;
  205|      7|    }
  206|     19|  }
  207|    352|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.53k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.27k, False: 262]
  ------------------
  211|  1.27k|    uint32_t num_flags;
  212|  1.27k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 5, False: 1.26k]
  ------------------
  213|      5|      return false;
  214|      5|    }
  215|  1.26k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 71, False: 1.19k]
  ------------------
  216|     71|      return false;
  217|     71|    }
  218|  1.19k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 533, False: 665]
  ------------------
  219|    533|      is_crease_edge_[i].resize(num_flags);
  220|    533|      RAnsBitDecoder decoder;
  221|    533|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 14, False: 519]
  ------------------
  222|     14|        return false;
  223|     14|      }
  224|   911k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 910k, False: 519]
  ------------------
  225|   910k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   910k|      }
  227|    519|      decoder.EndDecoding();
  228|    519|    }
  229|  1.19k|  }
  230|    262|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    262|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    352|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    235|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    235|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    235|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.17k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 940, False: 235]
  ------------------
   93|    940|    pred_vals[i].resize(num_components, 0);
   94|    940|  }
   95|    235|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    235|                                         out_data);
   97|       |
   98|    235|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    235|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    235|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    235|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    235|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    235|  const int corner_map_size =
  109|    235|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   421k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 421k, False: 151]
  ------------------
  111|   421k|    const CornerIndex start_corner_id =
  112|   421k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   421k|    CornerIndex corner_id(start_corner_id);
  115|   421k|    int num_parallelograms = 0;
  116|   421k|    bool first_pass = true;
  117|   912k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 507k, False: 405k]
  ------------------
  118|   507k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 33.2k, False: 473k]
  ------------------
  119|   507k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   507k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  33.2k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  33.2k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 228, False: 32.9k]
  ------------------
  127|    228|          break;
  128|    228|        }
  129|  33.2k|      }
  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|   506k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 502k, False: 3.96k]
  ------------------
  134|   502k|        corner_id = table->SwingLeft(corner_id);
  135|   502k|      } else {
  136|  3.96k|        corner_id = table->SwingRight(corner_id);
  137|  3.96k|      }
  138|   506k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 15.6k, False: 491k]
  ------------------
  139|  15.6k|        break;
  140|  15.6k|      }
  141|   491k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 406k, False: 84.2k]
  |  Branch (141:47): [True: 405k, False: 1.68k]
  ------------------
  142|   405k|        first_pass = false;
  143|   405k|        corner_id = table->SwingRight(start_corner_id);
  144|   405k|      }
  145|   491k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   421k|    int num_used_parallelograms = 0;
  150|   421k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 18.4k, False: 402k]
  ------------------
  151|   630k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 611k, False: 18.4k]
  ------------------
  152|   611k|        multi_pred_vals[i] = 0;
  153|   611k|      }
  154|       |      // Check which parallelograms are actually used.
  155|  51.5k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 33.1k, False: 18.3k]
  ------------------
  156|  33.1k|        const int context = num_parallelograms - 1;
  157|  33.1k|        const int pos = is_crease_edge_pos[context]++;
  158|  33.1k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 84, False: 33.0k]
  ------------------
  159|     84|          return false;
  160|     84|        }
  161|  33.0k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  33.0k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7.10k, False: 25.9k]
  ------------------
  163|  7.10k|          ++num_used_parallelograms;
  164|   251k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 244k, False: 7.10k]
  ------------------
  165|   244k|            multi_pred_vals[j] =
  166|   244k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   244k|          }
  168|  7.10k|        }
  169|  33.0k|      }
  170|  18.4k|    }
  171|   421k|    const int dst_offset = p * num_components;
  172|   421k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 415k, False: 5.86k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   415k|      const int src_offset = (p - 1) * num_components;
  176|   415k|      this->transform().ComputeOriginalValue(
  177|   415k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   415k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   200k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 194k, False: 5.86k]
  ------------------
  181|   194k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   194k|      }
  183|  5.86k|      this->transform().ComputeOriginalValue(
  184|  5.86k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.86k|    }
  186|   421k|  }
  187|    151|  return true;
  188|    235|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|    397|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    394|                                                                *buffer) {
  194|    394|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    394|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    394|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 6, False: 388]
  ------------------
  196|       |    // Decode prediction mode.
  197|      6|    uint8_t mode;
  198|      6|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 5]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|      5|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 4]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      5|  }
  207|    392|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.71k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.42k, False: 294]
  ------------------
  211|  1.42k|    uint32_t num_flags;
  212|  1.42k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 3, False: 1.42k]
  ------------------
  213|      3|      return false;
  214|      3|    }
  215|  1.42k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 78, False: 1.34k]
  ------------------
  216|     78|      return false;
  217|     78|    }
  218|  1.34k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 633, False: 710]
  ------------------
  219|    633|      is_crease_edge_[i].resize(num_flags);
  220|    633|      RAnsBitDecoder decoder;
  221|    633|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 17, False: 616]
  ------------------
  222|     17|        return false;
  223|     17|      }
  224|  1.20M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.19M, False: 616]
  ------------------
  225|  1.19M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.19M|      }
  227|    616|      decoder.EndDecoding();
  228|    616|    }
  229|  1.34k|  }
  230|    294|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    294|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    392|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    273|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    273|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    273|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.36k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.09k, False: 273]
  ------------------
   93|  1.09k|    pred_vals[i].resize(num_components, 0);
   94|  1.09k|  }
   95|    273|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    273|                                         out_data);
   97|       |
   98|    273|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    273|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    273|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    273|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    273|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    273|  const int corner_map_size =
  109|    273|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   119k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 119k, False: 136]
  ------------------
  111|   119k|    const CornerIndex start_corner_id =
  112|   119k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   119k|    CornerIndex corner_id(start_corner_id);
  115|   119k|    int num_parallelograms = 0;
  116|   119k|    bool first_pass = true;
  117|   703k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 698k, False: 5.03k]
  ------------------
  118|   698k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 230k, False: 467k]
  ------------------
  119|   698k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   698k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   230k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   230k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 825, False: 229k]
  ------------------
  127|    825|          break;
  128|    825|        }
  129|   230k|      }
  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|   697k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 691k, False: 6.30k]
  ------------------
  134|   691k|        corner_id = table->SwingLeft(corner_id);
  135|   691k|      } else {
  136|  6.30k|        corner_id = table->SwingRight(corner_id);
  137|  6.30k|      }
  138|   697k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 113k, False: 584k]
  ------------------
  139|   113k|        break;
  140|   113k|      }
  141|   584k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 8.35k, False: 575k]
  |  Branch (141:47): [True: 5.04k, False: 3.30k]
  ------------------
  142|  5.04k|        first_pass = false;
  143|  5.04k|        corner_id = table->SwingRight(start_corner_id);
  144|  5.04k|      }
  145|   584k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   119k|    int num_used_parallelograms = 0;
  150|   119k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 118k, False: 1.21k]
  ------------------
  151|  14.6M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 14.5M, False: 118k]
  ------------------
  152|  14.5M|        multi_pred_vals[i] = 0;
  153|  14.5M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   348k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 230k, False: 117k]
  ------------------
  156|   230k|        const int context = num_parallelograms - 1;
  157|   230k|        const int pos = is_crease_edge_pos[context]++;
  158|   230k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 137, False: 230k]
  ------------------
  159|    137|          return false;
  160|    137|        }
  161|   230k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   230k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.00k, False: 222k]
  ------------------
  163|  8.00k|          ++num_used_parallelograms;
  164|   706k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 698k, False: 8.00k]
  ------------------
  165|   698k|            multi_pred_vals[j] =
  166|   698k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   698k|          }
  168|  8.00k|        }
  169|   230k|      }
  170|   118k|    }
  171|   119k|    const int dst_offset = p * num_components;
  172|   119k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 113k, False: 5.74k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   113k|      const int src_offset = (p - 1) * num_components;
  176|   113k|      this->transform().ComputeOriginalValue(
  177|   113k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   113k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   585k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 579k, False: 5.74k]
  ------------------
  181|   579k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   579k|      }
  183|  5.74k|      this->transform().ComputeOriginalValue(
  184|  5.74k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.74k|    }
  186|   119k|  }
  187|    136|  return true;
  188|    273|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.58k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.58k|    mesh_ = mesh;
   39|  2.58k|    corner_table_ = table;
   40|  2.58k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.58k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.58k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  13.5M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  9.55M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  9.55M|    return vertex_to_data_map_;
   48|  9.55M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  10.0M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  10.0M|    return data_to_corner_map_;
   51|  10.0M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.91k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.91k|    mesh_ = mesh;
   39|  2.91k|    corner_table_ = table;
   40|  2.91k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.91k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.91k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  10.5M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  9.07M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  9.07M|    return vertex_to_data_map_;
   48|  9.07M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.97M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.97M|    return data_to_corner_map_;
   51|  2.97M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   33|  2.58k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   33|  2.91k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   856k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   234k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   401k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   176k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|  2.13k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  12.7M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|  2.48k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.59M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    215|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    187|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    194|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    235|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    429|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    215|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    215|    DRACO_DCHECK_EQ(i, 0);
   70|    215|    (void)i;
   71|    215|    return GeometryAttribute::POSITION;
   72|    215|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    215|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    215|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 215]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    215|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 214]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    214|    predictor_.SetPositionAttribute(*att);
   82|    214|    return true;
   83|    215|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    213|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    213|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 207]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    207|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    207|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    207|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 73, False: 134]
  ------------------
  150|     73|    uint8_t prediction_mode;
  151|     73|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 73]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     73|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 22, False: 51]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     22|      return false;
  157|     22|    }
  158|       |
  159|     51|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 51]
  ------------------
  160|     51|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     51|  }
  164|    185|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    185|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 181]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    181|  return true;
  172|    185|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    181|                                      const PointIndex *entry_to_point_id_map) {
  103|    181|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    181|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    181|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    181|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    181|  const int corner_map_size =
  111|    181|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    181|  VectorD<int32_t, 3> pred_normal_3d;
  114|    181|  int32_t pred_normal_oct[2];
  115|       |
  116|   856k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 856k, False: 181]
  ------------------
  117|   856k|    const CornerIndex corner_id =
  118|   856k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   856k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   856k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   856k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   856k|                    octahedron_tool_box_.center_value());
  125|   856k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 369k, False: 487k]
  ------------------
  126|   369k|      pred_normal_3d = -pred_normal_3d;
  127|   369k|    }
  128|   856k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   856k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   856k|    const int data_offset = data_id * 2;
  132|   856k|    this->transform().ComputeOriginalValue(
  133|   856k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   856k|  }
  135|    181|  flip_normal_bit_decoder_.EndDecoding();
  136|    181|  return true;
  137|    181|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    181|  void SetQuantizationBits(int q) {
   85|    181|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    181|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    373|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    187|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    187|    DRACO_DCHECK_EQ(i, 0);
   70|    187|    (void)i;
   71|    187|    return GeometryAttribute::POSITION;
   72|    187|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    187|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    187|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 187]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    187|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 186]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    186|    predictor_.SetPositionAttribute(*att);
   82|    186|    return true;
   83|    187|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    186|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    186|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 179]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    179|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    179|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 49, False: 130]
  ------------------
  150|     49|    uint8_t prediction_mode;
  151|     49|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 49]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     49|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 47]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     47|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 47]
  ------------------
  160|     47|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     47|  }
  164|    177|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    177|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 11, False: 166]
  ------------------
  168|     11|    return false;
  169|     11|  }
  170|       |
  171|    166|  return true;
  172|    177|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    166|                                      const PointIndex *entry_to_point_id_map) {
  103|    166|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    166|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    166|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    166|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    166|  const int corner_map_size =
  111|    166|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    166|  VectorD<int32_t, 3> pred_normal_3d;
  114|    166|  int32_t pred_normal_oct[2];
  115|       |
  116|   234k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 234k, False: 166]
  ------------------
  117|   234k|    const CornerIndex corner_id =
  118|   234k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   234k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   234k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   234k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   234k|                    octahedron_tool_box_.center_value());
  125|   234k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 164k, False: 69.9k]
  ------------------
  126|   164k|      pred_normal_3d = -pred_normal_3d;
  127|   164k|    }
  128|   234k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   234k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   234k|    const int data_offset = data_id * 2;
  132|   234k|    this->transform().ComputeOriginalValue(
  133|   234k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   234k|  }
  135|    166|  flip_normal_bit_decoder_.EndDecoding();
  136|    166|  return true;
  137|    166|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    166|  void SetQuantizationBits(int q) {
   85|    166|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    166|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    385|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    194|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    194|    DRACO_DCHECK_EQ(i, 0);
   70|    194|    (void)i;
   71|    194|    return GeometryAttribute::POSITION;
   72|    194|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    194|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    194|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 194]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    194|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 191]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    191|    predictor_.SetPositionAttribute(*att);
   82|    191|    return true;
   83|    194|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    191|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    191|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 183]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    183|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    183|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    183|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 43, False: 140]
  ------------------
  150|     43|    uint8_t prediction_mode;
  151|     43|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 42]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     42|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 40]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  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|    180|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    180|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 174]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    174|  return true;
  172|    180|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    174|                                      const PointIndex *entry_to_point_id_map) {
  103|    174|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    174|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    174|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    174|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    174|  const int corner_map_size =
  111|    174|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    174|  VectorD<int32_t, 3> pred_normal_3d;
  114|    174|  int32_t pred_normal_oct[2];
  115|       |
  116|   401k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 400k, False: 174]
  ------------------
  117|   400k|    const CornerIndex corner_id =
  118|   400k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   400k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   400k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   400k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   400k|                    octahedron_tool_box_.center_value());
  125|   400k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 358k, False: 42.4k]
  ------------------
  126|   358k|      pred_normal_3d = -pred_normal_3d;
  127|   358k|    }
  128|   400k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   400k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   400k|    const int data_offset = data_id * 2;
  132|   400k|    this->transform().ComputeOriginalValue(
  133|   400k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   400k|  }
  135|    174|  flip_normal_bit_decoder_.EndDecoding();
  136|    174|  return true;
  137|    174|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    174|  void SetQuantizationBits(int q) {
   85|    174|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    174|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    468|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    235|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    235|    DRACO_DCHECK_EQ(i, 0);
   70|    235|    (void)i;
   71|    235|    return GeometryAttribute::POSITION;
   72|    235|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    235|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    235|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 235]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    235|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 233]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    233|    predictor_.SetPositionAttribute(*att);
   82|    233|    return true;
   83|    235|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    233|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    233|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 225]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    225|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    225|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    225|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 53, False: 172]
  ------------------
  150|     53|    uint8_t prediction_mode;
  151|     53|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 52]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     52|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 50]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     50|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 50]
  ------------------
  160|     50|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     50|  }
  164|    222|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    222|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 13, False: 209]
  ------------------
  168|     13|    return false;
  169|     13|  }
  170|       |
  171|    209|  return true;
  172|    222|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    209|                                      const PointIndex *entry_to_point_id_map) {
  103|    209|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    209|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    209|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    209|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    209|  const int corner_map_size =
  111|    209|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    209|  VectorD<int32_t, 3> pred_normal_3d;
  114|    209|  int32_t pred_normal_oct[2];
  115|       |
  116|   176k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 176k, False: 209]
  ------------------
  117|   176k|    const CornerIndex corner_id =
  118|   176k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   176k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   176k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   176k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   176k|                    octahedron_tool_box_.center_value());
  125|   176k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 138k, False: 38.1k]
  ------------------
  126|   138k|      pred_normal_3d = -pred_normal_3d;
  127|   138k|    }
  128|   176k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   176k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   176k|    const int data_offset = data_id * 2;
  132|   176k|    this->transform().ComputeOriginalValue(
  133|   176k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   176k|  }
  135|    209|  flip_normal_bit_decoder_.EndDecoding();
  136|    209|  return true;
  137|    209|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    209|  void SetQuantizationBits(int q) {
   85|    209|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    209|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    317|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    632|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    317|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    317|    DRACO_DCHECK_EQ(i, 0);
   70|    317|    (void)i;
   71|    317|    return GeometryAttribute::POSITION;
   72|    317|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    317|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    317|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 317]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    317|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 315]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    315|    predictor_.SetPositionAttribute(*att);
   82|    315|    return true;
   83|    317|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    310|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    310|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 15, False: 295]
  ------------------
  145|     15|    return false;
  146|     15|  }
  147|       |
  148|    295|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    295|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    295|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 204, False: 91]
  ------------------
  150|    204|    uint8_t prediction_mode;
  151|    204|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 203]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    203|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 200]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|    200|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 200]
  ------------------
  160|    200|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    200|  }
  164|    291|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    291|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 11, False: 280]
  ------------------
  168|     11|    return false;
  169|     11|  }
  170|       |
  171|    280|  return true;
  172|    291|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    280|                                      const PointIndex *entry_to_point_id_map) {
  103|    280|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    280|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    280|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    280|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    280|  const int corner_map_size =
  111|    280|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    280|  VectorD<int32_t, 3> pred_normal_3d;
  114|    280|  int32_t pred_normal_oct[2];
  115|       |
  116|   764k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 764k, False: 280]
  ------------------
  117|   764k|    const CornerIndex corner_id =
  118|   764k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   764k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   764k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   764k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   764k|                    octahedron_tool_box_.center_value());
  125|   764k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 484k, False: 279k]
  ------------------
  126|   484k|      pred_normal_3d = -pred_normal_3d;
  127|   484k|    }
  128|   764k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   764k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   764k|    const int data_offset = data_id * 2;
  132|   764k|    this->transform().ComputeOriginalValue(
  133|   764k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   764k|  }
  135|    280|  flip_normal_bit_decoder_.EndDecoding();
  136|    280|  return true;
  137|    280|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    280|  void SetQuantizationBits(int q) {
   85|    280|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    280|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    350|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    696|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    350|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    350|    DRACO_DCHECK_EQ(i, 0);
   70|    350|    (void)i;
   71|    350|    return GeometryAttribute::POSITION;
   72|    350|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    347|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    347|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 347]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    347|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 346]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    346|    predictor_.SetPositionAttribute(*att);
   82|    346|    return true;
   83|    347|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    344|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    344|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 22, False: 322]
  ------------------
  145|     22|    return false;
  146|     22|  }
  147|       |
  148|    322|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    322|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    322|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 183, False: 139]
  ------------------
  150|    183|    uint8_t prediction_mode;
  151|    183|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 183]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|    183|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 8, False: 175]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      8|      return false;
  157|      8|    }
  158|       |
  159|    175|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 175]
  ------------------
  160|    175|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    175|  }
  164|    314|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    314|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 12, False: 302]
  ------------------
  168|     12|    return false;
  169|     12|  }
  170|       |
  171|    302|  return true;
  172|    314|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    302|                                      const PointIndex *entry_to_point_id_map) {
  103|    302|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    302|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    302|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    302|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    302|  const int corner_map_size =
  111|    302|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    302|  VectorD<int32_t, 3> pred_normal_3d;
  114|    302|  int32_t pred_normal_oct[2];
  115|       |
  116|   231k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 231k, False: 302]
  ------------------
  117|   231k|    const CornerIndex corner_id =
  118|   231k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   231k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   231k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   231k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   231k|                    octahedron_tool_box_.center_value());
  125|   231k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 181k, False: 50.3k]
  ------------------
  126|   181k|      pred_normal_3d = -pred_normal_3d;
  127|   181k|    }
  128|   231k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   231k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   231k|    const int data_offset = data_id * 2;
  132|   231k|    this->transform().ComputeOriginalValue(
  133|   231k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   231k|  }
  135|    302|  flip_normal_bit_decoder_.EndDecoding();
  136|    302|  return true;
  137|    302|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    302|  void SetQuantizationBits(int q) {
   85|    302|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    302|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    215|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    187|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    194|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   37|    235|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    266|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    266|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 50, False: 216]
  ------------------
  105|     50|      this->normal_prediction_mode_ = mode;
  106|     50|      return true;
  107|    216|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 216, False: 0]
  ------------------
  108|    216|      this->normal_prediction_mode_ = mode;
  109|    216|      return true;
  110|    216|    }
  111|      0|    return false;
  112|    266|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   856k|                             DataTypeT *prediction) override {
   42|   856k|    DRACO_DCHECK(this->IsInitialized());
   43|   856k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   856k|    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|   856k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   856k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   856k|    VectorD<int64_t, 3> normal;
   53|   856k|    CornerIndex c_next, c_prev;
   54|  1.91M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.06M, False: 856k]
  ------------------
   55|       |      // Getting corners.
   56|  1.06M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 294, False: 1.06M]
  ------------------
   57|    294|        c_next = corner_table->Next(corner_id);
   58|    294|        c_prev = corner_table->Previous(corner_id);
   59|  1.06M|      } else {
   60|  1.06M|        c_next = corner_table->Next(cit.Corner());
   61|  1.06M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.06M|      }
   63|  1.06M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.06M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.06M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.06M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.06M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.06M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.06M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.06M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.06M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.06M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.06M|      cit.Next();
   81|  1.06M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   856k|    constexpr int64_t upper_bound = 1 << 29;
   85|   856k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 196, False: 856k]
  ------------------
   86|    196|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    196|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 54, False: 142]
  ------------------
   88|     54|        const int64_t quotient = abs_sum / upper_bound;
   89|     54|        normal = normal / quotient;
   90|     54|      }
   91|   856k|    } else {
   92|   856k|      const int64_t abs_sum = normal.AbsSum();
   93|   856k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.02k, False: 853k]
  ------------------
   94|  3.02k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.02k|        normal = normal / quotient;
   96|  3.02k|      }
   97|   856k|    }
   98|   856k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   856k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   856k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   856k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   856k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    234|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    234|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 45, False: 189]
  ------------------
  105|     45|      this->normal_prediction_mode_ = mode;
  106|     45|      return true;
  107|    189|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 189, False: 0]
  ------------------
  108|    189|      this->normal_prediction_mode_ = mode;
  109|    189|      return true;
  110|    189|    }
  111|      0|    return false;
  112|    234|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   234k|                             DataTypeT *prediction) override {
   42|   234k|    DRACO_DCHECK(this->IsInitialized());
   43|   234k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   234k|    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|   234k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   234k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   234k|    VectorD<int64_t, 3> normal;
   53|   234k|    CornerIndex c_next, c_prev;
   54|  1.63M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.39M, False: 234k]
  ------------------
   55|       |      // Getting corners.
   56|  1.39M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 216, False: 1.39M]
  ------------------
   57|    216|        c_next = corner_table->Next(corner_id);
   58|    216|        c_prev = corner_table->Previous(corner_id);
   59|  1.39M|      } else {
   60|  1.39M|        c_next = corner_table->Next(cit.Corner());
   61|  1.39M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.39M|      }
   63|  1.39M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.39M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.39M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.39M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.39M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.39M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.39M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.39M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.39M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.39M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.39M|      cit.Next();
   81|  1.39M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   234k|    constexpr int64_t upper_bound = 1 << 29;
   85|   234k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 144, False: 234k]
  ------------------
   86|    144|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    144|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 31, False: 113]
  ------------------
   88|     31|        const int64_t quotient = abs_sum / upper_bound;
   89|     31|        normal = normal / quotient;
   90|     31|      }
   91|   234k|    } else {
   92|   234k|      const int64_t abs_sum = normal.AbsSum();
   93|   234k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 110k, False: 123k]
  ------------------
   94|   110k|        const int64_t quotient = abs_sum / upper_bound;
   95|   110k|        normal = normal / quotient;
   96|   110k|      }
   97|   234k|    }
   98|   234k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   234k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   234k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   234k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   234k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    234|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    234|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 39, False: 195]
  ------------------
  105|     39|      this->normal_prediction_mode_ = mode;
  106|     39|      return true;
  107|    195|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 195, False: 0]
  ------------------
  108|    195|      this->normal_prediction_mode_ = mode;
  109|    195|      return true;
  110|    195|    }
  111|      0|    return false;
  112|    234|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   400k|                             DataTypeT *prediction) override {
   42|   400k|    DRACO_DCHECK(this->IsInitialized());
   43|   400k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   400k|    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|   400k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   400k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   400k|    VectorD<int64_t, 3> normal;
   53|   400k|    CornerIndex c_next, c_prev;
   54|  1.27M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 878k, False: 400k]
  ------------------
   55|       |      // Getting corners.
   56|   878k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 234, False: 878k]
  ------------------
   57|    234|        c_next = corner_table->Next(corner_id);
   58|    234|        c_prev = corner_table->Previous(corner_id);
   59|   878k|      } else {
   60|   878k|        c_next = corner_table->Next(cit.Corner());
   61|   878k|        c_prev = corner_table->Previous(cit.Corner());
   62|   878k|      }
   63|   878k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   878k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   878k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   878k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   878k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   878k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   878k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   878k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   878k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   878k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   878k|      cit.Next();
   81|   878k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   400k|    constexpr int64_t upper_bound = 1 << 29;
   85|   400k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 158, False: 400k]
  ------------------
   86|    158|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    158|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 55, False: 103]
  ------------------
   88|     55|        const int64_t quotient = abs_sum / upper_bound;
   89|     55|        normal = normal / quotient;
   90|     55|      }
   91|   400k|    } else {
   92|   400k|      const int64_t abs_sum = normal.AbsSum();
   93|   400k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.27k, False: 398k]
  ------------------
   94|  2.27k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.27k|        normal = normal / quotient;
   96|  2.27k|      }
   97|   400k|    }
   98|   400k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   400k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   400k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   400k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   400k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    285|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    285|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 46, False: 239]
  ------------------
  105|     46|      this->normal_prediction_mode_ = mode;
  106|     46|      return true;
  107|    239|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 239, False: 0]
  ------------------
  108|    239|      this->normal_prediction_mode_ = mode;
  109|    239|      return true;
  110|    239|    }
  111|      0|    return false;
  112|    285|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   176k|                             DataTypeT *prediction) override {
   42|   176k|    DRACO_DCHECK(this->IsInitialized());
   43|   176k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   176k|    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|   176k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   176k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   176k|    VectorD<int64_t, 3> normal;
   53|   176k|    CornerIndex c_next, c_prev;
   54|  1.22M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.05M, False: 176k]
  ------------------
   55|       |      // Getting corners.
   56|  1.05M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 234, False: 1.05M]
  ------------------
   57|    234|        c_next = corner_table->Next(corner_id);
   58|    234|        c_prev = corner_table->Previous(corner_id);
   59|  1.05M|      } else {
   60|  1.05M|        c_next = corner_table->Next(cit.Corner());
   61|  1.05M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.05M|      }
   63|  1.05M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.05M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.05M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.05M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.05M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.05M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.05M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.05M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.05M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.05M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.05M|      cit.Next();
   81|  1.05M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   176k|    constexpr int64_t upper_bound = 1 << 29;
   85|   176k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 156, False: 176k]
  ------------------
   86|    156|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    156|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 40, False: 116]
  ------------------
   88|     40|        const int64_t quotient = abs_sum / upper_bound;
   89|     40|        normal = normal / quotient;
   90|     40|      }
   91|   176k|    } else {
   92|   176k|      const int64_t abs_sum = normal.AbsSum();
   93|   176k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 97.0k, False: 79.0k]
  ------------------
   94|  97.0k|        const int64_t quotient = abs_sum / upper_bound;
   95|  97.0k|        normal = normal / quotient;
   96|  97.0k|      }
   97|   176k|    }
   98|   176k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   176k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   176k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   176k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   176k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    317|      : Base(md) {
   35|    317|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    317|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    517|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    517|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 185, False: 332]
  ------------------
  105|    185|      this->normal_prediction_mode_ = mode;
  106|    185|      return true;
  107|    332|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 332, False: 0]
  ------------------
  108|    332|      this->normal_prediction_mode_ = mode;
  109|    332|      return true;
  110|    332|    }
  111|      0|    return false;
  112|    517|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   764k|                             DataTypeT *prediction) override {
   42|   764k|    DRACO_DCHECK(this->IsInitialized());
   43|   764k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   764k|    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|   764k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   764k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   764k|    VectorD<int64_t, 3> normal;
   53|   764k|    CornerIndex c_next, c_prev;
   54|  1.60M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 838k, False: 764k]
  ------------------
   55|       |      // Getting corners.
   56|   838k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.06k, False: 837k]
  ------------------
   57|  1.06k|        c_next = corner_table->Next(corner_id);
   58|  1.06k|        c_prev = corner_table->Previous(corner_id);
   59|   837k|      } else {
   60|   837k|        c_next = corner_table->Next(cit.Corner());
   61|   837k|        c_prev = corner_table->Previous(cit.Corner());
   62|   837k|      }
   63|   838k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   838k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   838k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   838k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   838k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   838k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   838k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   838k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   838k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   838k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   838k|      cit.Next();
   81|   838k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   764k|    constexpr int64_t upper_bound = 1 << 29;
   85|   764k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 756, False: 763k]
  ------------------
   86|    756|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    756|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 145, False: 611]
  ------------------
   88|    145|        const int64_t quotient = abs_sum / upper_bound;
   89|    145|        normal = normal / quotient;
   90|    145|      }
   91|   763k|    } else {
   92|   763k|      const int64_t abs_sum = normal.AbsSum();
   93|   763k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.62k, False: 761k]
  ------------------
   94|  1.62k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.62k|        normal = normal / quotient;
   96|  1.62k|      }
   97|   763k|    }
   98|   764k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   764k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   764k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   764k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   764k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    350|      : Base(md) {
   35|    350|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    350|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    525|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    525|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 173, False: 352]
  ------------------
  105|    173|      this->normal_prediction_mode_ = mode;
  106|    173|      return true;
  107|    352|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 352, False: 0]
  ------------------
  108|    352|      this->normal_prediction_mode_ = mode;
  109|    352|      return true;
  110|    352|    }
  111|      0|    return false;
  112|    525|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   231k|                             DataTypeT *prediction) override {
   42|   231k|    DRACO_DCHECK(this->IsInitialized());
   43|   231k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   231k|    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|   231k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   231k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   231k|    VectorD<int64_t, 3> normal;
   53|   231k|    CornerIndex c_next, c_prev;
   54|  1.57M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.34M, False: 231k]
  ------------------
   55|       |      // Getting corners.
   56|  1.34M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.02k, False: 1.34M]
  ------------------
   57|  1.02k|        c_next = corner_table->Next(corner_id);
   58|  1.02k|        c_prev = corner_table->Previous(corner_id);
   59|  1.34M|      } else {
   60|  1.34M|        c_next = corner_table->Next(cit.Corner());
   61|  1.34M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.34M|      }
   63|  1.34M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.34M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.34M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.34M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.34M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.34M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.34M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.34M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.34M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.34M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.34M|      cit.Next();
   81|  1.34M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   231k|    constexpr int64_t upper_bound = 1 << 29;
   85|   231k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 680, False: 230k]
  ------------------
   86|    680|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    680|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 105, False: 575]
  ------------------
   88|    105|        const int64_t quotient = abs_sum / upper_bound;
   89|    105|        normal = normal / quotient;
   90|    105|      }
   91|   230k|    } else {
   92|   230k|      const int64_t abs_sum = normal.AbsSum();
   93|   230k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.83k, False: 227k]
  ------------------
   94|  2.83k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.83k|        normal = normal / quotient;
   96|  2.83k|      }
   97|   230k|    }
   98|   231k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   231k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   231k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   231k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   231k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    215|      : Base(md) {
   35|    215|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    215|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    187|      : Base(md) {
   35|    187|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    187|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    194|      : Base(md) {
   35|    194|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    194|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    235|      : Base(md) {
   35|    235|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    235|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.97M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.97M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.97M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.97M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.97M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.97M|    return GetPositionForDataId(data_id);
   77|  2.97M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.97M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.97M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.97M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.97M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.97M|    VectorD<int64_t, 3> pos;
   68|  2.97M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.97M|    return pos;
   70|  2.97M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    214|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    214|    pos_attribute_ = &position_attribute;
   43|    214|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    181|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    181|    entry_to_point_id_map_ = map;
   46|    181|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.02M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.02M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.02M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.02M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.02M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.02M|    return GetPositionForDataId(data_id);
   77|  3.02M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.02M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.02M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.02M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.02M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.02M|    VectorD<int64_t, 3> pos;
   68|  3.02M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.02M|    return pos;
   70|  3.02M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    186|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    186|    pos_attribute_ = &position_attribute;
   43|    186|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    166|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    166|    entry_to_point_id_map_ = map;
   46|    166|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.15M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.15M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.15M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.15M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.15M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.15M|    return GetPositionForDataId(data_id);
   77|  2.15M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.15M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.15M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.15M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.15M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.15M|    VectorD<int64_t, 3> pos;
   68|  2.15M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.15M|    return pos;
   70|  2.15M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    191|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    191|    pos_attribute_ = &position_attribute;
   43|    191|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    174|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    174|    entry_to_point_id_map_ = map;
   46|    174|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.27M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.27M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.27M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.27M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.27M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.27M|    return GetPositionForDataId(data_id);
   77|  2.27M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.27M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.27M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.27M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.27M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.27M|    VectorD<int64_t, 3> pos;
   68|  2.27M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.27M|    return pos;
   70|  2.27M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    233|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    233|    pos_attribute_ = &position_attribute;
   43|    233|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    209|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    209|    entry_to_point_id_map_ = map;
   46|    209|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|    317|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    317|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.44M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.44M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.44M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.44M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.44M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.44M|    return GetPositionForDataId(data_id);
   77|  2.44M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.44M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.44M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.44M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.44M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.44M|    VectorD<int64_t, 3> pos;
   68|  2.44M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.44M|    return pos;
   70|  2.44M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    315|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    315|    pos_attribute_ = &position_attribute;
   43|    315|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    280|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    280|    entry_to_point_id_map_ = map;
   46|    280|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|    350|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    350|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.91M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.91M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.91M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.91M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.91M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.91M|    return GetPositionForDataId(data_id);
   77|  2.91M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.91M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.91M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.91M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.91M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.91M|    VectorD<int64_t, 3> pos;
   68|  2.91M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.91M|    return pos;
   70|  2.91M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    346|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    346|    pos_attribute_ = &position_attribute;
   43|    346|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    302|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    302|    entry_to_point_id_map_ = map;
   46|    302|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|    215|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    215|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|    187|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    187|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|    194|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    194|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|    235|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    235|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|    388|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    380|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    380|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    380|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    380|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    380|      new DataTypeT[num_components]());
   70|       |
   71|    380|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    380|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    380|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    380|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    380|  const int corner_map_size =
   78|    380|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  2.54M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 2.54M, False: 380]
  ------------------
   80|  2.54M|    const CornerIndex start_corner_id =
   81|  2.54M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  2.54M|    CornerIndex corner_id(start_corner_id);
   84|  2.54M|    int num_parallelograms = 0;
   85|  71.0M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 68.5M, False: 2.54M]
  ------------------
   86|  68.5M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  68.5M|    }
   88|  5.56M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 3.01M, False: 2.54M]
  ------------------
   89|  3.01M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 184k, False: 2.83M]
  ------------------
   90|  3.01M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  3.01M|              num_components, parallelogram_pred_vals.get())) {
   92|  12.1M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 11.9M, False: 184k]
  ------------------
   93|  11.9M|          pred_vals[c] =
   94|  11.9M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  11.9M|        }
   96|   184k|        ++num_parallelograms;
   97|   184k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  3.01M|      corner_id = table->SwingRight(corner_id);
  101|  3.01M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 91.3k, False: 2.92M]
  ------------------
  102|  91.3k|        corner_id = kInvalidCornerIndex;
  103|  91.3k|      }
  104|  3.01M|    }
  105|       |
  106|  2.54M|    const int dst_offset = p * num_components;
  107|  2.54M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2.44M, False: 103k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  2.44M|      const int src_offset = (p - 1) * num_components;
  111|  2.44M|      this->transform().ComputeOriginalValue(
  112|  2.44M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  2.44M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  6.62M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 6.52M, False: 103k]
  ------------------
  116|  6.52M|        pred_vals[c] /= num_parallelograms;
  117|  6.52M|      }
  118|   103k|      this->transform().ComputeOriginalValue(
  119|   103k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   103k|    }
  121|  2.54M|  }
  122|    380|  return true;
  123|    380|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|    403|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    387|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    387|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    387|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    387|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    387|      new DataTypeT[num_components]());
   70|       |
   71|    387|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    387|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    387|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    387|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    387|  const int corner_map_size =
   78|    387|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.02M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.02M, False: 387]
  ------------------
   80|  1.02M|    const CornerIndex start_corner_id =
   81|  1.02M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.02M|    CornerIndex corner_id(start_corner_id);
   84|  1.02M|    int num_parallelograms = 0;
   85|  39.3M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 38.3M, False: 1.02M]
  ------------------
   86|  38.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  38.3M|    }
   88|  7.09M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 6.06M, False: 1.02M]
  ------------------
   89|  6.06M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 2.00M, False: 4.06M]
  ------------------
   90|  6.06M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  6.06M|              num_components, parallelogram_pred_vals.get())) {
   92|  77.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 75.3M, False: 2.00M]
  ------------------
   93|  75.3M|          pred_vals[c] =
   94|  75.3M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  75.3M|        }
   96|  2.00M|        ++num_parallelograms;
   97|  2.00M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  6.06M|      corner_id = table->SwingRight(corner_id);
  101|  6.06M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 1.00M, False: 5.06M]
  ------------------
  102|  1.00M|        corner_id = kInvalidCornerIndex;
  103|  1.00M|      }
  104|  6.06M|    }
  105|       |
  106|  1.02M|    const int dst_offset = p * num_components;
  107|  1.02M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.60k, False: 1.02M]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.60k|      const int src_offset = (p - 1) * num_components;
  111|  1.60k|      this->transform().ComputeOriginalValue(
  112|  1.60k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.02M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  39.3M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 38.3M, False: 1.02M]
  ------------------
  116|  38.3M|        pred_vals[c] /= num_parallelograms;
  117|  38.3M|      }
  118|  1.02M|      this->transform().ComputeOriginalValue(
  119|  1.02M|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  1.02M|    }
  121|  1.02M|  }
  122|    387|  return true;
  123|    387|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  7.63M|    int num_components, DataTypeT *out_prediction) {
   49|  7.63M|  const CornerIndex oci = table->Opposite(ci);
   50|  7.63M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 6.69M, False: 942k]
  ------------------
   51|  6.69M|    return false;
   52|  6.69M|  }
   53|   942k|  int vert_opp, vert_next, vert_prev;
   54|   942k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   942k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   942k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 599k, False: 342k]
  |  Branch (56:35): [True: 509k, False: 90.1k]
  ------------------
   57|   942k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 484k, False: 25.2k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   484k|    const int v_opp_off = vert_opp * num_components;
   60|   484k|    const int v_next_off = vert_next * num_components;
   61|   484k|    const int v_prev_off = vert_prev * num_components;
   62|  17.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 17.3M, False: 484k]
  ------------------
   63|  17.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  17.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  17.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  17.3M|      const int64_t result =
   67|  17.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  17.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  17.3M|    }
   71|   484k|    return true;
   72|   484k|  }
   73|   457k|  return false;  // Not all data is available for prediction
   74|   942k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   942k|    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|   942k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   942k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   942k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   942k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  7.53M|    int num_components, DataTypeT *out_prediction) {
   49|  7.53M|  const CornerIndex oci = table->Opposite(ci);
   50|  7.53M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 24.3k, False: 7.50M]
  ------------------
   51|  24.3k|    return false;
   52|  24.3k|  }
   53|  7.50M|  int vert_opp, vert_next, vert_prev;
   54|  7.50M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  7.50M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  7.50M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 4.12M, False: 3.38M]
  |  Branch (56:35): [True: 3.25M, False: 871k]
  ------------------
   57|  7.50M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.99M, False: 256k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.99M|    const int v_opp_off = vert_opp * num_components;
   60|  2.99M|    const int v_next_off = vert_next * num_components;
   61|  2.99M|    const int v_prev_off = vert_prev * num_components;
   62|   143M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 140M, False: 2.99M]
  ------------------
   63|   140M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   140M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   140M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   140M|      const int64_t result =
   67|   140M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   140M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   140M|    }
   71|  2.99M|    return true;
   72|  2.99M|  }
   73|  4.51M|  return false;  // Not all data is available for prediction
   74|  7.50M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  7.50M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  7.50M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  7.50M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  7.50M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  7.50M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   49|    181|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    359|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    181|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    181|    DRACO_DCHECK_EQ(i, 0);
   75|    181|    (void)i;
   76|    181|    return GeometryAttribute::POSITION;
   77|    181|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    181|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    181|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 181]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    181|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 181]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    181|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 3, False: 178]
  ------------------
   87|      3|      return false;  // Currently works only for 3 component positions.
   88|      3|    }
   89|    178|    pos_attribute_ = att;
   90|    178|    return true;
   91|    181|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    178|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    178|  uint32_t num_orientations = 0;
  156|    178|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 4, False: 174]
  ------------------
  157|      4|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 2, False: 2]
  ------------------
  158|      2|      return false;
  159|      2|    }
  160|    174|  } else {
  161|    174|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 2, False: 172]
  ------------------
  162|      2|      return false;
  163|      2|    }
  164|    174|  }
  165|    174|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 173]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|    173|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 32, False: 141]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|     32|    return false;
  172|     32|  }
  173|    141|  orientations_.resize(num_orientations);
  174|    141|  bool last_orientation = true;
  175|    141|  RAnsBitDecoder decoder;
  176|    141|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 140]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  36.2k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 36.1k, False: 140]
  ------------------
  180|  36.1k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 2.48k, False: 33.6k]
  ------------------
  181|  2.48k|      last_orientation = !last_orientation;
  182|  2.48k|    }
  183|  36.1k|    orientations_[i] = last_orientation;
  184|  36.1k|  }
  185|    140|  decoder.EndDecoding();
  186|    140|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    140|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    141|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    129|                          const PointIndex *entry_to_point_id_map) {
  126|    129|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 2, False: 127]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      2|    return false;
  129|      2|  }
  130|    127|  num_components_ = num_components;
  131|    127|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    127|  predicted_value_ =
  133|    127|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    127|  this->transform().Init(num_components);
  135|       |
  136|    127|  const int corner_map_size =
  137|    127|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   652k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 652k, False: 88]
  ------------------
  139|   652k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   652k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 39, False: 652k]
  ------------------
  141|     39|      return false;
  142|     39|    }
  143|       |
  144|   652k|    const int dst_offset = p * num_components;
  145|   652k|    this->transform().ComputeOriginalValue(
  146|   652k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   652k|  }
  148|     88|  return true;
  149|    127|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   652k|                          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|   652k|  const CornerIndex next_corner_id =
  198|   652k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   652k|  const CornerIndex prev_corner_id =
  200|   652k|      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|   652k|  int next_data_id, prev_data_id;
  204|       |
  205|   652k|  int next_vert_id, prev_vert_id;
  206|   652k|  next_vert_id =
  207|   652k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   652k|  prev_vert_id =
  209|   652k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   652k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   652k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   652k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 437k, False: 215k]
  |  Branch (214:33): [True: 221k, False: 215k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   221k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   221k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   221k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 218k, False: 2.91k]
  ------------------
  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|   437k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 437k, False: 218k]
  ------------------
  223|   437k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 437k]
  |  Branch (223:36): [True: 282, False: 437k]
  ------------------
  224|   437k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 437k]
  ------------------
  225|    282|          predicted_value_[i] = INT_MIN;
  226|   437k|        } else {
  227|   437k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   437k|        }
  229|   437k|      }
  230|   218k|      return true;
  231|   218k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  2.91k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  2.91k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  2.91k|    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.91k|    const Vector3f pn = prev_pos - next_pos;
  261|  2.91k|    const Vector3f cn = tip_pos - next_pos;
  262|  2.91k|    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.91k|    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.91k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  5.82k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 2.91k]
  |  Branch (273:53): [True: 661, False: 2.25k]
  ------------------
  274|    661|      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|    661|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  2.25k|    } else {
  280|  2.25k|      s = 0;
  281|  2.25k|      t = 0;
  282|  2.25k|    }
  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.91k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  2.91k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  2.91k|    const float pnut = pn_uv[0] * t;
  301|  2.91k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  2.91k|    const float pnvt = pn_uv[1] * t;
  303|  2.91k|    Vector2f predicted_uv;
  304|  2.91k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 39, False: 2.87k]
  ------------------
  305|     39|      return false;
  306|     39|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  2.87k|    const bool orientation = orientations_.back();
  310|  2.87k|    orientations_.pop_back();
  311|  2.87k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 1.53k, False: 1.33k]
  ------------------
  312|  1.53k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.53k|    } else {
  314|  1.33k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.33k|    }
  316|  2.87k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [Folded - Ignored]
  ------------------
  317|       |      // Round the predicted value for integer types.
  318|       |      // Technically floats > INT_MAX are undefined, but compilers will
  319|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  320|  2.87k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  2.87k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 2.87k]
  |  Branch (321:28): [True: 266, False: 2.60k]
  |  Branch (321:43): [True: 69, False: 2.53k]
  ------------------
  322|    335|        predicted_value_[0] = INT_MIN;
  323|  2.53k|      } else {
  324|  2.53k|        predicted_value_[0] = static_cast<int>(u);
  325|  2.53k|      }
  326|  2.87k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  2.87k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 2.87k]
  |  Branch (327:28): [True: 254, False: 2.61k]
  |  Branch (327:43): [True: 71, False: 2.54k]
  ------------------
  328|    325|        predicted_value_[1] = INT_MIN;
  329|  2.54k|      } else {
  330|  2.54k|        predicted_value_[1] = static_cast<int>(v);
  331|  2.54k|      }
  332|  2.87k|    } 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.87k|    return true;
  338|  2.91k|  }
  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|   430k|  int data_offset = 0;
  343|   430k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 215k, False: 215k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   215k|    data_offset = prev_data_id * num_components_;
  346|   215k|  }
  347|   430k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 27, False: 430k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     27|    data_offset = next_data_id * num_components_;
  350|   430k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   430k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 430k, False: 127]
  ------------------
  354|   430k|      data_offset = (data_id - 1) * num_components_;
  355|   430k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    381|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 254, False: 127]
  ------------------
  358|    254|        predicted_value_[i] = 0;
  359|    254|      }
  360|    127|      return true;
  361|    127|    }
  362|   430k|  }
  363|  1.29M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 861k, False: 430k]
  ------------------
  364|   861k|    predicted_value_[i] = data[data_offset + i];
  365|   861k|  }
  366|   430k|  return true;
  367|   430k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   443k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   443k|    const int data_offset = entry_id * num_components_;
  104|   443k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   443k|                    static_cast<float>(data[data_offset + 1]));
  106|   443k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  8.73k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  8.73k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  8.73k|    Vector3f pos;
   97|  8.73k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  8.73k|                                 &pos[0]);
   99|  8.73k|    return pos;
  100|  8.73k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   49|    240|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    476|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    240|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    240|    DRACO_DCHECK_EQ(i, 0);
   75|    240|    (void)i;
   76|    240|    return GeometryAttribute::POSITION;
   77|    240|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    239|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    239|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 239]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    239|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 239]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    239|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 3, False: 236]
  ------------------
   87|      3|      return false;  // Currently works only for 3 component positions.
   88|      3|    }
   89|    236|    pos_attribute_ = att;
   90|    236|    return true;
   91|    239|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    231|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    231|  uint32_t num_orientations = 0;
  156|    231|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    231|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 27, False: 204]
  ------------------
  157|     27|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 26]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|    204|  } else {
  161|    204|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 203]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    204|  }
  165|    229|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 2, False: 227]
  ------------------
  166|      2|    return false;
  167|      2|  }
  168|    227|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 55, False: 172]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|     55|    return false;
  172|     55|  }
  173|    172|  orientations_.resize(num_orientations);
  174|    172|  bool last_orientation = true;
  175|    172|  RAnsBitDecoder decoder;
  176|    172|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 2, False: 170]
  ------------------
  177|      2|    return false;
  178|      2|  }
  179|  49.0k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 48.8k, False: 170]
  ------------------
  180|  48.8k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 40.3k, False: 8.45k]
  ------------------
  181|  40.3k|      last_orientation = !last_orientation;
  182|  40.3k|    }
  183|  48.8k|    orientations_[i] = last_orientation;
  184|  48.8k|  }
  185|    170|  decoder.EndDecoding();
  186|    170|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    170|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    172|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    130|                          const PointIndex *entry_to_point_id_map) {
  126|    130|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 1, False: 129]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      1|    return false;
  129|      1|  }
  130|    129|  num_components_ = num_components;
  131|    129|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    129|  predicted_value_ =
  133|    129|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    129|  this->transform().Init(num_components);
  135|       |
  136|    129|  const int corner_map_size =
  137|    129|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   169k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 169k, False: 111]
  ------------------
  139|   169k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   169k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 18, False: 169k]
  ------------------
  141|     18|      return false;
  142|     18|    }
  143|       |
  144|   169k|    const int dst_offset = p * num_components;
  145|   169k|    this->transform().ComputeOriginalValue(
  146|   169k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   169k|  }
  148|    111|  return true;
  149|    129|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   169k|                          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|   169k|  const CornerIndex next_corner_id =
  198|   169k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   169k|  const CornerIndex prev_corner_id =
  200|   169k|      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|   169k|  int next_data_id, prev_data_id;
  204|       |
  205|   169k|  int next_vert_id, prev_vert_id;
  206|   169k|  next_vert_id =
  207|   169k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   169k|  prev_vert_id =
  209|   169k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   169k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   169k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   169k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 169k, False: 294]
  |  Branch (214:33): [True: 169k, False: 267]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   169k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   169k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   169k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 166k, False: 2.25k]
  ------------------
  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|   333k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 333k, False: 166k]
  ------------------
  223|   333k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 333k]
  |  Branch (223:36): [True: 272, False: 333k]
  ------------------
  224|   333k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 333k]
  ------------------
  225|    272|          predicted_value_[i] = INT_MIN;
  226|   333k|        } else {
  227|   333k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   333k|        }
  229|   333k|      }
  230|   166k|      return true;
  231|   166k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  2.25k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  2.25k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  2.25k|    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.25k|    const Vector3f pn = prev_pos - next_pos;
  261|  2.25k|    const Vector3f cn = tip_pos - next_pos;
  262|  2.25k|    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.25k|    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.25k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  4.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 2.25k]
  |  Branch (273:53): [True: 333, False: 1.91k]
  ------------------
  274|    333|      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|    333|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.91k|    } else {
  280|  1.91k|      s = 0;
  281|  1.91k|      t = 0;
  282|  1.91k|    }
  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.25k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  2.25k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  2.25k|    const float pnut = pn_uv[0] * t;
  301|  2.25k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  2.25k|    const float pnvt = pn_uv[1] * t;
  303|  2.25k|    Vector2f predicted_uv;
  304|  2.25k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 18, False: 2.23k]
  ------------------
  305|     18|      return false;
  306|     18|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  2.23k|    const bool orientation = orientations_.back();
  310|  2.23k|    orientations_.pop_back();
  311|  2.23k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 1.31k, False: 923]
  ------------------
  312|  1.31k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.31k|    } else {
  314|    923|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    923|    }
  316|  2.23k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [Folded - Ignored]
  ------------------
  317|       |      // Round the predicted value for integer types.
  318|       |      // Technically floats > INT_MAX are undefined, but compilers will
  319|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  320|  2.23k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  2.23k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 2.23k]
  |  Branch (321:28): [True: 143, False: 2.09k]
  |  Branch (321:43): [True: 36, False: 2.05k]
  ------------------
  322|    179|        predicted_value_[0] = INT_MIN;
  323|  2.05k|      } else {
  324|  2.05k|        predicted_value_[0] = static_cast<int>(u);
  325|  2.05k|      }
  326|  2.23k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  2.23k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 2.23k]
  |  Branch (327:28): [True: 196, False: 2.03k]
  |  Branch (327:43): [True: 54, False: 1.98k]
  ------------------
  328|    250|        predicted_value_[1] = INT_MIN;
  329|  1.98k|      } else {
  330|  1.98k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.98k|      }
  332|  2.23k|    } 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.23k|    return true;
  338|  2.25k|  }
  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|    561|  int data_offset = 0;
  343|    561|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 267, False: 294]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    267|    data_offset = prev_data_id * num_components_;
  346|    267|  }
  347|    561|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 46, False: 515]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     46|    data_offset = next_data_id * num_components_;
  350|    515|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    515|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 386, False: 129]
  ------------------
  354|    386|      data_offset = (data_id - 1) * num_components_;
  355|    386|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    387|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 258, False: 129]
  ------------------
  358|    258|        predicted_value_[i] = 0;
  359|    258|      }
  360|    129|      return true;
  361|    129|    }
  362|    515|  }
  363|  1.29k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 864, False: 432]
  ------------------
  364|    864|    predicted_value_[i] = data[data_offset + i];
  365|    864|  }
  366|    432|  return true;
  367|    561|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   338k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   338k|    const int data_offset = entry_id * num_components_;
  104|   338k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   338k|                    static_cast<float>(data[data_offset + 1]));
  106|   338k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  6.75k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  6.75k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  6.75k|    Vector3f pos;
   97|  6.75k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  6.75k|                                 &pos[0]);
   99|  6.75k|    return pos;
  100|  6.75k|  }

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    288|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   60|    574|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   62|    288|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    288|    DRACO_DCHECK_EQ(i, 0);
   64|    288|    (void)i;
   65|    288|    return GeometryAttribute::POSITION;
   66|    288|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    288|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    288|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 288]
  |  Branch (69:17): [True: 0, False: 288]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    288|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 2, False: 286]
  ------------------
   73|      2|      return false;  // Currently works only for 3 component positions.
   74|      2|    }
   75|    286|    predictor_.SetPositionAttribute(*att);
   76|    286|    return true;
   77|    288|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    286|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    286|  int32_t num_orientations = 0;
  121|    286|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 0, False: 286]
  |  Branch (121:45): [True: 29, False: 257]
  ------------------
  122|     29|    return false;
  123|     29|  }
  124|    257|  predictor_.ResizeOrientations(num_orientations);
  125|    257|  bool last_orientation = true;
  126|    257|  RAnsBitDecoder decoder;
  127|    257|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 249]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|  18.4G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 18.4G, False: 249]
  ------------------
  131|  18.4G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 4.11G, False: 14.3G]
  ------------------
  132|  4.11G|      last_orientation = !last_orientation;
  133|  4.11G|    }
  134|  18.4G|    predictor_.set_orientation(i, last_orientation);
  135|  18.4G|  }
  136|    249|  decoder.EndDecoding();
  137|    249|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    249|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    257|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    215|                                      const PointIndex *entry_to_point_id_map) {
   91|    215|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 6, False: 209]
  ------------------
   92|    215|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      6|    return false;
   94|      6|  }
   95|    209|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    209|  this->transform().Init(num_components);
   97|       |
   98|    209|  const int corner_map_size =
   99|    209|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   335k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 334k, False: 118]
  ------------------
  101|   334k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   334k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 91, False: 334k]
  ------------------
  103|   334k|                                                          p)) {
  104|     91|      return false;
  105|     91|    }
  106|       |
  107|   334k|    const int dst_offset = p * num_components;
  108|   334k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   334k|                                           in_corr + dst_offset,
  110|   334k|                                           out_data + dst_offset);
  111|   334k|  }
  112|    118|  return true;
  113|    209|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    337|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   60|    671|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   62|    337|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    337|    DRACO_DCHECK_EQ(i, 0);
   64|    337|    (void)i;
   65|    337|    return GeometryAttribute::POSITION;
   66|    337|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    336|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    336|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 336]
  |  Branch (69:17): [True: 0, False: 336]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    336|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 2, False: 334]
  ------------------
   73|      2|      return false;  // Currently works only for 3 component positions.
   74|      2|    }
   75|    334|    predictor_.SetPositionAttribute(*att);
   76|    334|    return true;
   77|    336|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    328|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    328|  int32_t num_orientations = 0;
  121|    328|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 3, False: 325]
  |  Branch (121:45): [True: 14, False: 311]
  ------------------
  122|     17|    return false;
  123|     17|  }
  124|    311|  predictor_.ResizeOrientations(num_orientations);
  125|    311|  bool last_orientation = true;
  126|    311|  RAnsBitDecoder decoder;
  127|    311|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 6, False: 305]
  ------------------
  128|      6|    return false;
  129|      6|  }
  130|  28.1G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 28.1G, False: 305]
  ------------------
  131|  28.1G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 6.95G, False: 21.1G]
  ------------------
  132|  6.95G|      last_orientation = !last_orientation;
  133|  6.95G|    }
  134|  28.1G|    predictor_.set_orientation(i, last_orientation);
  135|  28.1G|  }
  136|    305|  decoder.EndDecoding();
  137|    305|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    305|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    311|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    266|                                      const PointIndex *entry_to_point_id_map) {
   91|    266|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 10, False: 256]
  ------------------
   92|    266|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|     10|    return false;
   94|     10|  }
   95|    256|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    256|  this->transform().Init(num_components);
   97|       |
   98|    256|  const int corner_map_size =
   99|    256|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   254k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 254k, False: 184]
  ------------------
  101|   254k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   254k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 72, False: 254k]
  ------------------
  103|   254k|                                                          p)) {
  104|     72|      return false;
  105|     72|    }
  106|       |
  107|   254k|    const int dst_offset = p * num_components;
  108|   254k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   254k|                                           in_corr + dst_offset,
  110|   254k|                                           out_data + dst_offset);
  111|   254k|  }
  112|    184|  return true;
  113|    256|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   40|    288|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    286|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    286|    pos_attribute_ = &position_attribute;
   43|    286|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    257|  void ResizeOrientations(int num_orientations) {
   74|    257|    orientations_.resize(num_orientations);
   75|    257|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  18.4G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    209|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    209|    entry_to_point_id_map_ = map;
   46|    209|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   334k|                                                 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|   334k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   334k|  const CornerIndex prev_corner_id =
   99|   334k|      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|   334k|  int next_data_id, prev_data_id;
  103|       |
  104|   334k|  int next_vert_id, prev_vert_id;
  105|   334k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   334k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   334k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   334k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   334k|  typedef VectorD<int64_t, 2> Vec2;
  112|   334k|  typedef VectorD<int64_t, 3> Vec3;
  113|   334k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   334k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 224k, False: 110k]
  |  Branch (115:33): [True: 113k, False: 110k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   113k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   113k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   113k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 110k, False: 2.66k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   110k|      predicted_value_[0] = p_uv[0];
  122|   110k|      predicted_value_[1] = p_uv[1];
  123|   110k|      return true;
  124|   110k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.66k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.66k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.66k|    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.66k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.66k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.66k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.48k, False: 1.17k]
  ------------------
  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: 44, False: 1.44k]
  ------------------
  166|  1.48k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     44|        return false;
  169|     44|      }
  170|  1.44k|      const int64_t pn_uv_absmax_element =
  171|  1.44k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.44k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 24, False: 1.42k]
  ------------------
  173|  1.44k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     24|        return false;
  176|     24|      }
  177|  1.42k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.42k|      const int64_t pn_absmax_element =
  179|  1.42k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.42k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 22, False: 1.39k]
  ------------------
  181|  1.42k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     22|        return false;
  184|     22|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.39k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.39k|      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.39k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.39k|      const uint64_t norm_squared =
  207|  1.39k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.39k|      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.39k|      Vec2 predicted_uv;
  214|  1.39k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded - Ignored]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.39k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.39k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 1, False: 1.39k]
  ------------------
  233|      1|          return false;
  234|      1|        }
  235|  1.39k|        const bool orientation = orientations_.back();
  236|  1.39k|        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.39k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 594, False: 804]
  ------------------
  240|    594|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    804|        } else {
  242|    804|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    804|        }
  244|  1.39k|      }
  245|  1.39k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.39k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.39k|      return true;
  248|  1.39k|    }
  249|  2.66k|  }
  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|   223k|  int data_offset = 0;
  254|   223k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 112k, False: 110k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   112k|    data_offset = prev_data_id * kNumComponents;
  257|   112k|  }
  258|   223k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 1.18k, False: 221k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  1.18k|    data_offset = next_data_id * kNumComponents;
  261|   221k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   221k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 221k, False: 209]
  ------------------
  265|   221k|      data_offset = (data_id - 1) * kNumComponents;
  266|   221k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    627|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 418, False: 209]
  ------------------
  269|    418|        predicted_value_[i] = 0;
  270|    418|      }
  271|    209|      return true;
  272|    209|    }
  273|   221k|  }
  274|   668k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 445k, False: 222k]
  ------------------
  275|   445k|    predicted_value_[i] = data[data_offset + i];
  276|   445k|  }
  277|   222k|  return true;
  278|   223k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   226k|                                            const DataTypeT *data) const {
   59|   226k|    const int data_offset = entry_id * kNumComponents;
   60|   226k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   226k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  7.99k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  7.99k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  7.99k|    VectorD<int64_t, 3> pos;
   52|  7.99k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  7.99k|                                 &pos[0]);
   54|  7.99k|    return pos;
   55|  7.99k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   334k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   40|    337|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    334|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    334|    pos_attribute_ = &position_attribute;
   43|    334|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    311|  void ResizeOrientations(int num_orientations) {
   74|    311|    orientations_.resize(num_orientations);
   75|    311|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  28.1G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    256|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    256|    entry_to_point_id_map_ = map;
   46|    256|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   254k|                                                 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|   254k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   254k|  const CornerIndex prev_corner_id =
   99|   254k|      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|   254k|  int next_data_id, prev_data_id;
  103|       |
  104|   254k|  int next_vert_id, prev_vert_id;
  105|   254k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   254k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   254k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   254k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   254k|  typedef VectorD<int64_t, 2> Vec2;
  112|   254k|  typedef VectorD<int64_t, 3> Vec3;
  113|   254k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   254k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 254k, False: 552]
  |  Branch (115:33): [True: 253k, False: 541]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   253k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   253k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   253k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 249k, False: 3.94k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   249k|      predicted_value_[0] = p_uv[0];
  122|   249k|      predicted_value_[1] = p_uv[1];
  123|   249k|      return true;
  124|   249k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  3.94k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  3.94k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  3.94k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  3.94k|    const Vec3 pn = prev_pos - next_pos;
  146|  3.94k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  3.94k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.82k, False: 2.11k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.82k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.82k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.82k|      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.82k|      const int64_t n_uv_absmax_element =
  164|  1.82k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.82k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 21, False: 1.80k]
  ------------------
  166|  1.82k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     21|        return false;
  169|     21|      }
  170|  1.80k|      const int64_t pn_uv_absmax_element =
  171|  1.80k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.80k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 6, False: 1.80k]
  ------------------
  173|  1.80k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      6|        return false;
  176|      6|      }
  177|  1.80k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.80k|      const int64_t pn_absmax_element =
  179|  1.80k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.80k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 44, False: 1.75k]
  ------------------
  181|  1.80k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     44|        return false;
  184|     44|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.75k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.75k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.75k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.75k|      const uint64_t norm_squared =
  207|  1.75k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.75k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.75k|      Vec2 predicted_uv;
  214|  1.75k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded - Ignored]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.75k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.75k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 1, False: 1.75k]
  ------------------
  233|      1|          return false;
  234|      1|        }
  235|  1.75k|        const bool orientation = orientations_.back();
  236|  1.75k|        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.75k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 433, False: 1.32k]
  ------------------
  240|    433|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.32k|        } else {
  242|  1.32k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.32k|        }
  244|  1.75k|      }
  245|  1.75k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.75k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.75k|      return true;
  248|  1.75k|    }
  249|  3.94k|  }
  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|  3.21k|  int data_offset = 0;
  254|  3.21k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 2.65k, False: 552]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  2.65k|    data_offset = prev_data_id * kNumComponents;
  257|  2.65k|  }
  258|  3.21k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 2.16k, False: 1.04k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  2.16k|    data_offset = next_data_id * kNumComponents;
  261|  2.16k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|  1.04k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 786, False: 256]
  ------------------
  265|    786|      data_offset = (data_id - 1) * kNumComponents;
  266|    786|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    768|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 512, False: 256]
  ------------------
  269|    512|        predicted_value_[i] = 0;
  270|    512|      }
  271|    256|      return true;
  272|    256|    }
  273|  1.04k|  }
  274|  8.86k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 5.90k, False: 2.95k]
  ------------------
  275|  5.90k|    predicted_value_[i] = data[data_offset + i];
  276|  5.90k|  }
  277|  2.95k|  return true;
  278|  3.21k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   507k|                                            const DataTypeT *data) const {
   59|   507k|    const int data_offset = entry_id * kNumComponents;
   60|   507k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   507k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  11.8k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  11.8k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  11.8k|    VectorD<int64_t, 3> pos;
   52|  11.8k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  11.8k|                                 &pos[0]);
   54|  11.8k|    return pos;
   55|  11.8k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   254k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     65|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    458|  bool AreCorrectionsPositive() override {
   71|    458|    return transform_.AreCorrectionsPositive();
   72|    458|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     59|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     59|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 6, False: 53]
  ------------------
   50|      6|      return false;
   51|      6|    }
   52|     53|    return true;
   53|     59|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.26M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    108|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    529|  bool AreCorrectionsPositive() override {
   71|    529|    return transform_.AreCorrectionsPositive();
   72|    529|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    105|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    105|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 23, False: 82]
  ------------------
   50|     23|      return false;
   51|     23|    }
   52|     82|    return true;
   53|    105|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.10M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.97k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.25k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.83k|  bool AreCorrectionsPositive() override {
   71|  4.83k|    return transform_.AreCorrectionsPositive();
   72|  4.83k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.82k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.82k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 212, False: 3.61k]
  ------------------
   50|    212|      return false;
   51|    212|    }
   52|  3.61k|    return true;
   53|  3.82k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  11.9M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    467|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    537|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    467|                                 const PointCloudDecoder *decoder) {
  188|    467|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    467|      method, att_id, decoder, TransformT());
  190|    467|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    467|                                 const TransformT &transform) {
  156|    467|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 467]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    467|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    467|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 467, 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|    467|    const MeshDecoder *const mesh_decoder =
  167|    467|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    467|    auto ret = CreateMeshPredictionScheme<
  170|    467|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    467|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    467|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    467|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 402, False: 65]
  ------------------
  174|    402|      return ret;
  175|    402|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    467|  }
  178|       |  // Create delta decoder.
  179|     65|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     65|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    467|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    225|      uint16_t bitstream_version) {
  143|    225|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    225|        method, attribute, transform, mesh_data, bitstream_version);
  145|    225|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    225|        uint16_t bitstream_version) {
  127|    225|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 215, False: 10]
  ------------------
  128|    215|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    215|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    215|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    215|                                                  mesh_data));
  132|    215|      }
  133|     10|      return nullptr;
  134|    225|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    189|      uint16_t bitstream_version) {
  143|    189|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    189|        method, attribute, transform, mesh_data, bitstream_version);
  145|    189|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    189|        uint16_t bitstream_version) {
  127|    189|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 187, False: 2]
  ------------------
  128|    187|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    187|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    187|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    187|                                                  mesh_data));
  132|    187|      }
  133|      2|      return nullptr;
  134|    189|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    537|                                 const PointCloudDecoder *decoder) {
  188|    537|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    537|      method, att_id, decoder, TransformT());
  190|    537|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    537|                                 const TransformT &transform) {
  156|    537|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 537]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    537|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    537|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 537, 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|    537|    const MeshDecoder *const mesh_decoder =
  167|    537|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    537|    auto ret = CreateMeshPredictionScheme<
  170|    537|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    537|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    537|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    537|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 429, False: 108]
  ------------------
  174|    429|      return ret;
  175|    429|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    537|  }
  178|       |  // Create delta decoder.
  179|    108|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    108|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    537|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    224|      uint16_t bitstream_version) {
  143|    224|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    224|        method, attribute, transform, mesh_data, bitstream_version);
  145|    224|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    224|        uint16_t bitstream_version) {
  111|    224|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 194, False: 30]
  ------------------
  112|    194|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    194|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    194|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    194|                                                  mesh_data));
  116|    194|      }
  117|     30|      return nullptr;
  118|    224|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    242|      uint16_t bitstream_version) {
  143|    242|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    242|        method, attribute, transform, mesh_data, bitstream_version);
  145|    242|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    242|        uint16_t bitstream_version) {
  111|    242|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 235, False: 7]
  ------------------
  112|    235|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    235|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    235|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    235|                                                  mesh_data));
  116|    235|      }
  117|      7|      return nullptr;
  118|    242|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.97k|                                 const PointCloudDecoder *decoder) {
  188|  4.97k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.97k|      method, att_id, decoder, TransformT());
  190|  4.97k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.97k|                                 const TransformT &transform) {
  156|  4.97k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.97k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.97k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.97k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.97k, False: 0]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  4.97k|    const MeshDecoder *const mesh_decoder =
  167|  4.97k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.97k|    auto ret = CreateMeshPredictionScheme<
  170|  4.97k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.97k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.97k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.97k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.61k, False: 355]
  ------------------
  174|  4.61k|      return ret;
  175|  4.61k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.97k|  }
  178|       |  // Create delta decoder.
  179|    355|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    355|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.97k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.13k|      uint16_t bitstream_version) {
  143|  2.13k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.13k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.13k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.13k|        uint16_t bitstream_version) {
   53|  2.13k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 595, False: 1.53k]
  ------------------
   54|    595|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    595|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    595|                                                         MeshDataT>(
   57|    595|                attribute, transform, mesh_data));
   58|    595|      }
   59|  1.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.53k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 388, False: 1.14k]
  ------------------
   61|    388|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    388|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    388|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    388|                                                  mesh_data));
   65|    388|      }
   66|  1.14k|#endif
   67|  1.14k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 363, False: 786]
  ------------------
   68|    363|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    363|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    363|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    363|                                                  mesh_data));
   72|    363|      }
   73|    786|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    786|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 181, False: 605]
  ------------------
   75|    181|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    181|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    181|                                                     MeshDataT>(
   78|    181|                attribute, transform, mesh_data, bitstream_version));
   79|    181|      }
   80|    605|#endif
   81|    605|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 288, False: 317]
  ------------------
   82|    288|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    288|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    288|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    288|                                                  mesh_data));
   86|    288|      }
   87|    317|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    317|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 317, False: 0]
  ------------------
   89|    317|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    317|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    317|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    317|                                                  mesh_data));
   93|    317|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.13k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.48k|      uint16_t bitstream_version) {
  143|  2.48k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.48k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.48k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.48k|        uint16_t bitstream_version) {
   53|  2.48k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 756, False: 1.72k]
  ------------------
   54|    756|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    756|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    756|                                                         MeshDataT>(
   57|    756|                attribute, transform, mesh_data));
   58|    756|      }
   59|  1.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.72k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 403, False: 1.32k]
  ------------------
   61|    403|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    403|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    403|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    403|                                                  mesh_data));
   65|    403|      }
   66|  1.32k|#endif
   67|  1.32k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 397, False: 927]
  ------------------
   68|    397|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    397|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    397|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    397|                                                  mesh_data));
   72|    397|      }
   73|    927|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    927|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 240, False: 687]
  ------------------
   75|    240|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    240|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    240|                                                     MeshDataT>(
   78|    240|                attribute, transform, mesh_data, bitstream_version));
   79|    240|      }
   80|    687|#endif
   81|    687|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 337, False: 350]
  ------------------
   82|    337|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    337|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    337|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    337|                                                  mesh_data));
   86|    337|      }
   87|    350|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    350|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 350, False: 0]
  ------------------
   89|    350|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    350|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    350|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    350|                                                  mesh_data));
   93|    350|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.48k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    467|    uint16_t bitstream_version) {
   38|    467|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    467|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 467, False: 0]
  ------------------
   40|    467|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 13, False: 454]
  ------------------
   41|    467|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 14, False: 440]
  ------------------
   42|    467|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 5, False: 435]
  ------------------
   43|    467|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 434]
  ------------------
   44|    467|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 404, False: 30]
  ------------------
   45|    467|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 17, False: 13]
  ------------------
   46|    454|    const CornerTable *const ct = source->GetCornerTable();
   47|    454|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    454|        source->GetAttributeEncodingData(att_id);
   49|    454|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 40, False: 414]
  |  Branch (49:26): [True: 0, False: 414]
  ------------------
   50|       |      // No connectivity data found.
   51|     40|      return nullptr;
   52|     40|    }
   53|       |    // Connectivity data exists.
   54|    414|    const MeshAttributeCornerTable *const att_ct =
   55|    414|        source->GetAttributeCornerTable(att_id);
   56|    414|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 225, False: 189]
  ------------------
   57|    225|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    225|      MeshData md;
   59|    225|      md.Set(source->mesh(), att_ct,
   60|    225|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    225|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    225|      MeshPredictionSchemeFactoryT factory;
   63|    225|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    225|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 215, False: 10]
  ------------------
   65|    215|        return ret;
   66|    215|      }
   67|    225|    } else {
   68|    189|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    189|      MeshData md;
   70|    189|      md.Set(source->mesh(), ct,
   71|    189|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    189|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    189|      MeshPredictionSchemeFactoryT factory;
   74|    189|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    189|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 187, False: 2]
  ------------------
   76|    187|        return ret;
   77|    187|      }
   78|    189|    }
   79|    414|  }
   80|     25|  return nullptr;
   81|    467|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    537|    uint16_t bitstream_version) {
   38|    537|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    537|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 537, False: 0]
  ------------------
   40|    537|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 15, False: 522]
  ------------------
   41|    537|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 22, False: 500]
  ------------------
   42|    537|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 13, False: 487]
  ------------------
   43|    537|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 484]
  ------------------
   44|    537|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 461, False: 23]
  ------------------
   45|    537|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 16, False: 7]
  ------------------
   46|    530|    const CornerTable *const ct = source->GetCornerTable();
   47|    530|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    530|        source->GetAttributeEncodingData(att_id);
   49|    530|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 64, False: 466]
  |  Branch (49:26): [True: 0, False: 466]
  ------------------
   50|       |      // No connectivity data found.
   51|     64|      return nullptr;
   52|     64|    }
   53|       |    // Connectivity data exists.
   54|    466|    const MeshAttributeCornerTable *const att_ct =
   55|    466|        source->GetAttributeCornerTable(att_id);
   56|    466|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 224, False: 242]
  ------------------
   57|    224|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    224|      MeshData md;
   59|    224|      md.Set(source->mesh(), att_ct,
   60|    224|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    224|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    224|      MeshPredictionSchemeFactoryT factory;
   63|    224|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    224|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 194, False: 30]
  ------------------
   65|    194|        return ret;
   66|    194|      }
   67|    242|    } else {
   68|    242|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    242|      MeshData md;
   70|    242|      md.Set(source->mesh(), ct,
   71|    242|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    242|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    242|      MeshPredictionSchemeFactoryT factory;
   74|    242|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    242|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 235, False: 7]
  ------------------
   76|    235|        return ret;
   77|    235|      }
   78|    242|    }
   79|    466|  }
   80|     44|  return nullptr;
   81|    537|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.97k|    uint16_t bitstream_version) {
   38|  4.97k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.97k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.97k, False: 0]
  ------------------
   40|  4.97k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.41k, False: 3.55k]
  ------------------
   41|  4.97k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 794, False: 2.75k]
  ------------------
   42|  4.97k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 765, False: 1.99k]
  ------------------
   43|  4.97k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 626, False: 1.36k]
  ------------------
   44|  4.97k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 668, False: 699]
  ------------------
   45|  4.97k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 421, False: 278]
  ------------------
   46|  4.69k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.69k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.69k|        source->GetAttributeEncodingData(att_id);
   49|  4.69k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 77, False: 4.61k]
  |  Branch (49:26): [True: 0, False: 4.61k]
  ------------------
   50|       |      // No connectivity data found.
   51|     77|      return nullptr;
   52|     77|    }
   53|       |    // Connectivity data exists.
   54|  4.61k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.61k|        source->GetAttributeCornerTable(att_id);
   56|  4.61k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.13k, False: 2.48k]
  ------------------
   57|  2.13k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.13k|      MeshData md;
   59|  2.13k|      md.Set(source->mesh(), att_ct,
   60|  2.13k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.13k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.13k|      MeshPredictionSchemeFactoryT factory;
   63|  2.13k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.13k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.13k, False: 0]
  ------------------
   65|  2.13k|        return ret;
   66|  2.13k|      }
   67|  2.48k|    } else {
   68|  2.48k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.48k|      MeshData md;
   70|  2.48k|      md.Set(source->mesh(), ct,
   71|  2.48k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.48k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.48k|      MeshPredictionSchemeFactoryT factory;
   74|  2.48k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.48k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.48k, False: 0]
  ------------------
   76|  2.48k|        return ret;
   77|  2.48k|      }
   78|  2.48k|    }
   79|  4.61k|  }
   80|    278|  return nullptr;
   81|  4.97k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.10M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.10M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 688k, False: 418k]
  |  Branch (93:22): [True: 538k, False: 149k]
  ------------------
   94|   538k|      return true;
   95|   538k|    }
   96|   568k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 122k, False: 445k]
  |  Branch (96:25): [True: 60.2k, False: 62.5k]
  ------------------
   97|  1.10M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.10M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.10M|    const DataType sign_x = pred[0];
   52|  1.10M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.10M|    int32_t rotation_count = 0;
   55|  1.10M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 688k, False: 418k]
  ------------------
   56|   688k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 538k, False: 149k]
  ------------------
   57|   538k|        rotation_count = 0;
   58|   538k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 107k, False: 41.9k]
  ------------------
   59|   107k|        rotation_count = 3;
   60|   107k|      } else {
   61|  41.9k|        rotation_count = 1;
   62|  41.9k|      }
   63|   688k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 295k, False: 122k]
  ------------------
   64|   295k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 232k, False: 63.2k]
  ------------------
   65|   232k|        rotation_count = 2;
   66|   232k|      } else {
   67|  63.2k|        rotation_count = 1;
   68|  63.2k|      }
   69|   295k|    } else {
   70|   122k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 60.2k, False: 62.5k]
  ------------------
   71|  60.2k|        rotation_count = 0;
   72|  62.5k|      } else {
   73|  62.5k|        rotation_count = 3;
   74|  62.5k|      }
   75|   122k|    }
   76|  1.10M|    return rotation_count;
   77|  1.10M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  1.01M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  1.01M|    switch (rotation_count) {
   81|   275k|      case 1:
  ------------------
  |  Branch (81:7): [True: 275k, False: 741k]
  ------------------
   82|   275k|        return Point2(p[1], -p[0]);
   83|   465k|      case 2:
  ------------------
  |  Branch (83:7): [True: 465k, False: 551k]
  ------------------
   84|   465k|        return Point2(-p[0], -p[1]);
   85|   275k|      case 3:
  ------------------
  |  Branch (85:7): [True: 275k, False: 741k]
  ------------------
   86|   275k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 1.01M]
  ------------------
   88|      0|        return p;
   89|  1.01M|    }
   90|  1.01M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    537|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  4.83k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  4.24k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  4.24k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  4.24k|  bool InitCorrectionBounds() {
   84|  4.24k|    const int64_t dif =
   85|  4.24k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  4.24k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 4.24k]
  |  Branch (86:20): [True: 17, False: 4.22k]
  ------------------
   87|     17|      return false;
   88|     17|    }
   89|  4.22k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  4.22k|    max_correction_ = max_dif_ / 2;
   91|  4.22k|    min_correction_ = -max_correction_;
   92|  4.22k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.56k, False: 2.65k]
  ------------------
   93|  1.56k|      max_correction_ -= 1;
   94|  1.56k|    }
   95|  4.22k|    return true;
   96|  4.24k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  3.59k|  void Init(int num_components) {
   56|  3.59k|    num_components_ = num_components;
   57|  3.59k|    clamped_value_.resize(num_components);
   58|  3.59k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  11.9M|      const DataTypeT *predicted_val) const {
   64|   343M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 331M, False: 11.9M]
  ------------------
   65|   331M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 5.22M, False: 326M]
  ------------------
   66|  5.22M|        clamped_value_[i] = max_value_;
   67|   326M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 606k, False: 325M]
  ------------------
   68|   606k|        clamped_value_[i] = min_value_;
   69|   325M|      } else {
   70|   325M|        clamped_value_[i] = predicted_val[i];
   71|   325M|      }
   72|   331M|    }
   73|  11.9M|    return clamped_value_.data();
   74|  11.9M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   687M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   331M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   578k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   331M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    582|  int quantization_bits() const {
   78|    582|    DRACO_DCHECK(false);
   79|    582|    return -1;
   80|    582|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   49|  4.97k|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  8.97k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  8.45M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  5.97k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  33.0k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  10.0k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  10.0k|    portable_attribute_ = std::move(att);
   71|  10.0k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  35.8k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  30.3k|  virtual ~SequentialAttributeDecoder() = default;

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

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  27.9k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  27.9k|                                             int attribute_id) {
   27|  27.9k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 27.9k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  27.9k|  return true;
   31|  27.9k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  3.70k|    const std::vector<PointIndex> &point_ids) {
   35|  3.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  3.70k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 3.70k, False: 0]
  ------------------
   37|  3.70k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 3.70k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  3.70k|#endif
   41|  3.70k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  3.70k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  10.3k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  10.3k|  int8_t prediction_scheme_method;
   48|  10.3k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 30, False: 10.3k]
  ------------------
   49|     30|    return false;
   50|     30|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  10.3k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 58, False: 10.2k]
  ------------------
   53|  10.3k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 101, False: 10.1k]
  ------------------
   54|    159|    return false;
   55|    159|  }
   56|  10.1k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 10.1k, False: 4]
  ------------------
   57|  10.1k|    int8_t prediction_transform_type;
   58|  10.1k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 5, False: 10.1k]
  ------------------
   59|      5|      return false;
   60|      5|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  10.1k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 15, False: 10.1k]
  ------------------
   63|  10.1k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 114, False: 10.0k]
  ------------------
   64|    129|      return false;
   65|    129|    }
   66|  10.0k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  10.0k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  10.0k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  10.0k|  }
   70|       |
   71|  10.0k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 5.97k, False: 4.08k]
  ------------------
   72|  5.97k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 25, False: 5.94k]
  ------------------
   73|     25|      return false;
   74|     25|    }
   75|  5.97k|  }
   76|       |
   77|  10.0k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.48k, False: 8.55k]
  ------------------
   78|  1.48k|    return false;
   79|  1.48k|  }
   80|       |
   81|  8.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  8.55k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  8.55k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 8.55k, False: 0]
  ------------------
   84|  8.55k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  8.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 8.55k]
  ------------------
   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|  8.55k|#endif
   91|  8.55k|  return true;
   92|  8.55k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  8.99k|    PredictionSchemeTransformType transform_type) {
   98|  8.99k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 4.02k, False: 4.97k]
  ------------------
   99|  4.02k|    return nullptr;  // For now we support only wrap transform.
  100|  4.02k|  }
  101|  4.97k|  return CreatePredictionSchemeForDecoder<
  102|  4.97k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.97k|      method, attribute_id(), decoder());
  104|  8.99k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  10.0k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  10.0k|  const int num_components = GetNumValueComponents();
  109|  10.0k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 10.0k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  10.0k|  const size_t num_entries = point_ids.size();
  113|  10.0k|  const size_t num_values = num_entries * num_components;
  114|  10.0k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  10.0k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  10.0k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 9, False: 10.0k]
  ------------------
  117|      9|    return false;
  118|      9|  }
  119|  10.0k|  uint8_t compressed;
  120|  10.0k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 10, False: 10.0k]
  ------------------
  121|     10|    return false;
  122|     10|  }
  123|  10.0k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 550, False: 9.46k]
  ------------------
  124|       |    // Decode compressed values.
  125|    550|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 185, False: 365]
  ------------------
  126|    550|                       in_buffer,
  127|    550|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    185|      return false;
  129|    185|    }
  130|  9.46k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  9.46k|    uint8_t num_bytes;
  134|  9.46k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 2, False: 9.46k]
  ------------------
  135|      2|      return false;
  136|      2|    }
  137|  9.46k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 455, False: 9.00k]
  ------------------
  138|    455|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 455]
  ------------------
  139|    455|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    455|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 4, False: 451]
  ------------------
  143|    455|                             sizeof(int32_t) * num_values)) {
  144|      4|        return false;
  145|      4|      }
  146|  9.00k|    } else {
  147|  9.00k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 38, False: 8.96k]
  ------------------
  148|  9.00k|          num_bytes * num_values) {
  149|     38|        return false;
  150|     38|      }
  151|  8.96k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 12, False: 8.95k]
  ------------------
  152|  8.96k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     12|        return false;
  154|     12|      }
  155|   515M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 515M, False: 8.95k]
  ------------------
  156|   515M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 515M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   515M|      }
  160|  8.95k|    }
  161|  9.46k|  }
  162|       |
  163|  9.77k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 9.77k, False: 0]
  |  Branch (163:26): [True: 3.95k, False: 5.82k]
  ------------------
  164|  9.77k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 4.83k, False: 987]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  8.78k|    ConvertSymbolsToSignedInts(
  167|  8.78k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  8.78k|        static_cast<int>(num_values), portable_attribute_data);
  169|  8.78k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  9.77k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 5.82k, False: 3.95k]
  ------------------
  173|  5.82k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 763, False: 5.05k]
  ------------------
  174|    763|      return false;
  175|    763|    }
  176|       |
  177|  5.05k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 5.05k, False: 0]
  ------------------
  178|  5.05k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 460, False: 4.59k]
  ------------------
  179|  5.05k|              portable_attribute_data, portable_attribute_data,
  180|  5.05k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    460|        return false;
  182|    460|      }
  183|  5.05k|    }
  184|  5.05k|  }
  185|  8.55k|  return true;
  186|  9.77k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  3.14k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  3.14k|  switch (attribute()->data_type()) {
  190|    577|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 577, False: 2.56k]
  ------------------
  191|    577|      StoreTypedValues<uint8_t>(num_values);
  192|    577|      break;
  193|  1.47k|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 1.47k, False: 1.67k]
  ------------------
  194|  1.47k|      StoreTypedValues<int8_t>(num_values);
  195|  1.47k|      break;
  196|    102|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 102, False: 3.04k]
  ------------------
  197|    102|      StoreTypedValues<uint16_t>(num_values);
  198|    102|      break;
  199|    209|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 209, False: 2.93k]
  ------------------
  200|    209|      StoreTypedValues<int16_t>(num_values);
  201|    209|      break;
  202|    133|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 133, False: 3.01k]
  ------------------
  203|    133|      StoreTypedValues<uint32_t>(num_values);
  204|    133|      break;
  205|    397|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 397, False: 2.74k]
  ------------------
  206|    397|      StoreTypedValues<int32_t>(num_values);
  207|    397|      break;
  208|    254|    default:
  ------------------
  |  Branch (208:5): [True: 254, False: 2.89k]
  ------------------
  209|    254|      return false;
  210|  3.14k|  }
  211|  2.89k|  return true;
  212|  3.14k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  10.0k|    int num_entries, int num_components) {
  237|  10.0k|  GeometryAttribute ga;
  238|  10.0k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  10.0k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  10.0k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  10.0k|  port_att->SetIdentityMapping();
  242|  10.0k|  port_att->Reset(num_entries);
  243|  10.0k|  port_att->set_unique_id(attribute()->unique_id());
  244|  10.0k|  SetPortableAttribute(std::move(port_att));
  245|  10.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    577|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    577|  const int num_components = attribute()->num_components();
  217|    577|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    577|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    577|      new AttributeTypeT[num_components]);
  220|    577|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    577|  int val_id = 0;
  222|    577|  int out_byte_pos = 0;
  223|  1.64M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.64M, False: 577]
  ------------------
  224|  75.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 73.6M, False: 1.64M]
  ------------------
  225|  73.6M|      const AttributeTypeT value =
  226|  73.6M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  73.6M|      att_val[c] = value;
  228|  73.6M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.64M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.64M|    out_byte_pos += entry_size;
  232|  1.64M|  }
  233|    577|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|  1.47k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|  1.47k|  const int num_components = attribute()->num_components();
  217|  1.47k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|  1.47k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|  1.47k|      new AttributeTypeT[num_components]);
  220|  1.47k|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|  1.47k|  int val_id = 0;
  222|  1.47k|  int out_byte_pos = 0;
  223|  3.21M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 3.21M, False: 1.47k]
  ------------------
  224|  80.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 77.4M, False: 3.21M]
  ------------------
  225|  77.4M|      const AttributeTypeT value =
  226|  77.4M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  77.4M|      att_val[c] = value;
  228|  77.4M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  3.21M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  3.21M|    out_byte_pos += entry_size;
  232|  3.21M|  }
  233|  1.47k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|    102|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    102|  const int num_components = attribute()->num_components();
  217|    102|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    102|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    102|      new AttributeTypeT[num_components]);
  220|    102|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    102|  int val_id = 0;
  222|    102|  int out_byte_pos = 0;
  223|   920k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 920k, False: 102]
  ------------------
  224|  48.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 47.8M, False: 920k]
  ------------------
  225|  47.8M|      const AttributeTypeT value =
  226|  47.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  47.8M|      att_val[c] = value;
  228|  47.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   920k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   920k|    out_byte_pos += entry_size;
  232|   920k|  }
  233|    102|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    209|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    209|  const int num_components = attribute()->num_components();
  217|    209|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    209|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    209|      new AttributeTypeT[num_components]);
  220|    209|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    209|  int val_id = 0;
  222|    209|  int out_byte_pos = 0;
  223|  1.10M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.10M, False: 209]
  ------------------
  224|  59.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 58.2M, False: 1.10M]
  ------------------
  225|  58.2M|      const AttributeTypeT value =
  226|  58.2M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  58.2M|      att_val[c] = value;
  228|  58.2M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.10M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.10M|    out_byte_pos += entry_size;
  232|  1.10M|  }
  233|    209|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    133|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    133|  const int num_components = attribute()->num_components();
  217|    133|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    133|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    133|      new AttributeTypeT[num_components]);
  220|    133|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    133|  int val_id = 0;
  222|    133|  int out_byte_pos = 0;
  223|   457k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 457k, False: 133]
  ------------------
  224|  25.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 24.7M, False: 457k]
  ------------------
  225|  24.7M|      const AttributeTypeT value =
  226|  24.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  24.7M|      att_val[c] = value;
  228|  24.7M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   457k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   457k|    out_byte_pos += entry_size;
  232|   457k|  }
  233|    133|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|    397|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    397|  const int num_components = attribute()->num_components();
  217|    397|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    397|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    397|      new AttributeTypeT[num_components]);
  220|    397|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    397|  int val_id = 0;
  222|    397|  int out_byte_pos = 0;
  223|  1.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.08M, False: 397]
  ------------------
  224|  27.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 26.5M, False: 1.08M]
  ------------------
  225|  26.5M|      const AttributeTypeT value =
  226|  26.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  26.5M|      att_val[c] = value;
  228|  26.5M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.08M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.08M|    out_byte_pos += entry_size;
  232|  1.08M|  }
  233|    397|}

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  26.9k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  19.9k|                                const uint8_t *const buf, int offset) {
  301|  19.9k|  unsigned x;
  302|  19.9k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 21, False: 19.9k]
  ------------------
  303|     21|    return 1;
  304|     21|  }
  305|  19.9k|  ans->buf = buf;
  306|  19.9k|  x = buf[offset - 1] >> 6;
  307|  19.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 16.0k, False: 3.94k]
  ------------------
  308|  16.0k|    ans->buf_offset = offset - 1;
  309|  16.0k|    ans->state = buf[offset - 1] & 0x3F;
  310|  16.0k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.61k, False: 332]
  ------------------
  311|  3.61k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 2, False: 3.61k]
  ------------------
  312|      2|      return 1;
  313|      2|    }
  314|  3.61k|    ans->buf_offset = offset - 2;
  315|  3.61k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.61k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 327, False: 5]
  ------------------
  317|    327|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 326]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|    326|    ans->buf_offset = offset - 3;
  321|    326|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    326|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  19.9k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  19.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  19.9k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  19.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  19.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 0, False: 19.9k]
  ------------------
  327|      0|    return 1;
  328|      0|  }
  329|  19.9k|  return 0;
  330|  19.9k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.61k|static uint32_t mem_get_le16(const void *vmem) {
   68|  3.61k|  uint32_t val;
   69|  3.61k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  3.61k|  val = mem[1] << 8;
   72|  3.61k|  val |= mem[0];
   73|  3.61k|  return val;
   74|  3.61k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    326|static uint32_t mem_get_le24(const void *vmem) {
   77|    326|  uint32_t val;
   78|    326|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    326|  val = mem[2] << 16;
   81|    326|  val |= mem[1] << 8;
   82|    326|  val |= mem[0];
   83|    326|  return val;
   84|    326|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  46.6G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  46.6G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  46.6G|  unsigned quot, rem, x, xn;
  172|  46.6G|#endif
  173|  46.6G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  46.6G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  46.6G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  93.3G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 35.5G, False: 11.1G]
  |  Branch (174:40): [True: 288k, False: 35.5G]
  ------------------
  175|   288k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   288k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   288k|  }
  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|  46.6G|  x = ans->state;
  184|  46.6G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  46.6G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  46.6G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  46.6G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  46.6G|  xn = quot * p;
  187|  46.6G|  val = rem < p;
  188|  46.6G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  93.3G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 35.5G, False: 11.0G]
  |  |  ------------------
  ------------------
  189|  35.5G|    ans->state = xn + rem;
  190|  35.5G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  11.0G|    ans->state = x - xn - p;
  193|  11.0G|  }
  194|  46.6G|#endif
  195|  46.6G|  return val;
  196|  46.6G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  42.2k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  42.2k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  42.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  42.2k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  2.97k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.81k|                                       uint32_t num_symbols) {
  482|  1.81k|    lut_table_.resize(rans_precision);
  483|  1.81k|    probability_table_.resize(num_symbols);
  484|  1.81k|    uint32_t cum_prob = 0;
  485|  1.81k|    uint32_t act_prob = 0;
  486|  15.5k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 13.9k, False: 1.64k]
  ------------------
  487|  13.9k|      probability_table_[i].prob = token_probs[i];
  488|  13.9k|      probability_table_[i].cum_prob = cum_prob;
  489|  13.9k|      cum_prob += token_probs[i];
  490|  13.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 172, False: 13.7k]
  ------------------
  491|    172|        return false;
  492|    172|      }
  493|  5.90M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 5.89M, False: 13.7k]
  ------------------
  494|  5.89M|        lut_table_[j] = i;
  495|  5.89M|      }
  496|  13.7k|      act_prob = cum_prob;
  497|  13.7k|    }
  498|  1.64k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 242, False: 1.40k]
  ------------------
  499|    242|      return false;
  500|    242|    }
  501|  1.40k|    return true;
  502|  1.64k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.21k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.21k|    unsigned x;
  423|  1.21k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 85, False: 1.13k]
  ------------------
  424|     85|      return 1;
  425|     85|    }
  426|  1.13k|    ans_.buf = buf;
  427|  1.13k|    x = buf[offset - 1] >> 6;
  428|  1.13k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 763, False: 369]
  ------------------
  429|    763|      ans_.buf_offset = offset - 1;
  430|    763|      ans_.state = buf[offset - 1] & 0x3F;
  431|    763|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 152, False: 217]
  ------------------
  432|    152|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 25, False: 127]
  ------------------
  433|     25|        return 1;
  434|     25|      }
  435|    127|      ans_.buf_offset = offset - 2;
  436|    127|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    217|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 174, False: 43]
  ------------------
  438|    174|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 22, False: 152]
  ------------------
  439|     22|        return 1;
  440|     22|      }
  441|    152|      ans_.buf_offset = offset - 3;
  442|    152|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    152|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 43, False: 0]
  ------------------
  444|     43|      ans_.buf_offset = offset - 4;
  445|     43|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     43|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.08k|    ans_.state += l_rans_base;
  450|  1.08k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.08k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 45, False: 1.04k]
  ------------------
  451|     45|      return 1;
  452|     45|    }
  453|  1.04k|    return 0;
  454|  1.08k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    209|static uint32_t mem_get_le16(const void *vmem) {
   68|    209|  uint32_t val;
   69|    209|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    209|  val = mem[1] << 8;
   72|    209|  val |= mem[0];
   73|    209|  return val;
   74|    209|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    262|static uint32_t mem_get_le24(const void *vmem) {
   77|    262|  uint32_t val;
   78|    262|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    262|  val = mem[2] << 16;
   81|    262|  val |= mem[1] << 8;
   82|    262|  val |= mem[0];
   83|    262|  return val;
   84|    262|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    205|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    205|  uint32_t val;
   88|    205|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    205|  val = mem[3] << 24;
   91|    205|  val |= mem[2] << 16;
   92|    205|  val |= mem[1] << 8;
   93|    205|  val |= mem[0];
   94|    205|  return val;
   95|    205|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   106M|  inline int rans_read() {
  463|   106M|    unsigned rem;
  464|   106M|    unsigned quo;
  465|   106M|    struct rans_dec_sym sym;
  466|   106M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 90.2M, False: 15.9M]
  |  Branch (466:40): [True: 21.6k, False: 90.2M]
  ------------------
  467|  21.6k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  21.6k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  21.6k|    }
  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|   106M|    quo = ans_.state / rans_precision;
  472|   106M|    rem = ans_.state % rans_precision;
  473|   106M|    fetch_sym(&sym, rem);
  474|   106M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   106M|    return sym.val;
  476|   106M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   106M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   106M|    uint32_t symbol = lut_table_[rem];
  507|   106M|    out->val = symbol;
  508|   106M|    out->prob = probability_table_[symbol].prob;
  509|   106M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   106M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.00k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    124|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     71|                                       uint32_t num_symbols) {
  482|     71|    lut_table_.resize(rans_precision);
  483|     71|    probability_table_.resize(num_symbols);
  484|     71|    uint32_t cum_prob = 0;
  485|     71|    uint32_t act_prob = 0;
  486|  1.31k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.26k, False: 56]
  ------------------
  487|  1.26k|      probability_table_[i].prob = token_probs[i];
  488|  1.26k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.26k|      cum_prob += token_probs[i];
  490|  1.26k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 15, False: 1.24k]
  ------------------
  491|     15|        return false;
  492|     15|      }
  493|   420k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 419k, False: 1.24k]
  ------------------
  494|   419k|        lut_table_[j] = i;
  495|   419k|      }
  496|  1.24k|      act_prob = cum_prob;
  497|  1.24k|    }
  498|     56|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 12, False: 44]
  ------------------
  499|     12|      return false;
  500|     12|    }
  501|     44|    return true;
  502|     56|  }
_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: 0, False: 37]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     37|    ans_.buf = buf;
  427|     37|    x = buf[offset - 1] >> 6;
  428|     37|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 13, False: 24]
  ------------------
  429|     13|      ans_.buf_offset = offset - 1;
  430|     13|      ans_.state = buf[offset - 1] & 0x3F;
  431|     24|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 17]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 6]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     17|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 3]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 14]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     14|      ans_.buf_offset = offset - 3;
  442|     14|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 3, False: 0]
  ------------------
  444|      3|      ans_.buf_offset = offset - 4;
  445|      3|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      3|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     36|    ans_.state += l_rans_base;
  450|     36|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     36|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 36]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     36|    return 0;
  454|     36|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|   343k|  inline int rans_read() {
  463|   343k|    unsigned rem;
  464|   343k|    unsigned quo;
  465|   343k|    struct rans_dec_sym sym;
  466|   353k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 188k, False: 165k]
  |  Branch (466:40): [True: 9.90k, False: 178k]
  ------------------
  467|  9.90k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  9.90k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  9.90k|    }
  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|   343k|    quo = ans_.state / rans_precision;
  472|   343k|    rem = ans_.state % rans_precision;
  473|   343k|    fetch_sym(&sym, rem);
  474|   343k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   343k|    return sym.val;
  476|   343k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|   343k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   343k|    uint32_t symbol = lut_table_[rem];
  507|   343k|    out->val = symbol;
  508|   343k|    out->prob = probability_table_[symbol].prob;
  509|   343k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   343k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     36|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    170|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    115|                                       uint32_t num_symbols) {
  482|    115|    lut_table_.resize(rans_precision);
  483|    115|    probability_table_.resize(num_symbols);
  484|    115|    uint32_t cum_prob = 0;
  485|    115|    uint32_t act_prob = 0;
  486|  4.92k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.82k, False: 99]
  ------------------
  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: 16, False: 4.80k]
  ------------------
  491|     16|        return false;
  492|     16|      }
  493|  3.10M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.09M, False: 4.80k]
  ------------------
  494|  3.09M|        lut_table_[j] = i;
  495|  3.09M|      }
  496|  4.80k|      act_prob = cum_prob;
  497|  4.80k|    }
  498|     99|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 12, False: 87]
  ------------------
  499|     12|      return false;
  500|     12|    }
  501|     87|    return true;
  502|     99|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     53|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     53|    unsigned x;
  423|     53|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 51]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     51|    ans_.buf = buf;
  427|     51|    x = buf[offset - 1] >> 6;
  428|     51|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 31]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      ans_.state = buf[offset - 1] & 0x3F;
  431|     31|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 12, False: 19]
  ------------------
  432|     12|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 4, False: 8]
  ------------------
  433|      4|        return 1;
  434|      4|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     19|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 6, False: 13]
  ------------------
  438|      6|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 6]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     13|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 13, False: 0]
  ------------------
  444|     13|      ans_.buf_offset = offset - 4;
  445|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     13|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     47|    ans_.state += l_rans_base;
  450|     47|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     47|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 37]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     37|    return 0;
  454|     47|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   328k|  inline int rans_read() {
  463|   328k|    unsigned rem;
  464|   328k|    unsigned quo;
  465|   328k|    struct rans_dec_sym sym;
  466|   330k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 119k, False: 210k]
  |  Branch (466:40): [True: 1.30k, False: 118k]
  ------------------
  467|  1.30k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.30k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.30k|    }
  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|   328k|    quo = ans_.state / rans_precision;
  472|   328k|    rem = ans_.state % rans_precision;
  473|   328k|    fetch_sym(&sym, rem);
  474|   328k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   328k|    return sym.val;
  476|   328k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   328k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   328k|    uint32_t symbol = lut_table_[rem];
  507|   328k|    out->val = symbol;
  508|   328k|    out->prob = probability_table_[symbol].prob;
  509|   328k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   328k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     37|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    179|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    132|                                       uint32_t num_symbols) {
  482|    132|    lut_table_.resize(rans_precision);
  483|    132|    probability_table_.resize(num_symbols);
  484|    132|    uint32_t cum_prob = 0;
  485|    132|    uint32_t act_prob = 0;
  486|  3.64k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.52k, False: 116]
  ------------------
  487|  3.52k|      probability_table_[i].prob = token_probs[i];
  488|  3.52k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.52k|      cum_prob += token_probs[i];
  490|  3.52k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 16, False: 3.51k]
  ------------------
  491|     16|        return false;
  492|     16|      }
  493|  7.40M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 7.40M, False: 3.51k]
  ------------------
  494|  7.40M|        lut_table_[j] = i;
  495|  7.40M|      }
  496|  3.51k|      act_prob = cum_prob;
  497|  3.51k|    }
  498|    116|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 16, False: 100]
  ------------------
  499|     16|      return false;
  500|     16|    }
  501|    100|    return true;
  502|    116|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     87|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     87|    unsigned x;
  423|     87|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 87]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 66]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     66|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 43]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 14, False: 9]
  ------------------
  433|     14|        return 1;
  434|     14|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     43|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 22, False: 21]
  ------------------
  438|     22|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 10, False: 12]
  ------------------
  439|     10|        return 1;
  440|     10|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     63|    ans_.state += l_rans_base;
  450|     63|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     63|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 55]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     55|    return 0;
  454|     63|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   166k|  inline int rans_read() {
  463|   166k|    unsigned rem;
  464|   166k|    unsigned quo;
  465|   166k|    struct rans_dec_sym sym;
  466|   168k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 111k, False: 57.5k]
  |  Branch (466:40): [True: 2.87k, False: 108k]
  ------------------
  467|  2.87k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.87k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.87k|    }
  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|   166k|    quo = ans_.state / rans_precision;
  472|   166k|    rem = ans_.state % rans_precision;
  473|   166k|    fetch_sym(&sym, rem);
  474|   166k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   166k|    return sym.val;
  476|   166k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   166k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   166k|    uint32_t symbol = lut_table_[rem];
  507|   166k|    out->val = symbol;
  508|   166k|    out->prob = probability_table_[symbol].prob;
  509|   166k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   166k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     55|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    200|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    144|                                       uint32_t num_symbols) {
  482|    144|    lut_table_.resize(rans_precision);
  483|    144|    probability_table_.resize(num_symbols);
  484|    144|    uint32_t cum_prob = 0;
  485|    144|    uint32_t act_prob = 0;
  486|  19.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 18.9k, False: 136]
  ------------------
  487|  18.9k|      probability_table_[i].prob = token_probs[i];
  488|  18.9k|      probability_table_[i].cum_prob = cum_prob;
  489|  18.9k|      cum_prob += token_probs[i];
  490|  18.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 8, False: 18.9k]
  ------------------
  491|      8|        return false;
  492|      8|      }
  493|  30.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 30.9M, False: 18.9k]
  ------------------
  494|  30.9M|        lut_table_[j] = i;
  495|  30.9M|      }
  496|  18.9k|      act_prob = cum_prob;
  497|  18.9k|    }
  498|    136|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 22, False: 114]
  ------------------
  499|     22|      return false;
  500|     22|    }
  501|    114|    return true;
  502|    136|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     69|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     69|    unsigned x;
  423|     69|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 69]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     69|    ans_.buf = buf;
  427|     69|    x = buf[offset - 1] >> 6;
  428|     69|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 28, False: 41]
  ------------------
  429|     28|      ans_.buf_offset = offset - 1;
  430|     28|      ans_.state = buf[offset - 1] & 0x3F;
  431|     41|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 33]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 5]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     33|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 19]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 9]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     19|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 19, False: 0]
  ------------------
  444|     19|      ans_.buf_offset = offset - 4;
  445|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     19|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     61|    ans_.state += l_rans_base;
  450|     61|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     61|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 51]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     51|    return 0;
  454|     61|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   274k|  inline int rans_read() {
  463|   274k|    unsigned rem;
  464|   274k|    unsigned quo;
  465|   274k|    struct rans_dec_sym sym;
  466|   276k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 105k, False: 170k]
  |  Branch (466:40): [True: 1.59k, False: 104k]
  ------------------
  467|  1.59k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.59k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.59k|    }
  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|   274k|    quo = ans_.state / rans_precision;
  472|   274k|    rem = ans_.state % rans_precision;
  473|   274k|    fetch_sym(&sym, rem);
  474|   274k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   274k|    return sym.val;
  476|   274k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   274k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   274k|    uint32_t symbol = lut_table_[rem];
  507|   274k|    out->val = symbol;
  508|   274k|    out->prob = probability_table_[symbol].prob;
  509|   274k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   274k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     51|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    198|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    137|                                       uint32_t num_symbols) {
  482|    137|    lut_table_.resize(rans_precision);
  483|    137|    probability_table_.resize(num_symbols);
  484|    137|    uint32_t cum_prob = 0;
  485|    137|    uint32_t act_prob = 0;
  486|  7.11k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.99k, False: 121]
  ------------------
  487|  6.99k|      probability_table_[i].prob = token_probs[i];
  488|  6.99k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.99k|      cum_prob += token_probs[i];
  490|  6.99k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 16, False: 6.97k]
  ------------------
  491|     16|        return false;
  492|     16|      }
  493|  51.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 51.7M, False: 6.97k]
  ------------------
  494|  51.7M|        lut_table_[j] = i;
  495|  51.7M|      }
  496|  6.97k|      act_prob = cum_prob;
  497|  6.97k|    }
  498|    121|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 27, False: 94]
  ------------------
  499|     27|      return false;
  500|     27|    }
  501|     94|    return true;
  502|    121|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     75|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     75|    unsigned x;
  423|     75|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 75]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     75|    ans_.buf = buf;
  427|     75|    x = buf[offset - 1] >> 6;
  428|     75|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 54]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     54|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 12, False: 42]
  ------------------
  432|     12|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 12]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     42|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 21, False: 21]
  ------------------
  438|     21|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 15]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     69|    ans_.state += l_rans_base;
  450|     69|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     69|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 60]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     60|    return 0;
  454|     69|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   433k|  inline int rans_read() {
  463|   433k|    unsigned rem;
  464|   433k|    unsigned quo;
  465|   433k|    struct rans_dec_sym sym;
  466|   435k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 240k, False: 194k]
  |  Branch (466:40): [True: 1.36k, False: 239k]
  ------------------
  467|  1.36k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.36k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.36k|    }
  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|   433k|    quo = ans_.state / rans_precision;
  472|   433k|    rem = ans_.state % rans_precision;
  473|   433k|    fetch_sym(&sym, rem);
  474|   433k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   433k|    return sym.val;
  476|   433k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   433k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   433k|    uint32_t symbol = lut_table_[rem];
  507|   433k|    out->val = symbol;
  508|   433k|    out->prob = probability_table_[symbol].prob;
  509|   433k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   433k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     60|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    907|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    612|                                       uint32_t num_symbols) {
  482|    612|    lut_table_.resize(rans_precision);
  483|    612|    probability_table_.resize(num_symbols);
  484|    612|    uint32_t cum_prob = 0;
  485|    612|    uint32_t act_prob = 0;
  486|  37.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 36.7k, False: 582]
  ------------------
  487|  36.7k|      probability_table_[i].prob = token_probs[i];
  488|  36.7k|      probability_table_[i].cum_prob = cum_prob;
  489|  36.7k|      cum_prob += token_probs[i];
  490|  36.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 30, False: 36.7k]
  ------------------
  491|     30|        return false;
  492|     30|      }
  493|   571M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 571M, False: 36.7k]
  ------------------
  494|   571M|        lut_table_[j] = i;
  495|   571M|      }
  496|  36.7k|      act_prob = cum_prob;
  497|  36.7k|    }
  498|    582|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 52, False: 530]
  ------------------
  499|     52|      return false;
  500|     52|    }
  501|    530|    return true;
  502|    582|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    347|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    347|    unsigned x;
  423|    347|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 14, False: 333]
  ------------------
  424|     14|      return 1;
  425|     14|    }
  426|    333|    ans_.buf = buf;
  427|    333|    x = buf[offset - 1] >> 6;
  428|    333|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 126, False: 207]
  ------------------
  429|    126|      ans_.buf_offset = offset - 1;
  430|    126|      ans_.state = buf[offset - 1] & 0x3F;
  431|    207|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 51, False: 156]
  ------------------
  432|     51|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 42]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     42|      ans_.buf_offset = offset - 2;
  436|     42|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    156|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 71, False: 85]
  ------------------
  438|     71|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 17, False: 54]
  ------------------
  439|     17|        return 1;
  440|     17|      }
  441|     54|      ans_.buf_offset = offset - 3;
  442|     54|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     85|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 85, False: 0]
  ------------------
  444|     85|      ans_.buf_offset = offset - 4;
  445|     85|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     85|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    307|    ans_.state += l_rans_base;
  450|    307|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    307|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 16, False: 291]
  ------------------
  451|     16|      return 1;
  452|     16|    }
  453|    291|    return 0;
  454|    307|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  51.6M|  inline int rans_read() {
  463|  51.6M|    unsigned rem;
  464|  51.6M|    unsigned quo;
  465|  51.6M|    struct rans_dec_sym sym;
  466|  51.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 33.3M, False: 18.3M]
  |  Branch (466:40): [True: 9.69k, False: 33.3M]
  ------------------
  467|  9.69k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  9.69k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  9.69k|    }
  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|  51.6M|    quo = ans_.state / rans_precision;
  472|  51.6M|    rem = ans_.state % rans_precision;
  473|  51.6M|    fetch_sym(&sym, rem);
  474|  51.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  51.6M|    return sym.val;
  476|  51.6M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  51.6M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  51.6M|    uint32_t symbol = lut_table_[rem];
  507|  51.6M|    out->val = symbol;
  508|  51.6M|    out->prob = probability_table_[symbol].prob;
  509|  51.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  51.6M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    291|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.11k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.11k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.11k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.11k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.11k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 168, False: 945]
  ------------------
   67|    168|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 165]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|    168|  } else
   72|    945|#endif
   73|    945|  {
   74|    945|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 940]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    945|  }
   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|  1.10k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 126, False: 979]
  ------------------
   83|    126|    return false;
   84|    126|  }
   85|    979|  probability_table_.resize(num_symbols_);
   86|    979|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 245, False: 734]
  ------------------
   87|    245|    return true;
   88|    245|  }
   89|       |  // Decode the table.
   90|  1.98M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.98M, False: 568]
  ------------------
   91|  1.98M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.98M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 1.98M]
  ------------------
   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|  1.98M|    const int token = prob_data & 3;
  102|  1.98M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.55M, False: 437k]
  ------------------
  103|  1.55M|      const uint32_t offset = prob_data >> 2;
  104|  1.55M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 104, False: 1.55M]
  ------------------
  105|    104|        return false;
  106|    104|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  63.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 62.2M, False: 1.55M]
  ------------------
  109|  62.2M|        probability_table_[i + j] = 0;
  110|  62.2M|      }
  111|  1.55M|      i += offset;
  112|  1.55M|    } else {
  113|   437k|      const int extra_bytes = token;
  114|   437k|      uint32_t prob = prob_data >> 2;
  115|   665k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 227k, False: 437k]
  ------------------
  116|   227k|        uint8_t eb;
  117|   227k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 227k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   227k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   227k|      }
  124|   437k|      probability_table_[i] = prob;
  125|   437k|    }
  126|  1.98M|  }
  127|    568|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 122, False: 446]
  ------------------
  128|    122|    return false;
  129|    122|  }
  130|    446|  return true;
  131|    568|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    660|    DecoderBuffer *buffer) {
  136|    660|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    660|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    660|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    660|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 67, False: 593]
  ------------------
  140|     67|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 66]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     67|  } else
  145|    593|#endif
  146|    593|  {
  147|    593|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 586]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    593|  }
  151|    652|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 95, False: 557]
  ------------------
  152|     95|    return false;
  153|     95|  }
  154|    557|  const uint8_t *const data_head =
  155|    557|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    557|  buffer->Advance(bytes_encoded);
  158|    557|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 90, False: 467]
  ------------------
  159|     90|    return false;
  160|     90|  }
  161|    467|  return true;
  162|    557|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    504|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  10.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    431|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    431|  ans_.read_end();
  167|    431|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    432|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    432|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    432|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 432]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    432|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    432|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    432|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 394]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 36]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     38|  } else
   72|    394|#endif
   73|    394|  {
   74|    394|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 387]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    394|  }
   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|    423|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 30, False: 393]
  ------------------
   83|     30|    return false;
   84|     30|  }
   85|    393|  probability_table_.resize(num_symbols_);
   86|    393|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 28, False: 365]
  ------------------
   87|     28|    return true;
   88|     28|  }
   89|       |  // Decode the table.
   90|  1.89M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.89M, False: 262]
  ------------------
   91|  1.89M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.89M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 29, False: 1.89M]
  ------------------
   95|     29|      return false;
   96|     29|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.89M|    const int token = prob_data & 3;
  102|  1.89M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 659k, False: 1.23M]
  ------------------
  103|   659k|      const uint32_t offset = prob_data >> 2;
  104|   659k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 58, False: 659k]
  ------------------
  105|     58|        return false;
  106|     58|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  16.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 15.6M, False: 659k]
  ------------------
  109|  15.6M|        probability_table_[i + j] = 0;
  110|  15.6M|      }
  111|   659k|      i += offset;
  112|  1.23M|    } else {
  113|  1.23M|      const int extra_bytes = token;
  114|  1.23M|      uint32_t prob = prob_data >> 2;
  115|  2.36M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.12M, False: 1.23M]
  ------------------
  116|  1.12M|        uint8_t eb;
  117|  1.12M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 1.12M]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.12M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.12M|      }
  124|  1.23M|      probability_table_[i] = prob;
  125|  1.23M|    }
  126|  1.89M|  }
  127|    262|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 176, False: 86]
  ------------------
  128|    176|    return false;
  129|    176|  }
  130|     86|  return true;
  131|    262|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    114|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|     86|    DecoderBuffer *buffer) {
  136|     86|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     86|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     86|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     86|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 86]
  ------------------
  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|     86|#endif
  146|     86|  {
  147|     86|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 83]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     86|  }
  151|     83|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 77]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 67]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     67|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  4.06M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    256|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    256|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    256|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 256]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    256|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    256|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    256|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 51, False: 205]
  ------------------
   67|     51|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 51]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     51|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 202]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    205|  }
   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|    253|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 243]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    243|  probability_table_.resize(num_symbols_);
   86|    243|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 239]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   248k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 247k, False: 185]
  ------------------
   91|   247k|    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|   247k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 247k]
  ------------------
   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|   247k|    const int token = prob_data & 3;
  102|   247k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.5k, False: 225k]
  ------------------
  103|  22.5k|      const uint32_t offset = prob_data >> 2;
  104|  22.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 22.5k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   603k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 581k, False: 22.5k]
  ------------------
  109|   581k|        probability_table_[i + j] = 0;
  110|   581k|      }
  111|  22.5k|      i += offset;
  112|   225k|    } else {
  113|   225k|      const int extra_bytes = token;
  114|   225k|      uint32_t prob = prob_data >> 2;
  115|   441k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 216k, False: 225k]
  ------------------
  116|   216k|        uint8_t eb;
  117|   216k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 216k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   216k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   216k|      }
  124|   225k|      probability_table_[i] = prob;
  125|   225k|    }
  126|   247k|  }
  127|    185|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 149]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    149|  return true;
  131|    185|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    153|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    149|    DecoderBuffer *buffer) {
  136|    149|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    149|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    149|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    149|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 118]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 31]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     31|  } else
  145|    118|#endif
  146|    118|  {
  147|    118|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 107]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    118|  }
  151|    138|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 84]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|     84|  const uint8_t *const data_head =
  155|     84|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     84|  buffer->Advance(bytes_encoded);
  158|     84|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 75]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     75|  return true;
  162|     84|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  2.21M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     75|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     75|  ans_.read_end();
  167|     75|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    254|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    254|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    254|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 254]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    254|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    254|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 59, False: 195]
  ------------------
   67|     59|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 59]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     59|  } else
   72|    195|#endif
   73|    195|  {
   74|    195|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 186]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    195|  }
   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|    245|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 233]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    233|  probability_table_.resize(num_symbols_);
   86|    233|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 232]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   301k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 301k, False: 176]
  ------------------
   91|   301k|    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|   301k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 301k]
  ------------------
   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|   301k|    const int token = prob_data & 3;
  102|   301k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 96.8k, False: 204k]
  ------------------
  103|  96.8k|      const uint32_t offset = prob_data >> 2;
  104|  96.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 96.8k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.10M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.00M, False: 96.8k]
  ------------------
  109|  4.00M|        probability_table_[i + j] = 0;
  110|  4.00M|      }
  111|  96.8k|      i += offset;
  112|   204k|    } else {
  113|   204k|      const int extra_bytes = token;
  114|   204k|      uint32_t prob = prob_data >> 2;
  115|   323k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 118k, False: 204k]
  ------------------
  116|   118k|        uint8_t eb;
  117|   118k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 118k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   118k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   118k|      }
  124|   204k|      probability_table_[i] = prob;
  125|   204k|    }
  126|   301k|  }
  127|    176|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 163]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    163|  return true;
  131|    176|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    163|    DecoderBuffer *buffer) {
  136|    163|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    163|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    163|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    163|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 127]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 35]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     36|  } else
  145|    127|#endif
  146|    127|  {
  147|    127|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 127]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    127|  }
  151|    162|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 99]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     99|  const uint8_t *const data_head =
  155|     99|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     99|  buffer->Advance(bytes_encoded);
  158|     99|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 89]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     89|  return true;
  162|     99|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  10.9M|  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|    201|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    201|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    201|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 201]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    201|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    201|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    201|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 145]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 56]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     56|  } else
   72|    145|#endif
   73|    145|  {
   74|    145|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 145]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    145|  }
   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|    201|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 186]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    186|  probability_table_.resize(num_symbols_);
   86|    186|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 183]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   156k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 155k, False: 124]
  ------------------
   91|   155k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   155k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 155k]
  ------------------
   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|   155k|    const int token = prob_data & 3;
  102|   155k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 54.3k, False: 101k]
  ------------------
  103|  54.3k|      const uint32_t offset = prob_data >> 2;
  104|  54.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 54.3k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.42M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.36M, False: 54.3k]
  ------------------
  109|  1.36M|        probability_table_[i + j] = 0;
  110|  1.36M|      }
  111|  54.3k|      i += offset;
  112|   101k|    } else {
  113|   101k|      const int extra_bytes = token;
  114|   101k|      uint32_t prob = prob_data >> 2;
  115|   183k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 81.9k, False: 101k]
  ------------------
  116|  81.9k|        uint8_t eb;
  117|  81.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 81.9k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  81.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  81.9k|      }
  124|   101k|      probability_table_[i] = prob;
  125|   101k|    }
  126|   155k|  }
  127|    124|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 11, False: 113]
  ------------------
  128|     11|    return false;
  129|     11|  }
  130|    113|  return true;
  131|    124|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    116|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    113|    DecoderBuffer *buffer) {
  136|    113|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 92]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 20]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     21|  } else
  145|     92|#endif
  146|     92|  {
  147|     92|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 89]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     92|  }
  151|    109|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 70]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|     70|  const uint8_t *const data_head =
  155|     70|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     70|  buffer->Advance(bytes_encoded);
  158|     70|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 64]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     64|  return true;
  162|     70|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  14.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    224|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    224|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    224|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 224]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    224|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    224|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    224|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 207]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|    207|#endif
   73|    207|  {
   74|    207|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 207]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    207|  }
   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|    224|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 216]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    216|  probability_table_.resize(num_symbols_);
   86|    216|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 215]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  79.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 79.2k, False: 177]
  ------------------
   91|  79.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|  79.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 79.2k]
  ------------------
   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|  79.2k|    const int token = prob_data & 3;
  102|  79.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.91k, False: 69.3k]
  ------------------
  103|  9.91k|      const uint32_t offset = prob_data >> 2;
  104|  9.91k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 9.90k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   332k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 322k, False: 9.90k]
  ------------------
  109|   322k|        probability_table_[i + j] = 0;
  110|   322k|      }
  111|  9.90k|      i += offset;
  112|  69.3k|    } else {
  113|  69.3k|      const int extra_bytes = token;
  114|  69.3k|      uint32_t prob = prob_data >> 2;
  115|  94.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 25.6k, False: 69.3k]
  ------------------
  116|  25.6k|        uint8_t eb;
  117|  25.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 25.6k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  25.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  25.6k|      }
  124|  69.3k|      probability_table_[i] = prob;
  125|  69.3k|    }
  126|  79.2k|  }
  127|    177|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 162]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|    162|  return true;
  131|    177|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    163|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    162|    DecoderBuffer *buffer) {
  136|    162|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 155]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    155|#endif
  146|    155|  {
  147|    155|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 148]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    155|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 137]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|    137|  const uint8_t *const data_head =
  155|    137|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    137|  buffer->Advance(bytes_encoded);
  158|    137|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 118]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|    118|  return true;
  162|    137|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  26.2M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    118|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    118|  ans_.read_end();
  167|    118|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    292|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    292|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    292|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 292]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    292|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    292|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    292|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 236]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 56]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     56|  } else
   72|    236|#endif
   73|    236|  {
   74|    236|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 235]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    236|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    291|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 281]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    281|  probability_table_.resize(num_symbols_);
   86|    281|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 274]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   995k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 994k, False: 189]
  ------------------
   91|   994k|    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|   994k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 994k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   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|   994k|    const int token = prob_data & 3;
  102|   994k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 257k, False: 737k]
  ------------------
  103|   257k|      const uint32_t offset = prob_data >> 2;
  104|   257k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 257k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.05M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.79M, False: 257k]
  ------------------
  109|  8.79M|        probability_table_[i + j] = 0;
  110|  8.79M|      }
  111|   257k|      i += offset;
  112|   737k|    } else {
  113|   737k|      const int extra_bytes = token;
  114|   737k|      uint32_t prob = prob_data >> 2;
  115|  1.25M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 521k, False: 737k]
  ------------------
  116|   521k|        uint8_t eb;
  117|   521k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 521k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   521k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   521k|      }
  124|   737k|      probability_table_[i] = prob;
  125|   737k|    }
  126|   994k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 166]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    166|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    173|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    166|    DecoderBuffer *buffer) {
  136|    166|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    166|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    166|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    166|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 164]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 1]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      2|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 154]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    164|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 116]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|    116|  const uint8_t *const data_head =
  155|    116|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    116|  buffer->Advance(bytes_encoded);
  158|    116|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 95]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     95|  return true;
  162|    116|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  24.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     95|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     95|  ans_.read_end();
  167|     95|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    203|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    203|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    203|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 203]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    203|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    203|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    203|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 174]
  ------------------
   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|    174|#endif
   73|    174|  {
   74|    174|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 172]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    174|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    201|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 195]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    195|  probability_table_.resize(num_symbols_);
   86|    195|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 195]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   655k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 655k, False: 137]
  ------------------
   91|   655k|    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|   655k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 655k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   655k|    const int token = prob_data & 3;
  102|   655k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 162k, False: 492k]
  ------------------
  103|   162k|      const uint32_t offset = prob_data >> 2;
  104|   162k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 162k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.12M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.96M, False: 162k]
  ------------------
  109|  4.96M|        probability_table_[i + j] = 0;
  110|  4.96M|      }
  111|   162k|      i += offset;
  112|   492k|    } else {
  113|   492k|      const int extra_bytes = token;
  114|   492k|      uint32_t prob = prob_data >> 2;
  115|   730k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 237k, False: 492k]
  ------------------
  116|   237k|        uint8_t eb;
  117|   237k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 237k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   237k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   237k|      }
  124|   492k|      probability_table_[i] = prob;
  125|   492k|    }
  126|   655k|  }
  127|    137|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 119]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    119|  return true;
  131|    137|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    119|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    119|    DecoderBuffer *buffer) {
  136|    119|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    119|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    119|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    119|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 111]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 7]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      8|  } else
  145|    111|#endif
  146|    111|  {
  147|    111|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 104]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    111|  }
  151|    111|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 77]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 65]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     65|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  12.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    124|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    124|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    124|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 124]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    124|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    124|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    124|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 118]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|    118|#endif
   73|    118|  {
   74|    118|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 118]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    118|  }
   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|    124|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 117]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    117|  probability_table_.resize(num_symbols_);
   86|    117|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 117]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  9.23k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.16k, False: 71]
  ------------------
   91|  9.16k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  9.16k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 9.14k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.14k|    const int token = prob_data & 3;
  102|  9.14k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.73k, False: 6.40k]
  ------------------
  103|  2.73k|      const uint32_t offset = prob_data >> 2;
  104|  2.73k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 2.72k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  88.0k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 85.3k, False: 2.72k]
  ------------------
  109|  85.3k|        probability_table_[i + j] = 0;
  110|  85.3k|      }
  111|  2.72k|      i += offset;
  112|  6.40k|    } else {
  113|  6.40k|      const int extra_bytes = token;
  114|  6.40k|      uint32_t prob = prob_data >> 2;
  115|  10.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.54k, False: 6.39k]
  ------------------
  116|  4.54k|        uint8_t eb;
  117|  4.54k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 4.53k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.53k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.53k|      }
  124|  6.39k|      probability_table_[i] = prob;
  125|  6.39k|    }
  126|  9.14k|  }
  127|     71|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 44]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|     44|  return true;
  131|     71|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     44|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     44|    DecoderBuffer *buffer) {
  136|     44|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     44|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     44|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     44|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 44]
  ------------------
  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|     44|#endif
  146|     44|  {
  147|     44|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 44]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     44|  }
  151|     44|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 37]
  ------------------
  152|      7|    return false;
  153|      7|  }
  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: 1, False: 36]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     36|  return true;
  162|     37|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   343k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     36|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     36|  ans_.read_end();
  167|     36|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    170|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_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: 17, False: 153]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|    153|#endif
   73|    153|  {
   74|    153|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 153]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    153|  }
   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: 16, False: 154]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    154|  probability_table_.resize(num_symbols_);
   86|    154|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 153]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  24.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 24.2k, False: 115]
  ------------------
   91|  24.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|  24.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 11, False: 24.2k]
  ------------------
   95|     11|      return false;
   96|     11|    }
   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|  24.2k|    const int token = prob_data & 3;
  102|  24.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.28k, False: 17.9k]
  ------------------
  103|  6.28k|      const uint32_t offset = prob_data >> 2;
  104|  6.28k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 6.27k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   226k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 220k, False: 6.27k]
  ------------------
  109|   220k|        probability_table_[i + j] = 0;
  110|   220k|      }
  111|  6.27k|      i += offset;
  112|  17.9k|    } else {
  113|  17.9k|      const int extra_bytes = token;
  114|  17.9k|      uint32_t prob = prob_data >> 2;
  115|  28.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.9k, False: 17.9k]
  ------------------
  116|  10.9k|        uint8_t eb;
  117|  10.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 10.9k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.9k|      }
  124|  17.9k|      probability_table_[i] = prob;
  125|  17.9k|    }
  126|  24.2k|  }
  127|    115|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 87]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|     87|  return true;
  131|    115|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     88|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     87|    DecoderBuffer *buffer) {
  136|     87|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     87|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     87|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     87|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 84]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|     84|#endif
  146|     84|  {
  147|     84|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 83]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     84|  }
  151|     86|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 53]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|     53|  const uint8_t *const data_head =
  155|     53|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     53|  buffer->Advance(bytes_encoded);
  158|     53|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 37]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     37|  return true;
  162|     53|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   328k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     37|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     37|  ans_.read_end();
  167|     37|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    179|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    179|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    179|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 179]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    179|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    179|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 164]
  ------------------
   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|    164|#endif
   73|    164|  {
   74|    164|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 164]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    164|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    179|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 177]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    177|  probability_table_.resize(num_symbols_);
   86|    177|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 176]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  60.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 60.5k, False: 132]
  ------------------
   91|  60.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  60.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 60.5k]
  ------------------
   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|  60.5k|    const int token = prob_data & 3;
  102|  60.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 11.9k, False: 48.6k]
  ------------------
  103|  11.9k|      const uint32_t offset = prob_data >> 2;
  104|  11.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 11.8k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   376k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 364k, False: 11.8k]
  ------------------
  109|   364k|        probability_table_[i + j] = 0;
  110|   364k|      }
  111|  11.8k|      i += offset;
  112|  48.6k|    } else {
  113|  48.6k|      const int extra_bytes = token;
  114|  48.6k|      uint32_t prob = prob_data >> 2;
  115|  78.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 30.1k, False: 48.6k]
  ------------------
  116|  30.1k|        uint8_t eb;
  117|  30.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 30.1k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  30.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  30.1k|      }
  124|  48.6k|      probability_table_[i] = prob;
  125|  48.6k|    }
  126|  60.5k|  }
  127|    132|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 100]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    100|  return true;
  131|    132|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    101|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    100|    DecoderBuffer *buffer) {
  136|    100|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    100|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    100|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    100|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 100]
  ------------------
  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|    100|#endif
  146|    100|  {
  147|    100|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 99]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    100|  }
  151|     99|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 87]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|     87|  const uint8_t *const data_head =
  155|     87|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     87|  buffer->Advance(bytes_encoded);
  158|     87|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 55]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     55|  return true;
  162|     87|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   166k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     55|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     55|  ans_.read_end();
  167|     55|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    200|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    200|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    200|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 200]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    200|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    200|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    200|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 54, False: 146]
  ------------------
   67|     54|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 54]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     54|  } else
   72|    146|#endif
   73|    146|  {
   74|    146|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 146]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    146|  }
   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|    200|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 191]
  ------------------
   83|      9|    return false;
   84|      9|  }
   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|  1.33M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.33M, False: 144]
  ------------------
   91|  1.33M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.33M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 1.33M]
  ------------------
   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|  1.33M|    const int token = prob_data & 3;
  102|  1.33M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.30M, False: 29.9k]
  ------------------
  103|  1.30M|      const uint32_t offset = prob_data >> 2;
  104|  1.30M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 1.30M]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  44.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 43.6M, False: 1.30M]
  ------------------
  109|  43.6M|        probability_table_[i + j] = 0;
  110|  43.6M|      }
  111|  1.30M|      i += offset;
  112|  1.30M|    } else {
  113|  29.9k|      const int extra_bytes = token;
  114|  29.9k|      uint32_t prob = prob_data >> 2;
  115|  50.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.2k, False: 29.9k]
  ------------------
  116|  20.2k|        uint8_t eb;
  117|  20.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 20.2k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.2k|      }
  124|  29.9k|      probability_table_[i] = prob;
  125|  29.9k|    }
  126|  1.33M|  }
  127|    144|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 114]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    114|  return true;
  131|    144|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    115|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    114|    DecoderBuffer *buffer) {
  136|    114|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    114|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    114|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    114|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 39, False: 75]
  ------------------
  140|     39|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 39]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     39|  } else
  145|     75|#endif
  146|     75|  {
  147|     75|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 71]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|     75|  }
  151|    110|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 69]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|     69|  const uint8_t *const data_head =
  155|     69|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     69|  buffer->Advance(bytes_encoded);
  158|     69|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 51]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     51|  return true;
  162|     69|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   274k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    198|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    198|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    198|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 198]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 187]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|    187|#endif
   73|    187|  {
   74|    187|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 183]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    187|  }
   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|    194|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 182]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    182|  probability_table_.resize(num_symbols_);
   86|    182|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 173]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  33.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 33.8k, False: 137]
  ------------------
   91|  33.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  33.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 33.8k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  33.8k|    const int token = prob_data & 3;
  102|  33.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.65k, False: 29.1k]
  ------------------
  103|  4.65k|      const uint32_t offset = prob_data >> 2;
  104|  4.65k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 4.64k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   107k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 102k, False: 4.64k]
  ------------------
  109|   102k|        probability_table_[i + j] = 0;
  110|   102k|      }
  111|  4.64k|      i += offset;
  112|  29.1k|    } else {
  113|  29.1k|      const int extra_bytes = token;
  114|  29.1k|      uint32_t prob = prob_data >> 2;
  115|  56.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 27.0k, False: 29.1k]
  ------------------
  116|  27.0k|        uint8_t eb;
  117|  27.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 27.0k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  27.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  27.0k|      }
  124|  29.1k|      probability_table_[i] = prob;
  125|  29.1k|    }
  126|  33.8k|  }
  127|    137|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 43, False: 94]
  ------------------
  128|     43|    return false;
  129|     43|  }
  130|     94|  return true;
  131|    137|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    103|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_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: 0, False: 94]
  ------------------
  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|     94|#endif
  146|     94|  {
  147|     94|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 93]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     94|  }
  151|     93|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 75]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     75|  const uint8_t *const data_head =
  155|     75|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     75|  buffer->Advance(bytes_encoded);
  158|     75|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 60]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     60|  return true;
  162|     75|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   433k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     60|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     60|  ans_.read_end();
  167|     60|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    139|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_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: 7, False: 132]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    132|  probability_table_.resize(num_symbols_);
   86|    132|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 132]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   894k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 894k, False: 99]
  ------------------
   91|   894k|    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|   894k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 894k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   894k|    const int token = prob_data & 3;
  102|   894k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 371k, False: 522k]
  ------------------
  103|   371k|      const uint32_t offset = prob_data >> 2;
  104|   371k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 371k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  21.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 21.2M, False: 371k]
  ------------------
  109|  21.2M|        probability_table_[i + j] = 0;
  110|  21.2M|      }
  111|   371k|      i += offset;
  112|   522k|    } else {
  113|   522k|      const int extra_bytes = token;
  114|   522k|      uint32_t prob = prob_data >> 2;
  115|   773k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 250k, False: 522k]
  ------------------
  116|   250k|        uint8_t eb;
  117|   250k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 250k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   250k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   250k|      }
  124|   522k|      probability_table_[i] = prob;
  125|   522k|    }
  126|   894k|  }
  127|     99|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 87]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     87|  return true;
  131|     99|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     87|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     87|    DecoderBuffer *buffer) {
  136|     87|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     87|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     87|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     87|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 86]
  ------------------
  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|     86|#endif
  146|     86|  {
  147|     86|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 82]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|     86|  }
  151|     83|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 67]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 58]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     58|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  6.57M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    241|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    241|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    241|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 241]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    241|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    241|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    241|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 99, False: 142]
  ------------------
   67|     99|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 99]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     99|  } 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|    241|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 215]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    215|  probability_table_.resize(num_symbols_);
   86|    215|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 213]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  60.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 60.0k, False: 152]
  ------------------
   91|  60.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|  60.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 60.0k]
  ------------------
   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|  60.0k|    const int token = prob_data & 3;
  102|  60.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 25.4k, False: 34.5k]
  ------------------
  103|  25.4k|      const uint32_t offset = prob_data >> 2;
  104|  25.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 25.3k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   761k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 736k, False: 25.3k]
  ------------------
  109|   736k|        probability_table_[i + j] = 0;
  110|   736k|      }
  111|  25.3k|      i += offset;
  112|  34.5k|    } else {
  113|  34.5k|      const int extra_bytes = token;
  114|  34.5k|      uint32_t prob = prob_data >> 2;
  115|  64.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.9k, False: 34.5k]
  ------------------
  116|  29.9k|        uint8_t eb;
  117|  29.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 29.9k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.9k|      }
  124|  34.5k|      probability_table_[i] = prob;
  125|  34.5k|    }
  126|  60.0k|  }
  127|    152|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 124]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    124|  return true;
  131|    152|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    126|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    124|    DecoderBuffer *buffer) {
  136|    124|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    124|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    124|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    124|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 50, False: 74]
  ------------------
  140|     50|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 50]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     50|  } else
  145|     74|#endif
  146|     74|  {
  147|     74|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 74]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     74|  }
  151|    124|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 55, False: 69]
  ------------------
  152|     55|    return false;
  153|     55|  }
  154|     69|  const uint8_t *const data_head =
  155|     69|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     69|  buffer->Advance(bytes_encoded);
  158|     69|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 61]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     61|  return true;
  162|     69|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  7.97M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    206|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    206|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    206|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 206]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    206|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    206|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    206|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 49, False: 157]
  ------------------
   67|     49|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 49]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     49|  } else
   72|    157|#endif
   73|    157|  {
   74|    157|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 157]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    157|  }
   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|    206|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 203]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    203|  probability_table_.resize(num_symbols_);
   86|    203|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 203]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  34.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 34.7k, False: 126]
  ------------------
   91|  34.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  34.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 34.7k]
  ------------------
   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|  34.7k|    const int token = prob_data & 3;
  102|  34.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.8k, False: 23.8k]
  ------------------
  103|  10.8k|      const uint32_t offset = prob_data >> 2;
  104|  10.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 53, False: 10.8k]
  ------------------
  105|     53|        return false;
  106|     53|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   481k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 470k, False: 10.8k]
  ------------------
  109|   470k|        probability_table_[i + j] = 0;
  110|   470k|      }
  111|  10.8k|      i += offset;
  112|  23.8k|    } else {
  113|  23.8k|      const int extra_bytes = token;
  114|  23.8k|      uint32_t prob = prob_data >> 2;
  115|  37.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 13.4k, False: 23.8k]
  ------------------
  116|  13.4k|        uint8_t eb;
  117|  13.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 13.4k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  13.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  13.4k|      }
  124|  23.8k|      probability_table_[i] = prob;
  125|  23.8k|    }
  126|  34.7k|  }
  127|    126|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 102]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    102|  return true;
  131|    126|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    102|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    102|    DecoderBuffer *buffer) {
  136|    102|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    102|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    102|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    102|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 96]
  ------------------
  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|     96|#endif
  146|     96|  {
  147|     96|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 95]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     96|  }
  151|    101|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 67]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 55]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     55|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  11.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     55|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     55|  ans_.read_end();
  167|     55|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    170|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_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: 33, False: 137]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 33]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     33|  } else
   72|    137|#endif
   73|    137|  {
   74|    137|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 137]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    137|  }
   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: 12, False: 158]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    158|  probability_table_.resize(num_symbols_);
   86|    158|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 158]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  15.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.5k, False: 119]
  ------------------
   91|  15.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  15.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 15.5k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  15.5k|    const int token = prob_data & 3;
  102|  15.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.24k, False: 8.26k]
  ------------------
  103|  7.24k|      const uint32_t offset = prob_data >> 2;
  104|  7.24k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 7.22k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   207k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 200k, False: 7.22k]
  ------------------
  109|   200k|        probability_table_[i + j] = 0;
  110|   200k|      }
  111|  7.22k|      i += offset;
  112|  8.26k|    } else {
  113|  8.26k|      const int extra_bytes = token;
  114|  8.26k|      uint32_t prob = prob_data >> 2;
  115|  12.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.26k, False: 8.25k]
  ------------------
  116|  4.26k|        uint8_t eb;
  117|  4.26k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 4.26k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.26k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.26k|      }
  124|  8.25k|      probability_table_[i] = prob;
  125|  8.25k|    }
  126|  15.5k|  }
  127|    119|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 109]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|    109|  return true;
  131|    119|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    109|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    109|    DecoderBuffer *buffer) {
  136|    109|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    109|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    109|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    109|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 89]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } else
  145|     89|#endif
  146|     89|  {
  147|     89|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 89]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     89|  }
  151|    109|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 70]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|     70|  const uint8_t *const data_head =
  155|     70|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     70|  buffer->Advance(bytes_encoded);
  158|     70|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 59]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|     59|  return true;
  162|     70|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  3.49M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    151|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    151|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    151|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 151]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    151|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    151|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    151|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 146]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|    146|#endif
   73|    146|  {
   74|    146|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 146]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    146|  }
   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|    151|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 147]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    147|  probability_table_.resize(num_symbols_);
   86|    147|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 147]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  52.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 52.0k, False: 116]
  ------------------
   91|  52.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|  52.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 51.9k]
  ------------------
   95|     19|      return false;
   96|     19|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  51.9k|    const int token = prob_data & 3;
  102|  51.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 44.0k, False: 7.95k]
  ------------------
  103|  44.0k|      const uint32_t offset = prob_data >> 2;
  104|  44.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 44.0k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.54M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.49M, False: 44.0k]
  ------------------
  109|  1.49M|        probability_table_[i + j] = 0;
  110|  1.49M|      }
  111|  44.0k|      i += offset;
  112|  44.0k|    } else {
  113|  7.95k|      const int extra_bytes = token;
  114|  7.95k|      uint32_t prob = prob_data >> 2;
  115|  13.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.50k, False: 7.94k]
  ------------------
  116|  5.50k|        uint8_t eb;
  117|  5.50k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 5.50k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.50k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.50k|      }
  124|  7.94k|      probability_table_[i] = prob;
  125|  7.94k|    }
  126|  51.9k|  }
  127|    116|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 108]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|    108|  return true;
  131|    116|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    108|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    108|    DecoderBuffer *buffer) {
  136|    108|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    108|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    108|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    108|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 107]
  ------------------
  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|    107|#endif
  146|    107|  {
  147|    107|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 17, False: 90]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|    107|  }
  151|     91|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 74]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 58]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     58|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  22.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  8.60k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  8.60k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 3, False: 8.59k]
  ------------------
   35|      3|    return true;
   36|      3|  }
   37|       |  // Decode which scheme to use.
   38|  8.59k|  uint8_t scheme;
   39|  8.59k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 87, False: 8.51k]
  ------------------
   40|     87|    return false;
   41|     87|  }
   42|  8.51k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 7.50k]
  ------------------
   43|  1.00k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.00k|                                                  src_buffer, out_values);
   45|  7.50k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 3.99k, False: 3.51k]
  ------------------
   46|  3.99k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  3.99k|                                               out_values);
   48|  3.99k|  }
   49|  3.51k|  return false;
   50|  8.51k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.00k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.00k|  SymbolDecoderT<5> tag_decoder;
   57|  1.00k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 399, False: 602]
  ------------------
   58|    399|    return false;
   59|    399|  }
   60|       |
   61|    602|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 187, False: 415]
  ------------------
   62|    187|    return false;
   63|    187|  }
   64|       |
   65|    415|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 415, False: 0]
  |  Branch (65:25): [True: 33, False: 382]
  ------------------
   66|     33|    return false;  // Wrong number of symbols.
   67|     33|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    382|  src_buffer->StartBitDecoding(false, nullptr);
   72|    382|  int value_id = 0;
   73|  1.98M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 1.98M, False: 379]
  ------------------
   74|       |    // Decode the tag.
   75|  1.98M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  5.95M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 3.97M, False: 1.98M]
  ------------------
   78|  3.97M|      uint32_t val;
   79|  3.97M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 3, False: 3.97M]
  ------------------
   80|      3|        return false;
   81|      3|      }
   82|  3.97M|      out_values[value_id++] = val;
   83|  3.97M|    }
   84|  1.98M|  }
   85|    379|  tag_decoder.EndDecoding();
   86|    379|  src_buffer->EndBitDecoding();
   87|    379|  return true;
   88|    382|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  3.99k|                      uint32_t *out_values) {
  117|  3.99k|  uint8_t max_bit_length;
  118|  3.99k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 6, False: 3.98k]
  ------------------
  119|      6|    return false;
  120|      6|  }
  121|  3.98k|  switch (max_bit_length) {
  122|    432|    case 1:
  ------------------
  |  Branch (122:5): [True: 432, False: 3.55k]
  ------------------
  123|    432|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    432|                                                         out_values);
  125|    256|    case 2:
  ------------------
  |  Branch (125:5): [True: 256, False: 3.73k]
  ------------------
  126|    256|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    256|                                                         out_values);
  128|    254|    case 3:
  ------------------
  |  Branch (128:5): [True: 254, False: 3.73k]
  ------------------
  129|    254|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    254|                                                         out_values);
  131|    201|    case 4:
  ------------------
  |  Branch (131:5): [True: 201, False: 3.78k]
  ------------------
  132|    201|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    201|                                                         out_values);
  134|    112|    case 5:
  ------------------
  |  Branch (134:5): [True: 112, False: 3.87k]
  ------------------
  135|    112|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    112|                                                         out_values);
  137|    224|    case 6:
  ------------------
  |  Branch (137:5): [True: 224, False: 3.76k]
  ------------------
  138|    224|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    224|                                                         out_values);
  140|    292|    case 7:
  ------------------
  |  Branch (140:5): [True: 292, False: 3.69k]
  ------------------
  141|    292|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    292|                                                         out_values);
  143|    203|    case 8:
  ------------------
  |  Branch (143:5): [True: 203, False: 3.78k]
  ------------------
  144|    203|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    203|                                                         out_values);
  146|    124|    case 9:
  ------------------
  |  Branch (146:5): [True: 124, False: 3.86k]
  ------------------
  147|    124|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    124|                                                         out_values);
  149|    170|    case 10:
  ------------------
  |  Branch (149:5): [True: 170, False: 3.81k]
  ------------------
  150|    170|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    170|          num_values, src_buffer, out_values);
  152|    179|    case 11:
  ------------------
  |  Branch (152:5): [True: 179, False: 3.80k]
  ------------------
  153|    179|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    179|          num_values, src_buffer, out_values);
  155|    200|    case 12:
  ------------------
  |  Branch (155:5): [True: 200, False: 3.78k]
  ------------------
  156|    200|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    200|          num_values, src_buffer, out_values);
  158|    198|    case 13:
  ------------------
  |  Branch (158:5): [True: 198, False: 3.78k]
  ------------------
  159|    198|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    198|          num_values, src_buffer, out_values);
  161|    139|    case 14:
  ------------------
  |  Branch (161:5): [True: 139, False: 3.84k]
  ------------------
  162|    139|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    139|          num_values, src_buffer, out_values);
  164|    241|    case 15:
  ------------------
  |  Branch (164:5): [True: 241, False: 3.74k]
  ------------------
  165|    241|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    241|          num_values, src_buffer, out_values);
  167|    206|    case 16:
  ------------------
  |  Branch (167:5): [True: 206, False: 3.78k]
  ------------------
  168|    206|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    206|          num_values, src_buffer, out_values);
  170|    170|    case 17:
  ------------------
  |  Branch (170:5): [True: 170, False: 3.81k]
  ------------------
  171|    170|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    170|          num_values, src_buffer, out_values);
  173|    151|    case 18:
  ------------------
  |  Branch (173:5): [True: 151, False: 3.83k]
  ------------------
  174|    151|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    151|          num_values, src_buffer, out_values);
  176|    235|    default:
  ------------------
  |  Branch (176:5): [True: 235, False: 3.75k]
  ------------------
  177|    235|      return false;
  178|  3.98k|  }
  179|  3.98k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    432|                              uint32_t *out_values) {
   93|    432|  SymbolDecoderT decoder;
   94|    432|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 318, False: 114]
  ------------------
   95|    318|    return false;
   96|    318|  }
   97|       |
   98|    114|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 114, False: 0]
  |  Branch (98:25): [True: 28, False: 86]
  ------------------
   99|     28|    return false;  // Wrong number of symbols.
  100|     28|  }
  101|       |
  102|     86|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 19, False: 67]
  ------------------
  103|     19|    return false;
  104|     19|  }
  105|  4.06M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.06M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.06M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.06M|    out_values[i] = value;
  109|  4.06M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|     86|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    256|                              uint32_t *out_values) {
   93|    256|  SymbolDecoderT decoder;
   94|    256|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 103, False: 153]
  ------------------
   95|    103|    return false;
   96|    103|  }
   97|       |
   98|    153|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 153, False: 0]
  |  Branch (98:25): [True: 4, False: 149]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    149|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 74, False: 75]
  ------------------
  103|     74|    return false;
  104|     74|  }
  105|  2.21M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.21M, False: 75]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.21M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.21M|    out_values[i] = value;
  109|  2.21M|  }
  110|     75|  decoder.EndDecoding();
  111|     75|  return true;
  112|    149|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    254|                              uint32_t *out_values) {
   93|    254|  SymbolDecoderT decoder;
   94|    254|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 90, False: 164]
  ------------------
   95|     90|    return false;
   96|     90|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 1, False: 163]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    163|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 74, False: 89]
  ------------------
  103|     74|    return false;
  104|     74|  }
  105|  10.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.9M, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.9M|    out_values[i] = value;
  109|  10.9M|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    163|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    201|                              uint32_t *out_values) {
   93|    201|  SymbolDecoderT decoder;
   94|    201|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 116]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|    116|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 116, False: 0]
  |  Branch (98:25): [True: 3, False: 113]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    113|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 64]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|  14.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 14.8M, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  14.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  14.8M|    out_values[i] = value;
  109|  14.8M|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    113|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    112|                              uint32_t *out_values) {
   93|    112|  SymbolDecoderT decoder;
   94|    112|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 23, False: 89]
  ------------------
   95|     23|    return false;
   96|     23|  }
   97|       |
   98|     89|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 89, False: 0]
  |  Branch (98:25): [True: 31, False: 58]
  ------------------
   99|     31|    return false;  // Wrong number of symbols.
  100|     31|  }
  101|       |
  102|     58|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 52]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  8.89M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.89M, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.89M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.89M|    out_values[i] = value;
  109|  8.89M|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|     58|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    224|                              uint32_t *out_values) {
   93|    224|  SymbolDecoderT decoder;
   94|    224|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 61, False: 163]
  ------------------
   95|     61|    return false;
   96|     61|  }
   97|       |
   98|    163|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 163, False: 0]
  |  Branch (98:25): [True: 1, False: 162]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 44, False: 118]
  ------------------
  103|     44|    return false;
  104|     44|  }
  105|  26.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 26.2M, False: 118]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  26.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  26.2M|    out_values[i] = value;
  109|  26.2M|  }
  110|    118|  decoder.EndDecoding();
  111|    118|  return true;
  112|    162|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    292|                              uint32_t *out_values) {
   93|    292|  SymbolDecoderT decoder;
   94|    292|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 119, False: 173]
  ------------------
   95|    119|    return false;
   96|    119|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 7, False: 166]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    166|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 95]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|  24.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.4M, False: 95]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.4M|    out_values[i] = value;
  109|  24.4M|  }
  110|     95|  decoder.EndDecoding();
  111|     95|  return true;
  112|    166|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    203|                              uint32_t *out_values) {
   93|    203|  SymbolDecoderT decoder;
   94|    203|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 84, False: 119]
  ------------------
   95|     84|    return false;
   96|     84|  }
   97|       |
   98|    119|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 119, False: 0]
  |  Branch (98:25): [True: 0, False: 119]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    119|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 54, False: 65]
  ------------------
  103|     54|    return false;
  104|     54|  }
  105|  12.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.5M, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.5M|    out_values[i] = value;
  109|  12.5M|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|    119|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    124|                              uint32_t *out_values) {
   93|    124|  SymbolDecoderT decoder;
   94|    124|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 80, False: 44]
  ------------------
   95|     80|    return false;
   96|     80|  }
   97|       |
   98|     44|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 44, False: 0]
  |  Branch (98:25): [True: 0, False: 44]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     44|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 8, False: 36]
  ------------------
  103|      8|    return false;
  104|      8|  }
  105|   343k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 343k, False: 36]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   343k|    const uint32_t value = decoder.DecodeSymbol();
  108|   343k|    out_values[i] = value;
  109|   343k|  }
  110|     36|  decoder.EndDecoding();
  111|     36|  return true;
  112|     44|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    170|                              uint32_t *out_values) {
   93|    170|  SymbolDecoderT decoder;
   94|    170|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 82, False: 88]
  ------------------
   95|     82|    return false;
   96|     82|  }
   97|       |
   98|     88|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 88, False: 0]
  |  Branch (98:25): [True: 1, False: 87]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     87|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 37]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|   328k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 328k, False: 37]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   328k|    const uint32_t value = decoder.DecodeSymbol();
  108|   328k|    out_values[i] = value;
  109|   328k|  }
  110|     37|  decoder.EndDecoding();
  111|     37|  return true;
  112|     87|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    179|                              uint32_t *out_values) {
   93|    179|  SymbolDecoderT decoder;
   94|    179|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 78, False: 101]
  ------------------
   95|     78|    return false;
   96|     78|  }
   97|       |
   98|    101|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 101, False: 0]
  |  Branch (98:25): [True: 1, False: 100]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    100|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 45, False: 55]
  ------------------
  103|     45|    return false;
  104|     45|  }
  105|   166k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 166k, False: 55]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   166k|    const uint32_t value = decoder.DecodeSymbol();
  108|   166k|    out_values[i] = value;
  109|   166k|  }
  110|     55|  decoder.EndDecoding();
  111|     55|  return true;
  112|    100|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    200|                              uint32_t *out_values) {
   93|    200|  SymbolDecoderT decoder;
   94|    200|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 115]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|    115|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 115, False: 0]
  |  Branch (98:25): [True: 1, False: 114]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    114|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 63, False: 51]
  ------------------
  103|     63|    return false;
  104|     63|  }
  105|   274k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 274k, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   274k|    const uint32_t value = decoder.DecodeSymbol();
  108|   274k|    out_values[i] = value;
  109|   274k|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|    114|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    198|                              uint32_t *out_values) {
   93|    198|  SymbolDecoderT decoder;
   94|    198|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 95, False: 103]
  ------------------
   95|     95|    return false;
   96|     95|  }
   97|       |
   98|    103|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 103, False: 0]
  |  Branch (98:25): [True: 9, False: 94]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|     94|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 34, False: 60]
  ------------------
  103|     34|    return false;
  104|     34|  }
  105|   434k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 433k, False: 60]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   433k|    const uint32_t value = decoder.DecodeSymbol();
  108|   433k|    out_values[i] = value;
  109|   433k|  }
  110|     60|  decoder.EndDecoding();
  111|     60|  return true;
  112|     94|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    139|                              uint32_t *out_values) {
   93|    139|  SymbolDecoderT decoder;
   94|    139|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 52, False: 87]
  ------------------
   95|     52|    return false;
   96|     52|  }
   97|       |
   98|     87|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 87, False: 0]
  |  Branch (98:25): [True: 0, False: 87]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     87|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 29, False: 58]
  ------------------
  103|     29|    return false;
  104|     29|  }
  105|  6.57M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.57M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.57M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.57M|    out_values[i] = value;
  109|  6.57M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|     87|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    241|                              uint32_t *out_values) {
   93|    241|  SymbolDecoderT decoder;
   94|    241|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 115, False: 126]
  ------------------
   95|    115|    return false;
   96|    115|  }
   97|       |
   98|    126|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 126, False: 0]
  |  Branch (98:25): [True: 2, False: 124]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    124|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 63, False: 61]
  ------------------
  103|     63|    return false;
  104|     63|  }
  105|  7.97M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.97M, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.97M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.97M|    out_values[i] = value;
  109|  7.97M|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    124|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    206|                              uint32_t *out_values) {
   93|    206|  SymbolDecoderT decoder;
   94|    206|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 104, False: 102]
  ------------------
   95|    104|    return false;
   96|    104|  }
   97|       |
   98|    102|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 102, False: 0]
  |  Branch (98:25): [True: 0, False: 102]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    102|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 47, False: 55]
  ------------------
  103|     47|    return false;
  104|     47|  }
  105|  11.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.5M, False: 55]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.5M|    out_values[i] = value;
  109|  11.5M|  }
  110|     55|  decoder.EndDecoding();
  111|     55|  return true;
  112|    102|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    170|                              uint32_t *out_values) {
   93|    170|  SymbolDecoderT decoder;
   94|    170|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 61, False: 109]
  ------------------
   95|     61|    return false;
   96|     61|  }
   97|       |
   98|    109|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 109, False: 0]
  |  Branch (98:25): [True: 0, False: 109]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    109|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 59]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|  3.49M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.49M, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.49M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.49M|    out_values[i] = value;
  109|  3.49M|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    109|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    151|                              uint32_t *out_values) {
   93|    151|  SymbolDecoderT decoder;
   94|    151|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 43, False: 108]
  ------------------
   95|     43|    return false;
   96|     43|  }
   97|       |
   98|    108|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 108, False: 0]
  |  Branch (98:25): [True: 0, False: 108]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    108|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 58]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|  22.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 22.1M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  22.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  22.1M|    out_values[i] = value;
  109|  22.1M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    108|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.06k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.58k|  const CornerTable *GetCornerTable() const override {
   67|  2.58k|    return corner_table_.get();
   68|  2.58k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  16.9M|                       int *out_encoder_split_symbol_id) {
   87|  16.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 70.3k, False: 16.8M]
  ------------------
   88|  70.3k|      return false;
   89|  70.3k|    }
   90|  16.8M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 16.8M]
  ------------------
   91|  16.8M|        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|  16.8M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 16.8M, False: 1.87k]
  ------------------
  101|  16.8M|      return false;
  102|  16.8M|    }
  103|  1.87k|    *out_face_edge =
  104|  1.87k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.87k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.87k|    topology_split_data_.pop_back();
  108|  1.87k|    return true;
  109|  16.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  44.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  44.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  44.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  44.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  8.69k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.82k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.34k|  const CornerTable *GetCornerTable() const override {
   67|  4.34k|    return corner_table_.get();
   68|  4.34k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  34.8M|                       int *out_encoder_split_symbol_id) {
   87|  34.8M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 34.7M, False: 81.3k]
  ------------------
   88|  34.7M|      return false;
   89|  34.7M|    }
   90|  81.3k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 5, False: 81.3k]
  ------------------
   91|  81.3k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      5|      *out_encoder_split_symbol_id = -1;
   98|      5|      return true;
   99|      5|    }
  100|  81.3k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 79.9k, False: 1.46k]
  ------------------
  101|  79.9k|      return false;
  102|  79.9k|    }
  103|  1.46k|    *out_face_edge =
  104|  1.46k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.46k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.46k|    topology_split_data_.pop_back();
  108|  1.46k|    return true;
  109|  81.3k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   100M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   100M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   100M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   100M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  3.85k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  10.7k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.37k|  const CornerTable *GetCornerTable() const override {
   67|  2.37k|    return corner_table_.get();
   68|  2.37k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  68.4M|                       int *out_encoder_split_symbol_id) {
   87|  68.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 61.4M, False: 6.97M]
  ------------------
   88|  61.4M|      return false;
   89|  61.4M|    }
   90|  6.97M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 6.97M]
  ------------------
   91|  6.97M|        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|  6.97M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 6.97M, False: 1.42k]
  ------------------
  101|  6.97M|      return false;
  102|  6.97M|    }
  103|  1.42k|    *out_face_edge =
  104|  1.42k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.42k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.42k|    topology_split_data_.pop_back();
  108|  1.42k|    return true;
  109|  6.97M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  68.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  68.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  68.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  68.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  4.34k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   35|  6.29k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  5.83k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  5.83k|    decoder_impl_ = decoder;
   38|  5.83k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  5.83k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  5.83k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  5.83k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  5.13k|  uint16_t BitstreamVersion() const {
   45|  5.13k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  5.13k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.02k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  5.83k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.96k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  3.96k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 47, False: 3.91k]
  ------------------
   63|     47|      return false;
   64|     47|    }
   65|       |
   66|  3.91k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 53, False: 3.86k]
  ------------------
   67|     53|      return false;
   68|     53|    }
   69|       |
   70|  3.86k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 6, False: 3.85k]
  ------------------
   71|      6|      return false;
   72|      6|    }
   73|  3.85k|    *out_buffer = buffer_;
   74|  3.85k|    return true;
   75|  3.86k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  6.88M|  inline bool DecodeStartFaceConfiguration() {
   79|  6.88M|    uint32_t face_configuration;
   80|  6.88M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  6.88M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.88M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 777, False: 6.88M]
  ------------------
   82|    777|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    777|    } else
   85|  6.88M|#endif
   86|  6.88M|    {
   87|  6.88M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  6.88M|    }
   89|  6.88M|    return face_configuration;
   90|  6.88M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  31.9M|  inline uint32_t DecodeSymbol() {
   94|  31.9M|    uint32_t symbol;
   95|  31.9M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  31.9M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 13.7M, False: 18.2M]
  ------------------
   97|  13.7M|      return symbol;
   98|  13.7M|    }
   99|       |    // Else decode two additional bits.
  100|  18.2M|    uint32_t symbol_suffix;
  101|  18.2M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  18.2M|    symbol |= (symbol_suffix << 1);
  103|  18.2M|    return symbol;
  104|  31.9M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  31.4M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   999k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  23.6M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  23.6M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  23.6M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.04k|  void Done() {
  123|  4.04k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.56k, False: 479]
  ------------------
  124|  3.56k|      symbol_buffer_.EndBitDecoding();
  125|  3.56k|    }
  126|  4.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.04k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.04k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 535, False: 3.50k]
  ------------------
  128|    535|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    535|    } else
  131|  3.50k|#endif
  132|  3.50k|    {
  133|  3.50k|      start_face_decoder_.EndDecoding();
  134|  3.50k|    }
  135|  4.04k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.76k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.27k|  bool DecodeTraversalSymbols() {
  141|  4.27k|    uint64_t traversal_size;
  142|  4.27k|    symbol_buffer_ = buffer_;
  143|  4.27k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 9, False: 4.26k]
  ------------------
  144|      9|      return false;
  145|      9|    }
  146|  4.26k|    buffer_ = symbol_buffer_;
  147|  4.26k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 92, False: 4.17k]
  ------------------
  148|     92|      return false;
  149|     92|    }
  150|  4.17k|    buffer_.Advance(traversal_size);
  151|  4.17k|    return true;
  152|  4.26k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  5.73k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  5.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  5.73k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.73k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 863, False: 4.87k]
  ------------------
  158|    863|      start_face_buffer_ = buffer_;
  159|    863|      uint64_t traversal_size;
  160|    863|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 863]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    863|      buffer_ = start_face_buffer_;
  164|    863|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 91, False: 772]
  ------------------
  165|     91|        return false;
  166|     91|      }
  167|    772|      buffer_.Advance(traversal_size);
  168|    772|      return true;
  169|    863|    }
  170|  4.87k|#endif
  171|  4.87k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  5.73k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  5.63k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  5.63k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.17k, False: 1.46k]
  ------------------
  177|  4.17k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.17k|          new BinaryDecoder[num_attribute_data_]);
  179|  14.0k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 9.90k, False: 4.16k]
  ------------------
  180|  9.90k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 8, False: 9.89k]
  ------------------
  181|      8|          return false;
  182|      8|        }
  183|  9.90k|      }
  184|  4.17k|    }
  185|  5.62k|    return true;
  186|  5.63k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.37k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.07M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.07M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.07M, False: 3.65k]
  ------------------
   61|  3.07M|      return true;  // Already traversed.
   62|  3.07M|    }
   63|       |
   64|  3.65k|    corner_traversal_stack_.clear();
   65|  3.65k|    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|  3.65k|    const VertexIndex next_vert =
   69|  3.65k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.65k|    const VertexIndex prev_vert =
   71|  3.65k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.65k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.65k]
  |  Branch (72:45): [True: 0, False: 3.65k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.65k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.78k, False: 870]
  ------------------
   76|  2.78k|      this->MarkVertexVisited(next_vert);
   77|  2.78k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.78k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.78k|    }
   80|  3.65k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.09k, False: 560]
  ------------------
   81|  3.09k|      this->MarkVertexVisited(prev_vert);
   82|  3.09k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.09k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.09k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  27.8k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 24.1k, False: 3.65k]
  ------------------
   88|       |      // Currently processed corner.
   89|  24.1k|      corner_id = corner_traversal_stack_.back();
   90|  24.1k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  24.1k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 24.1k]
  |  Branch (92:47): [True: 841, False: 23.3k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    841|        corner_traversal_stack_.pop_back();
   95|    841|        continue;
   96|    841|      }
   97|  3.07M|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|  3.07M|        this->MarkFaceVisited(face_id);
   99|  3.07M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.07M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.07M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.07M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.07M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.55M, False: 1.52M]
  ------------------
  105|  1.55M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.55M|          this->MarkVertexVisited(vert_id);
  107|  1.55M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.55M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.52M, False: 34.0k]
  ------------------
  109|  1.52M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.52M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.52M|            continue;
  112|  1.52M|          }
  113|  1.55M|        }
  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.55M|        const CornerIndex right_corner_id =
  118|  1.55M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.55M|        const CornerIndex left_corner_id =
  120|  1.55M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.55M|        const FaceIndex right_face_id(
  122|  1.55M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 22.4k, False: 1.53M]
  ------------------
  123|  1.55M|                 ? kInvalidFaceIndex
  124|  1.55M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.55M|        const FaceIndex left_face_id(
  126|  1.55M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 14.0k, False: 1.54M]
  ------------------
  127|  1.55M|                 ? kInvalidFaceIndex
  128|  1.55M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.55M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.51M, False: 37.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.51M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 13.0k, False: 1.50M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  13.0k|            corner_traversal_stack_.pop_back();
  134|  13.0k|            break;  // Break from the while (true) loop.
  135|  1.50M|          } else {
  136|       |            // Go to the left face.
  137|  1.50M|            corner_id = left_corner_id;
  138|  1.50M|            face_id = left_face_id;
  139|  1.50M|          }
  140|  1.51M|        } else {
  141|       |          // Right face was not visited.
  142|  37.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 27.6k, False: 10.2k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  27.6k|            corner_id = right_corner_id;
  145|  27.6k|            face_id = right_face_id;
  146|  27.6k|          } 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|  10.2k|            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|  10.2k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  10.2k|            break;
  159|  10.2k|          }
  160|  37.9k|        }
  161|  1.55M|      }
  162|  23.3k|    }
  163|  3.65k|    return true;
  164|  3.65k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.37k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.82k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.73k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.58M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.58M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 831k, False: 2.75M]
  ------------------
   61|   831k|      return true;  // Already traversed.
   62|   831k|    }
   63|       |
   64|  2.75M|    corner_traversal_stack_.clear();
   65|  2.75M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.75M|    const VertexIndex next_vert =
   69|  2.75M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.75M|    const VertexIndex prev_vert =
   71|  2.75M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.75M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.75M]
  |  Branch (72:45): [True: 0, False: 2.75M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.75M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.75M, False: 1.20k]
  ------------------
   76|  2.75M|      this->MarkVertexVisited(next_vert);
   77|  2.75M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.75M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.75M|    }
   80|  2.75M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.75M, False: 1.12k]
  ------------------
   81|  2.75M|      this->MarkVertexVisited(prev_vert);
   82|  2.75M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.75M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.75M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.57M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.81M, False: 2.75M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.81M|      corner_id = corner_traversal_stack_.back();
   90|  2.81M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.81M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.81M]
  |  Branch (92:47): [True: 6.10k, False: 2.81M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  6.10k|        corner_traversal_stack_.pop_back();
   95|  6.10k|        continue;
   96|  6.10k|      }
   97|  3.58M|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|  3.58M|        this->MarkFaceVisited(face_id);
   99|  3.58M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.58M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.58M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.58M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.58M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.18M, False: 399k]
  ------------------
  105|  3.18M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.18M|          this->MarkVertexVisited(vert_id);
  107|  3.18M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.18M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 383k, False: 2.80M]
  ------------------
  109|   383k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   383k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   383k|            continue;
  112|   383k|          }
  113|  3.18M|        }
  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|  3.20M|        const CornerIndex right_corner_id =
  118|  3.20M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.20M|        const CornerIndex left_corner_id =
  120|  3.20M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.20M|        const FaceIndex right_face_id(
  122|  3.20M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.78M, False: 421k]
  ------------------
  123|  3.20M|                 ? kInvalidFaceIndex
  124|  3.20M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.20M|        const FaceIndex left_face_id(
  126|  3.20M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.77M, False: 426k]
  ------------------
  127|  3.20M|                 ? kInvalidFaceIndex
  128|  3.20M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.20M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.15M, False: 46.4k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.15M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.78M, False: 377k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.78M|            corner_traversal_stack_.pop_back();
  134|  2.78M|            break;  // Break from the while (true) loop.
  135|  2.78M|          } else {
  136|       |            // Go to the left face.
  137|   377k|            corner_id = left_corner_id;
  138|   377k|            face_id = left_face_id;
  139|   377k|          }
  140|  3.15M|        } else {
  141|       |          // Right face was not visited.
  142|  46.4k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 15.9k, False: 30.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  15.9k|            corner_id = right_corner_id;
  145|  15.9k|            face_id = right_face_id;
  146|  30.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|  30.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|  30.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  30.5k|            break;
  159|  30.5k|          }
  160|  46.4k|        }
  161|  3.20M|      }
  162|  2.81M|    }
  163|  2.75M|    return true;
  164|  2.75M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.73k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.50k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    600|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.36k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.36k|    const auto *corner_table = traverser_.corner_table();
   50|  1.36k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.36k|    const size_t num_faces = mesh_->num_faces();
   52|  1.36k|    const size_t num_points = mesh_->num_points();
   53|  3.75M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.75M, False: 1.36k]
  ------------------
   54|  3.75M|      const auto &face = mesh_->face(f);
   55|  15.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 11.2M, False: 3.75M]
  ------------------
   56|  11.2M|        const PointIndex point_id = face[p];
   57|  11.2M|        const VertexIndex vert_id =
   58|  11.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  11.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 11.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  11.2M|        const AttributeValueIndex att_entry_id(
   63|  11.2M|            encoding_data_
   64|  11.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  11.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 11.2M]
  |  Branch (65:13): [True: 0, False: 11.2M]
  |  Branch (65:39): [True: 0, False: 11.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  11.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  11.2M|      }
   71|  3.75M|    }
   72|  1.36k|    return true;
   73|  1.36k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    581|  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|    581|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    581|    traverser_.OnTraversalStart();
   82|    581|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 581]
  ------------------
   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|    581|    } else {
   89|    581|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.95M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.95M, False: 581]
  ------------------
   91|  1.95M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.95M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.95M|      }
   95|    581|    }
   96|    581|    traverser_.OnTraversalEnd();
   97|    581|    return true;
   98|    581|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.95M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.95M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.95M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    600|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.41k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  8.85k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  8.85k|    const auto *corner_table = traverser_.corner_table();
   50|  8.85k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  8.85k|    const size_t num_faces = mesh_->num_faces();
   52|  8.85k|    const size_t num_points = mesh_->num_points();
   53|  7.25M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.24M, False: 8.85k]
  ------------------
   54|  7.24M|      const auto &face = mesh_->face(f);
   55|  28.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.7M, False: 7.24M]
  ------------------
   56|  21.7M|        const PointIndex point_id = face[p];
   57|  21.7M|        const VertexIndex vert_id =
   58|  21.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.7M|        const AttributeValueIndex att_entry_id(
   63|  21.7M|            encoding_data_
   64|  21.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.7M]
  |  Branch (65:13): [True: 0, False: 21.7M]
  |  Branch (65:39): [True: 0, False: 21.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  21.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.7M|      }
   71|  7.24M|    }
   72|  8.85k|    return true;
   73|  8.85k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.37k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.37k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.37k|    traverser_.OnTraversalStart();
   82|  1.37k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.37k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.37k|    } else {
   89|  1.37k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.07M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.07M, False: 1.37k]
  ------------------
   91|  3.07M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.07M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.07M|      }
   95|  1.37k|    }
   96|  1.37k|    traverser_.OnTraversalEnd();
   97|  1.37k|    return true;
   98|  1.37k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.07M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.07M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.07M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.41k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.75k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  8.82k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  8.82k|    const auto *corner_table = traverser_.corner_table();
   50|  8.82k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  8.82k|    const size_t num_faces = mesh_->num_faces();
   52|  8.82k|    const size_t num_points = mesh_->num_points();
   53|  7.18M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.18M, False: 8.82k]
  ------------------
   54|  7.18M|      const auto &face = mesh_->face(f);
   55|  28.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.5M, False: 7.18M]
  ------------------
   56|  21.5M|        const PointIndex point_id = face[p];
   57|  21.5M|        const VertexIndex vert_id =
   58|  21.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.5M|        const AttributeValueIndex att_entry_id(
   63|  21.5M|            encoding_data_
   64|  21.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.5M]
  |  Branch (65:13): [True: 0, False: 21.5M]
  |  Branch (65:39): [True: 0, False: 21.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  21.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.5M|      }
   71|  7.18M|    }
   72|  8.82k|    return true;
   73|  8.82k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.73k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.73k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.73k|    traverser_.OnTraversalStart();
   82|  1.73k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.73k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.73k|    } else {
   89|  1.73k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.58M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.58M, False: 1.73k]
  ------------------
   91|  3.58M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.58M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.58M|      }
   95|  1.73k|    }
   96|  1.73k|    traverser_.OnTraversalEnd();
   97|  1.73k|    return true;
   98|  1.73k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.58M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.58M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.58M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.75k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.50k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  27.8M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  13.8M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  13.8M|    return is_vertex_visited_[vert_id.value()];
   65|  13.8M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.55M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.55M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.55M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.58M|  inline TraversalObserverT &traversal_observer() {
   75|  7.58M|    return traversal_observer_;
   76|  7.58M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  10.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  10.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 73.5k, False: 10.6M]
  ------------------
   47|  73.5k|      return true;  // Invalid faces are always considered as visited.
   48|  73.5k|    }
   49|  10.6M|    return is_face_visited_[face_id.value()];
   50|  10.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.03M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.03M|    is_face_visited_[face_id.value()] = true;
   62|  5.03M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.02k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.02k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.01k|                    TraversalObserver traversal_observer) {
   37|  2.01k|    corner_table_ = corner_table;
   38|  2.01k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.01k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.01k|    traversal_observer_ = traversal_observer;
   41|  2.01k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.07M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.07M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.07M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.07M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.07M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  30.1M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.58M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.58M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.58M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.58M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.58M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.09M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.09M|    return is_vertex_visited_[vert_id.value()];
   65|  9.09M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  8.69M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  8.69M|    is_vertex_visited_[vert_id.value()] = true;
   68|  8.69M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  12.2M|  inline TraversalObserverT &traversal_observer() {
   75|  12.2M|    return traversal_observer_;
   76|  12.2M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.22M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.22M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.55M, False: 3.66M]
  ------------------
   47|  5.55M|      return true;  // Invalid faces are always considered as visited.
   48|  5.55M|    }
   49|  3.66M|    return is_face_visited_[face_id.value()];
   50|  9.22M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.58M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.58M|    is_face_visited_[face_id.value()] = true;
   62|  3.58M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.50k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.75k|                    TraversalObserver traversal_observer) {
   37|  1.75k|    corner_table_ = corner_table;
   38|  1.75k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.75k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.75k|    traversal_observer_ = traversal_observer;
   41|  1.75k|  }

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  54.1M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  54.1M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 54.1M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  54.1M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  54.1M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   516M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   516M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 256, False: 516M]
  ------------------
   78|    256|      return false;  // Buffer overflow.
   79|    256|    }
   80|   516M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   516M|    pos_ += size_to_decode;
   82|   516M|    return true;
   83|   516M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  27.3k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  8.01k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  40.6k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   308k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.83k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  54.1M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  6.94M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  7.64k|    inline void reset(const void *b, size_t s) {
  131|  7.64k|      bit_offset_ = 0;
  132|  7.64k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  7.64k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  7.64k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  6.61k|    inline uint64_t BitsDecoded() const {
  138|  6.61k|      return static_cast<uint64_t>(bit_offset_);
  139|  6.61k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  54.1M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  54.1M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 3, False: 54.1M]
  ------------------
  162|      3|        return false;
  163|      3|      }
  164|  54.1M|      uint32_t value = 0;
  165|   123M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 68.9M, False: 54.1M]
  ------------------
  166|  68.9M|        value |= GetBit() << bit;
  167|  68.9M|      }
  168|  54.1M|      *x = value;
  169|  54.1M|      return true;
  170|  54.1M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  68.9M|    inline int GetBit() {
  176|  68.9M|      const size_t off = bit_offset_;
  177|  68.9M|      const size_t byte_offset = off >> 3;
  178|  68.9M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  68.9M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 60.4M, False: 8.49M]
  ------------------
  180|  60.4M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  60.4M|        bit_offset_ = off + 1;
  182|  60.4M|        return bit;
  183|  60.4M|      }
  184|  8.49M|      return 0;
  185|  68.9M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  15.9M|  bool Decode(T *out_val) {
   69|  15.9M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.73k, False: 15.9M]
  ------------------
   70|  1.73k|      return false;
   71|  1.73k|    }
   72|  15.9M|    pos_ += sizeof(T);
   73|  15.9M|    return true;
   74|  15.9M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  15.9M|  bool Peek(T *out_val) {
   88|  15.9M|    const size_t size_to_decode = sizeof(T);
   89|  15.9M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.73k, False: 15.9M]
  ------------------
   90|  1.73k|      return false;  // Buffer overflow.
   91|  1.73k|    }
   92|  15.9M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.9M|    return true;
   94|  15.9M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  13.0k|  bool Decode(T *out_val) {
   69|  13.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 78, False: 12.9k]
  ------------------
   70|     78|      return false;
   71|     78|    }
   72|  12.9k|    pos_ += sizeof(T);
   73|  12.9k|    return true;
   74|  13.0k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  13.0k|  bool Peek(T *out_val) {
   88|  13.0k|    const size_t size_to_decode = sizeof(T);
   89|  13.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 78, False: 12.9k]
  ------------------
   90|     78|      return false;  // Buffer overflow.
   91|     78|    }
   92|  12.9k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.9k|    return true;
   94|  13.0k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   507k|  bool Decode(T *out_val) {
   69|   507k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 95, False: 507k]
  ------------------
   70|     95|      return false;
   71|     95|    }
   72|   507k|    pos_ += sizeof(T);
   73|   507k|    return true;
   74|   507k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   507k|  bool Peek(T *out_val) {
   88|   507k|    const size_t size_to_decode = sizeof(T);
   89|   507k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 95, False: 507k]
  ------------------
   90|     95|      return false;  // Buffer overflow.
   91|     95|    }
   92|   507k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   507k|    return true;
   94|   507k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  24.7k|  bool Decode(T *out_val) {
   69|  24.7k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 54, False: 24.6k]
  ------------------
   70|     54|      return false;
   71|     54|    }
   72|  24.6k|    pos_ += sizeof(T);
   73|  24.6k|    return true;
   74|  24.7k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  24.7k|  bool Peek(T *out_val) {
   88|  24.7k|    const size_t size_to_decode = sizeof(T);
   89|  24.7k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 54, False: 24.6k]
  ------------------
   90|     54|      return false;  // Buffer overflow.
   91|     54|    }
   92|  24.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  24.6k|    return true;
   94|  24.7k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   708k|  bool Decode(T *out_val) {
   69|   708k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 111, False: 707k]
  ------------------
   70|    111|      return false;
   71|    111|    }
   72|   707k|    pos_ += sizeof(T);
   73|   707k|    return true;
   74|   708k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   708k|  bool Peek(T *out_val) {
   88|   708k|    const size_t size_to_decode = sizeof(T);
   89|   708k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 111, False: 707k]
  ------------------
   90|    111|      return false;  // Buffer overflow.
   91|    111|    }
   92|   707k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   707k|    return true;
   94|   708k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   226k|  bool Decode(T *out_val) {
   69|   226k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 226k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|   226k|    pos_ += sizeof(T);
   73|   226k|    return true;
   74|   226k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   226k|  bool Peek(T *out_val) {
   88|   226k|    const size_t size_to_decode = sizeof(T);
   89|   226k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 12, False: 226k]
  ------------------
   90|     12|      return false;  // Buffer overflow.
   91|     12|    }
   92|   226k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   226k|    return true;
   94|   226k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.09k|  bool Decode(T *out_val) {
   69|  2.09k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 2.09k]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|  2.09k|    pos_ += sizeof(T);
   73|  2.09k|    return true;
   74|  2.09k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.09k|  bool Peek(T *out_val) {
   88|  2.09k|    const size_t size_to_decode = sizeof(T);
   89|  2.09k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 2.09k]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|  2.09k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.09k|    return true;
   94|  2.09k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    129|  bool Decode(T *out_val) {
   69|    129|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 16, False: 113]
  ------------------
   70|     16|      return false;
   71|     16|    }
   72|    113|    pos_ += sizeof(T);
   73|    113|    return true;
   74|    129|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    129|  bool Peek(T *out_val) {
   88|    129|    const size_t size_to_decode = sizeof(T);
   89|    129|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 16, False: 113]
  ------------------
   90|     16|      return false;  // Buffer overflow.
   91|     16|    }
   92|    113|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    113|    return true;
   94|    129|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   72|   120M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   72|   131M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   97|  10.1M|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|  10.1M|    return value_ >= val;
   99|  10.1M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   72|   317M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   72|  4.02G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   89|  28.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  150|   121M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   121M|    value_ = i.value_;
  152|   121M|    return *this;
  153|   121M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  150|   353M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   353M|    value_ = i.value_;
  152|   353M|    return *this;
  153|   353M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  101|  28.3M|  inline ThisIndexType &operator++() {
  102|  28.3M|    ++value_;
  103|  28.3M|    return *this;
  104|  28.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   74|  2.93G|  constexpr bool operator==(const IndexType &i) const {
   75|  2.93G|    return value_ == i.value_;
   76|  2.93G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   72|  1.18G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   86|  4.03k|  constexpr bool operator<(const IndexType &i) const {
   87|  4.03k|    return value_ < i.value_;
   88|  4.03k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   74|   159M|  constexpr bool operator==(const IndexType &i) const {
   75|   159M|    return value_ == i.value_;
   76|   159M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  130|   217M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  131|   217M|    return ThisIndexType(value_ - val);
  132|   217M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  124|   919M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|   919M|    return ThisIndexType(value_ + val);
  126|   919M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   74|  19.9M|  constexpr bool operator==(const IndexType &i) const {
   75|  19.9M|    return value_ == i.value_;
   76|  19.9M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   80|   327M|  constexpr bool operator!=(const IndexType &i) const {
   81|   327M|    return value_ != i.value_;
   82|   327M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   80|   431M|  constexpr bool operator!=(const IndexType &i) const {
   81|   431M|    return value_ != i.value_;
   82|   431M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  101|   629M|  inline ThisIndexType &operator++() {
  102|   629M|    ++value_;
  103|   629M|    return *this;
  104|   629M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  150|   563M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   563M|    value_ = i.value_;
  152|   563M|    return *this;
  153|   563M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  150|  1.39G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  1.39G|    value_ = i.value_;
  152|  1.39G|    return *this;
  153|  1.39G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   97|  54.5M|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|  54.5M|    return value_ >= val;
   99|  54.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   89|  10.2M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   70|  1.39G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   70|   239M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   348M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  124|  17.6M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|  17.6M|    return ThisIndexType(value_ + val);
  126|  17.6M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   70|   210M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   86|  30.2M|  constexpr bool operator<(const IndexType &i) const {
   87|  30.2M|    return value_ < i.value_;
   88|  30.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   354M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   70|  99.5M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  150|  5.78M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  5.78M|    value_ = i.value_;
  152|  5.78M|    return *this;
  153|  5.78M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  138|  10.2M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  139|  10.2M|    value_ += val;
  140|  10.2M|    return *this;
  141|  10.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  154|  31.3M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  155|  31.3M|    value_ = val;
  156|  31.3M|    return *this;
  157|  31.3M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   70|   323M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   89|  9.03M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  101|  9.02M|  inline ThisIndexType &operator++() {
  102|  9.02M|    ++value_;
  103|  9.02M|    return *this;
  104|  9.02M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   89|  30.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  101|  30.5M|  inline ThisIndexType &operator++() {
  102|  30.5M|    ++value_;
  103|  30.5M|    return *this;
  104|  30.5M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  46.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  46.4M|    return vector_[index.value()];
   75|  46.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  30.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  24.1k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  85.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  85.1M|    return vector_[index.value()];
   72|  85.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   296k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  20.3M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.04k|  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|  10.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  10.1M|    return vector_[index.value()];
   72|  10.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  29.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  29.4M|    return vector_[index.value()];
   75|  29.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   272M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.8M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   387M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   387M|    return vector_[index.value()];
   75|   387M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.06G|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.06G|    return vector_[index.value()];
   75|  1.06G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   513M|  inline reference operator[](const IndexTypeT &index) {
   71|   513M|    return vector_[index.value()];
   72|   513M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  68.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  68.3M|    return vector_[index.value()];
   75|  68.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   427M|  inline reference operator[](const IndexTypeT &index) {
   71|   427M|    return vector_[index.value()];
   72|   427M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   137M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   298M|  inline reference operator[](const IndexTypeT &index) {
   71|   298M|    return vector_[index.value()];
   72|   298M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.33k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   275M|  inline reference operator[](const IndexTypeT &index) {
   71|   275M|    return vector_[index.value()];
   72|   275M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  41.8k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.95M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  38.6k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  6.22k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  6.22k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  6.22k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  6.22k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  6.22k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  6.22k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  6.22k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  8.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|   463k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|   494k|int32_t DataTypeLength(DataType dt) {
   20|   494k|  switch (dt) {
   21|   452k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 452k, False: 41.4k]
  ------------------
   22|   455k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.30k, False: 490k]
  ------------------
   23|   455k|      return 1;
   24|  1.40k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.40k, False: 492k]
  ------------------
   25|  1.83k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 431, False: 493k]
  ------------------
   26|  1.83k|      return 2;
   27|  31.4k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 31.4k, False: 462k]
  ------------------
   28|  31.8k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 392, False: 493k]
  ------------------
   29|  31.8k|      return 4;
   30|    293|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 293, False: 493k]
  ------------------
   31|    708|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 415, False: 493k]
  ------------------
   32|    708|      return 8;
   33|  3.44k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.44k, False: 490k]
  ------------------
   34|  3.44k|      return 4;
   35|    206|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 206, False: 493k]
  ------------------
   36|    206|      return 8;
   37|    119|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 119, False: 493k]
  ------------------
   38|    119|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 494k]
  ------------------
   40|      0|      return -1;
   41|   494k|  }
   42|   494k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|  1.21M|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  1.21M|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|  1.21M|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 603, False: 1.21M]
  ------------------
   66|    603|      return false;
   67|    603|    }
   68|  1.21M|  } 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|  1.21M|  return true;
   77|  1.21M|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   869k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   869k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   869k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 116, False: 869k]
  ------------------
   33|    116|    return false;
   34|    116|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   869k|  uint8_t in;
   39|   869k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 360, False: 869k]
  ------------------
   40|    360|    return false;
   41|    360|  }
   42|   869k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 22.2k, False: 846k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  22.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 612, False: 21.6k]
  ------------------
   45|    612|      return false;
   46|    612|    }
   47|       |    // Append decoded info from this byte.
   48|  21.6k|    *out_val <<= 7;
   49|  21.6k|    *out_val |= in & ((1 << 7) - 1);
   50|   846k|  } else {
   51|       |    // Last byte reached
   52|   846k|    *out_val = in;
   53|   846k|  }
   54|   868k|  return true;
   55|   869k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.45k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.45k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.45k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.45k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.45k|  uint8_t in;
   39|  3.45k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 3.45k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  3.45k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 289, False: 3.16k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    289|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 286]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|    286|    *out_val <<= 7;
   49|    286|    *out_val |= in & ((1 << 7) - 1);
   50|  3.16k|  } else {
   51|       |    // Last byte reached
   52|  3.16k|    *out_val = in;
   53|  3.16k|  }
   54|  3.44k|  return true;
   55|  3.45k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  5.62k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.62k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|  5.62k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 86, False: 5.54k]
  ------------------
   66|     86|      return false;
   67|     86|    }
   68|  5.62k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  5.54k|  return true;
   77|  5.62k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.43k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.43k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.43k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.43k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.43k|  uint8_t in;
   39|  3.43k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 9, False: 3.42k]
  ------------------
   40|      9|    return false;
   41|      9|  }
   42|  3.42k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 102, False: 3.32k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    102|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 102]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    102|    *out_val <<= 7;
   49|    102|    *out_val |= in & ((1 << 7) - 1);
   50|  3.32k|  } else {
   51|       |    // Last byte reached
   52|  3.32k|    *out_val = in;
   53|  3.32k|  }
   54|  3.42k|  return true;
   55|  3.42k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   330k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   330k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   330k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 330k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   330k|  uint8_t in;
   39|   330k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 61, False: 330k]
  ------------------
   40|     61|    return false;
   41|     61|  }
   42|   330k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.21k, False: 329k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.21k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 45, False: 1.17k]
  ------------------
   45|     45|      return false;
   46|     45|    }
   47|       |    // Append decoded info from this byte.
   48|  1.17k|    *out_val <<= 7;
   49|  1.17k|    *out_val |= in & ((1 << 7) - 1);
   50|   329k|  } else {
   51|       |    // Last byte reached
   52|   329k|    *out_val = in;
   53|   329k|  }
   54|   330k|  return true;
   55|   330k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.85k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.85k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.85k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 3.85k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.85k|  uint8_t in;
   39|  3.85k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 3.84k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  3.84k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 779, False: 3.06k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    779|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 18, False: 761]
  ------------------
   45|     18|      return false;
   46|     18|    }
   47|       |    // Append decoded info from this byte.
   48|    761|    *out_val <<= 7;
   49|    761|    *out_val |= in & ((1 << 7) - 1);
   50|  3.06k|  } else {
   51|       |    // Last byte reached
   52|  3.06k|    *out_val = in;
   53|  3.06k|  }
   54|  3.82k|  return true;
   55|  3.84k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  19.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  19.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  19.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 19.1k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  19.1k|  uint8_t in;
   39|  19.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 19.1k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  19.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 262, False: 18.8k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    262|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 6, False: 256]
  ------------------
   45|      6|      return false;
   46|      6|    }
   47|       |    // Append decoded info from this byte.
   48|    256|    *out_val <<= 7;
   49|    256|    *out_val |= in & ((1 << 7) - 1);
   50|  18.8k|  } else {
   51|       |    // Last byte reached
   52|  18.8k|    *out_val = in;
   53|  18.8k|  }
   54|  19.1k|  return true;
   55|  19.1k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.98k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.98k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.98k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 20, False: 4.96k]
  ------------------
   33|     20|    return false;
   34|     20|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.96k|  uint8_t in;
   39|  4.96k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 11, False: 4.95k]
  ------------------
   40|     11|    return false;
   41|     11|  }
   42|  4.95k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 3.95k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.00k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 109, False: 895]
  ------------------
   45|    109|      return false;
   46|    109|    }
   47|       |    // Append decoded info from this byte.
   48|    895|    *out_val <<= 7;
   49|    895|    *out_val |= in & ((1 << 7) - 1);
   50|  3.95k|  } else {
   51|       |    // Last byte reached
   52|  3.95k|    *out_val = in;
   53|  3.95k|  }
   54|  4.84k|  return true;
   55|  4.95k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.68k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.68k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.68k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 64, False: 4.62k]
  ------------------
   33|     64|    return false;
   34|     64|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.62k|  uint8_t in;
   39|  4.62k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 4.60k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  4.60k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.39k, False: 2.21k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.39k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 667, False: 1.72k]
  ------------------
   45|    667|      return false;
   46|    667|    }
   47|       |    // Append decoded info from this byte.
   48|  1.72k|    *out_val <<= 7;
   49|  1.72k|    *out_val |= in & ((1 << 7) - 1);
   50|  2.21k|  } else {
   51|       |    // Last byte reached
   52|  2.21k|    *out_val = in;
   53|  2.21k|  }
   54|  3.94k|  return true;
   55|  4.60k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.56k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.56k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.56k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 8.56k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.56k|  uint8_t in;
   39|  8.56k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 8.56k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  8.56k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 104, False: 8.45k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    104|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 84]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|     84|    *out_val <<= 7;
   49|     84|    *out_val |= in & ((1 << 7) - 1);
   50|  8.45k|  } else {
   51|       |    // Last byte reached
   52|  8.45k|    *out_val = in;
   53|  8.45k|  }
   54|  8.54k|  return true;
   55|  8.56k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   113k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   135k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  11.3k|  Self operator-(const Self &o) const {
  138|  11.3k|    Self ret;
  139|  45.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 33.9k, False: 11.3k]
  ------------------
  140|  33.9k|      ret[i] = (*this)[i] - o[i];
  141|  33.9k|    }
  142|  11.3k|    return ret;
  143|  11.3k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  27.8k|  VectorD() {
   41|   111k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 83.4k, False: 27.8k]
  ------------------
   42|  83.4k|      (*this)[i] = Scalar(0);
   43|  83.4k|    }
   44|  27.8k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   158M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  13.1M|  Self operator-(const Self &o) const {
  138|  13.1M|    Self ret;
  139|  52.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 39.4M, False: 13.1M]
  ------------------
  140|  39.4M|      ret[i] = (*this)[i] - o[i];
  141|  39.4M|    }
  142|  13.1M|    return ret;
  143|  13.1M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  6.56M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  6.56M|  static_assert(std::is_signed<ScalarT>::value,
  321|  6.56M|                "ScalarT must be a signed type. ");
  322|  6.56M|  VectorD<ScalarT, 3> r;
  323|  6.56M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  6.56M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  6.56M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  6.56M|  return r;
  327|  6.56M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  6.56M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  6.56M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.66M|  Scalar AbsSum() const {
  238|  2.66M|    Scalar result(0);
  239|  10.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 7.98M, False: 2.65M]
  ------------------
  240|  7.98M|      Scalar next_value = std::abs(v_[i]);
  241|  7.98M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 12.5k, False: 7.97M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  12.5k|        return std::numeric_limits<Scalar>::max();
  244|  12.5k|      }
  245|  7.97M|      result += next_value;
  246|  7.97M|    }
  247|  2.65M|    return result;
  248|  2.66M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   221k|  Self operator/(const Scalar &o) const {
  183|   221k|    Self ret;
  184|   884k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 663k, False: 221k]
  ------------------
  185|   663k|      ret[i] = (*this)[i] / o;
  186|   663k|    }
  187|   221k|    return ret;
  188|   221k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   198M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  10.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  7.99M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.69M|  Self operator-() const {
  121|  1.69M|    Self ret;
  122|  6.78M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 5.08M, False: 1.69M]
  ------------------
  123|  5.08M|      ret[i] = -(*this)[i];
  124|  5.08M|    }
  125|  1.69M|    return ret;
  126|  1.69M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  5.08M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.26M|  Self operator-(const Self &o) const {
  138|  1.26M|    Self ret;
  139|  3.79M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.52M, False: 1.26M]
  ------------------
  140|  2.52M|      ret[i] = (*this)[i] - o[i];
  141|  2.52M|    }
  142|  1.26M|    return ret;
  143|  1.26M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  15.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  22.7M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  44.4M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.52M|  Self operator+(const Self &o) const {
  130|  2.52M|    Self ret;
  131|  7.58M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.05M, False: 2.52M]
  ------------------
  132|  5.05M|      ret[i] = (*this)[i] + o[i];
  133|  5.05M|    }
  134|  2.52M|    return ret;
  135|  2.52M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  42.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.10M|  Self operator-(const Self &o) const {
  138|  1.10M|    Self ret;
  139|  3.32M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.21M, False: 1.10M]
  ------------------
  140|  2.21M|      ret[i] = (*this)[i] - o[i];
  141|  2.21M|    }
  142|  1.10M|    return ret;
  143|  1.10M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.10M|  Self operator+(const Self &o) const {
  130|  1.10M|    Self ret;
  131|  3.32M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.21M, False: 1.10M]
  ------------------
  132|  2.21M|      ret[i] = (*this)[i] + o[i];
  133|  2.21M|    }
  134|  1.10M|    return ret;
  135|  1.10M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   391k|  bool operator==(const Self &o) const {
  207|  1.16M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 778k, False: 385k]
  ------------------
  208|   778k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 5.16k, False: 772k]
  ------------------
  209|  5.16k|        return false;
  210|  5.16k|      }
  211|   778k|    }
  212|   385k|    return true;
  213|   391k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.69M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  6.15k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  7.15k|  Scalar Dot(const Self &o) const {
  251|  7.15k|    Scalar ret(0);
  252|  28.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 21.4k, False: 7.15k]
  ------------------
  253|  21.4k|      ret += (*this)[i] * o[i];
  254|  21.4k|    }
  255|  7.15k|    return ret;
  256|  7.15k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    994|  Self operator*(const Scalar &o) const {
  175|    994|    Self ret;
  176|  3.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 2.98k, False: 994]
  ------------------
  177|  2.98k|      ret[i] = (*this)[i] * o;
  178|  2.98k|    }
  179|    994|    return ret;
  180|    994|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  5.16k|  Self operator-(const Self &o) const {
  138|  5.16k|    Self ret;
  139|  15.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 10.3k, False: 5.16k]
  ------------------
  140|  10.3k|      ret[i] = (*this)[i] - o[i];
  141|  10.3k|    }
  142|  5.16k|    return ret;
  143|  5.16k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  10.3k|  VectorD() {
   41|  30.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 20.6k, False: 10.3k]
  ------------------
   42|  20.6k|      (*this)[i] = Scalar(0);
   43|  20.6k|    }
   44|  10.3k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   787k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   787k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   787k|    v_[0] = c0;
   55|   787k|    v_[1] = c1;
   56|   787k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  41.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   366k|  bool operator==(const Self &o) const {
  207|  1.08M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 727k, False: 359k]
  ------------------
  208|   727k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.61k, False: 720k]
  ------------------
  209|  6.61k|        return false;
  210|  6.61k|      }
  211|   727k|    }
  212|   359k|    return true;
  213|   366k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.25M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  38.4M|  VectorD() {
   41|   153M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 115M, False: 38.4M]
  ------------------
   42|   115M|      (*this)[i] = Scalar(0);
   43|   115M|    }
   44|  38.4M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  9.76k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  13.0k|  Scalar Dot(const Self &o) const {
  251|  13.0k|    Scalar ret(0);
  252|  52.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 39.2k, False: 13.0k]
  ------------------
  253|  39.2k|      ret += (*this)[i] * o[i];
  254|  39.2k|    }
  255|  13.0k|    return ret;
  256|  13.0k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.31k|  Self operator-(const Self &o) const {
  138|  3.31k|    Self ret;
  139|  9.95k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.63k, False: 3.31k]
  ------------------
  140|  6.63k|      ret[i] = (*this)[i] - o[i];
  141|  6.63k|    }
  142|  3.31k|    return ret;
  143|  3.31k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  9.60k|  Self operator*(const Scalar &o) const {
  175|  9.60k|    Self ret;
  176|  28.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 19.2k, False: 9.60k]
  ------------------
  177|  19.2k|      ret[i] = (*this)[i] * o;
  178|  19.2k|    }
  179|  9.60k|    return ret;
  180|  9.60k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.22k|  Self operator+(const Self &o) const {
  130|  3.22k|    Self ret;
  131|  9.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.44k, False: 3.22k]
  ------------------
  132|  6.44k|      ret[i] = (*this)[i] + o[i];
  133|  6.44k|    }
  134|  3.22k|    return ret;
  135|  3.22k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.22k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.22k|  return v * o;
  294|  3.22k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.15k|  Self operator+(const Self &o) const {
  130|  3.15k|    Self ret;
  131|  12.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 9.46k, False: 3.15k]
  ------------------
  132|  9.46k|      ret[i] = (*this)[i] + o[i];
  133|  9.46k|    }
  134|  3.15k|    return ret;
  135|  3.15k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.15k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.15k|  return v * o;
  294|  3.15k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.15k|  Self operator*(const Scalar &o) const {
  175|  3.15k|    Self ret;
  176|  12.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 9.46k, False: 3.15k]
  ------------------
  177|  9.46k|      ret[i] = (*this)[i] * o;
  178|  9.46k|    }
  179|  3.15k|    return ret;
  180|  3.15k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   736k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   736k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   736k|    v_[0] = c0;
   55|   736k|    v_[1] = c1;
   56|   736k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  22.4k|  VectorD() {
   41|  67.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 44.8k, False: 22.4k]
  ------------------
   42|  44.8k|      (*this)[i] = Scalar(0);
   43|  44.8k|    }
   44|  22.4k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.30k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  18.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 12.6k, False: 6.30k]
  ------------------
  104|  12.6k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 12.6k, False: 0]
  ------------------
  105|  12.6k|        v_[i] = Scalar(src_vector[i]);
  106|  12.6k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  12.6k|    }
  110|  6.30k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.02k|  Self operator+(const Self &o) const {
  130|  1.02k|    Self ret;
  131|  3.08k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.05k, False: 1.02k]
  ------------------
  132|  2.05k|      ret[i] = (*this)[i] + o[i];
  133|  2.05k|    }
  134|  1.02k|    return ret;
  135|  1.02k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.15k|  VectorD() {
   41|  9.46k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.30k, False: 3.15k]
  ------------------
   42|  6.30k|      (*this)[i] = Scalar(0);
   43|  6.30k|    }
   44|  3.15k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  18.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  12.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.15k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.46k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.30k, False: 3.15k]
  ------------------
  104|  6.30k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.30k, False: 0]
  ------------------
  105|  6.30k|        v_[i] = Scalar(src_vector[i]);
  106|  6.30k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.30k|    }
  110|  3.15k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.15k|  Self operator/(const Scalar &o) const {
  183|  3.15k|    Self ret;
  184|  9.46k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.30k, False: 3.15k]
  ------------------
  185|  6.30k|      ret[i] = (*this)[i] / o;
  186|  6.30k|    }
  187|  3.15k|    return ret;
  188|  3.15k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.12k|  Self operator-(const Self &o) const {
  138|  2.12k|    Self ret;
  139|  6.38k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.25k, False: 2.12k]
  ------------------
  140|  4.25k|      ret[i] = (*this)[i] - o[i];
  141|  4.25k|    }
  142|  2.12k|    return ret;
  143|  2.12k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  89.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.69M|  VectorD() {
   41|  6.78M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.09M, False: 1.69M]
  ------------------
   42|  5.09M|      (*this)[i] = Scalar(0);
   43|  5.09M|    }
   44|  1.69M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  9.23M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  9.23M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  9.23M|    v_[0] = c0;
   55|  9.23M|    v_[1] = c1;
   56|  9.23M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  7.58M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  22.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 15.1M, False: 7.58M]
  ------------------
  104|  15.1M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 15.1M, False: 0]
  ------------------
  105|  15.1M|        v_[i] = Scalar(src_vector[i]);
  106|  15.1M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  15.1M|    }
  110|  7.58M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.79M|  VectorD() {
   41|  11.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.58M, False: 3.79M]
  ------------------
   42|  7.58M|      (*this)[i] = Scalar(0);
   43|  7.58M|    }
   44|  3.79M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.79M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.58M, False: 3.79M]
  ------------------
  104|  7.58M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.58M, False: 0]
  ------------------
  105|  7.58M|        v_[i] = Scalar(src_vector[i]);
  106|  7.58M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.58M|    }
  110|  3.79M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  5.60M|  VectorD(const Self &o) {
   89|  16.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 11.2M, False: 5.60M]
  ------------------
   90|  11.2M|      (*this)[i] = o[i];
   91|  11.2M|    }
   92|  5.60M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.21M|  VectorD() {
   41|  6.64M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.42M, False: 2.21M]
  ------------------
   42|  4.42M|      (*this)[i] = Scalar(0);
   43|  4.42M|    }
   44|  2.21M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   134M|  inline int num_vertices() const {
   74|   134M|    return static_cast<int>(vertex_corners_.size());
   75|   134M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  10.2M|  inline int num_corners() const {
   77|  10.2M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  10.2M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.56M|  inline int num_faces() const {
   80|  2.56M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.56M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   387M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   387M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 387M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   387M|    return opposite_corners_[corner];
   88|   387M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   643M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   643M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 14.4M, False: 629M]
  ------------------
   91|  14.4M|      return corner;
   92|  14.4M|    }
   93|   629M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 572M, False: 57.1M]
  ------------------
   94|   643M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   572M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   572M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 6.35M, False: 565M]
  ------------------
   97|  6.35M|      return corner;
   98|  6.35M|    }
   99|   565M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 159M, False: 405M]
  ------------------
  100|   572M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.06G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.06G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.06G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.06G|    return ConfidentVertex(corner);
  106|  1.06G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.06G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.06G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.06G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.06G|    return corner_to_vertex_map_[corner];
  111|  1.06G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  40.4M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  40.4M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 40.4M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  40.4M|    return FaceIndex(corner.value() / 3);
  117|  40.4M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.19G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  68.3M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  68.3M|    return vertex_corners_[v];
  152|  68.3M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.55M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.55M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.55M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 34.0k, False: 1.52M]
  ------------------
  188|  34.0k|      return true;
  189|  34.0k|    }
  190|  1.52M|    return false;
  191|  1.55M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  90.8M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  90.8M|    return Previous(Opposite(Previous(corner)));
  202|  90.8M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  9.56M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  9.56M|    return Next(Opposite(Next(corner)));
  207|  9.56M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.51M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.51M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.51M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.51M|    return Opposite(Previous(corner_id));
  222|  3.51M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  5.03M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  5.03M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 5.03M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  5.03M|    return Opposite(Next(corner_id));
  228|  5.03M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   427M|                                CornerIndex opp_corner_id) {
  249|   427M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   427M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   427M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   513M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   513M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   513M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   513M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   137M|  VertexIndex AddNewVertex() {
  271|   137M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   137M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   137M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   137M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   297M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   297M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   297M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 297M, False: 0]
  ------------------
  295|   297M|      vertex_corners_[vert] = corner;
  296|   297M|    }
  297|   297M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.09M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.09M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.09M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.09M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  231|  3.83k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.48M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  44.5k|  VertexCornersIterator &operator++() {
  268|  44.5k|    Next();
  269|  44.5k|    return *this;
  270|  44.5k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.83M|  void Next() {
  248|  3.83M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.78M, False: 52.9k]
  ------------------
  249|  3.78M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.78M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 19.4k, False: 3.76M]
  ------------------
  251|       |        // Open boundary reached.
  252|  19.4k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  19.4k|        left_traversal_ = false;
  254|  3.76M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 626k, False: 3.13M]
  ------------------
  255|       |        // End reached.
  256|   626k|        corner_ = kInvalidCornerIndex;
  257|   626k|      }
  258|  3.78M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  52.9k|      corner_ = corner_table_->SwingRight(corner_);
  262|  52.9k|    }
  263|  3.83M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  7.62M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  4.79M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.55M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.77M|  void Next() {
  248|  2.77M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.75M, False: 23.4k]
  ------------------
  249|  2.75M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.75M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.87M, False: 875k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.87M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.87M|        left_traversal_ = false;
  254|  1.87M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 143k, False: 732k]
  ------------------
  255|       |        // End reached.
  256|   143k|        corner_ = kInvalidCornerIndex;
  257|   143k|      }
  258|  2.75M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  23.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  23.4k|    }
  263|  2.77M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|  2.02M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|   641k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  75.2M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  75.2M|    return is_edge_on_seam_[corner.value()];
   47|  75.2M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  34.5M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  34.5M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 34.5M]
  |  Branch (50:42): [True: 30.2M, False: 4.24M]
  ------------------
   51|  30.2M|      return kInvalidCornerIndex;
   52|  30.2M|    }
   53|  4.24M|    return corner_table_->Opposite(corner);
   54|  34.5M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  43.3M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  43.3M|    return corner_table_->Next(corner);
   58|  43.3M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  24.0M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  24.0M|    return corner_table_->Previous(corner);
   62|  24.0M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  4.91M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  4.91M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  4.91M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.20M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.20M|    return Opposite(Previous(corner));
   73|  3.20M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.58M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.58M|    return Opposite(Next(corner));
   76|  3.58M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  5.33M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  5.33M|    return Previous(Opposite(Previous(corner)));
   81|  5.33M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  14.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  14.7M|    return Next(Opposite(Next(corner)));
   86|  14.7M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  12.7k|  int num_vertices() const {
   89|  12.7k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  12.7k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.48k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.44k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   102M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   102M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   102M|    return ConfidentVertex(corner);
   97|   102M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   102M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   102M|    return corner_to_vertex_map_[corner.value()];
  100|   102M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.18M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.18M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.18M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.18M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.18M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.18M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.18M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.18M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.80M, False: 383k]
  ------------------
  128|  2.80M|      return true;
  129|  2.80M|    }
  130|   383k|    return false;
  131|  3.18M|  }

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

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

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

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

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

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

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

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

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

