LLVMFuzzerTestOneInput:
    7|  25.9k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    8|       |  // Invalid files generate a lot of warnings, so switch off logging.
    9|  25.9k|  Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
   10|       |
   11|  25.9k|  try {
   12|  25.9k|    Exiv2::DataBuf data_copy(data, size);
   13|  25.9k|    Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(data_copy.c_data(), size);
   14|  25.9k|    assert(image.get() != 0);
   15|       |
   16|  25.9k|    image->readMetadata();
   17|       |
   18|  25.9k|    Exiv2::PreviewManager pm(*image);
   19|  25.9k|    std::ostringstream os;
   20|  25.9k|    Exiv2::PreviewPropertiesList list = pm.getPreviewProperties();
   21|  25.9k|    for (const auto& pos : list) {
  ------------------
  |  Branch (21:26): [True: 9.68k, False: 25.9k]
  ------------------
   22|  9.68k|      os << pos.mimeType_ << "\n";
   23|       |
   24|  9.68k|      if (pos.width_ != 0 && pos.height_ != 0)
  ------------------
  |  Branch (24:11): [True: 6.43k, False: 3.24k]
  |  Branch (24:30): [True: 6.02k, False: 409]
  ------------------
   25|  6.02k|        os << pos.width_ << " " << pos.height_ << " ";
   26|       |
   27|  9.68k|      os << pos.size_ << "\n";
   28|  9.68k|    }
   29|       |
   30|  25.9k|  } catch (...) {
   31|       |    // Exiv2 throws an exception if the metadata is invalid.
   32|  9.02k|  }
   33|       |
   34|  25.9k|  return 0;
   35|  25.9k|}

_ZN5Exiv28AsfVideo7GUIDTagC2EjttNSt3__15arrayIhLm8EEE:
   82|    124|        data1_(data1), data2_(data2), data3_(data3), data4_(data4) {
   83|    124|    }
_ZNK5Exiv28AsfVideo12HeaderReader7getSizeEv:
  105|  2.53k|    [[nodiscard]] uint64_t getSize() const {
  106|  2.53k|      return size_;
  107|  2.53k|    }
_ZNK5Exiv28AsfVideo12HeaderReader16getRemainingSizeEv:
  109|    471|    [[nodiscard]] uint64_t getRemainingSize() const {
  110|    471|      return remaining_size_;
  111|    471|    }
_ZN5Exiv28AsfVideo12HeaderReader5getIdEv:
  113|  2.34k|    [[nodiscard]] DataBuf& getId() {
  114|  2.34k|      return IdBuf_;
  115|  2.34k|    }

_ZN5Exiv28IoCloserC2ERNS_7BasicIoE:
  249|  90.0k|  explicit IoCloser(BasicIo& bio) : bio_(bio) {
  250|  90.0k|  }
_ZN5Exiv28IoCloserD2Ev:
  252|  90.0k|  virtual ~IoCloser() {
  253|  90.0k|    close();
  254|  90.0k|  }
_ZN5Exiv28IoCloser5closeEv:
  260|  90.0k|  void close() {
  261|  90.0k|    if (bio_.isopen())
  ------------------
  |  Branch (261:9): [True: 90.0k, False: 0]
  ------------------
  262|  90.0k|      bio_.close();
  263|  90.0k|  }
_ZN5Exiv27BasicIoC2Ev:
   40|  44.6k|  BasicIo() = default;

_ZN5Exiv24IlocC2Ejjj:
   24|  7.72k|  explicit Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length) {
   25|  7.72k|  }

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|    819|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    819|    setMsg(1);
  245|    819|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|    826|std::basic_string<charT> toBasicString(const T& arg) {
  154|    826|  std::basic_ostringstream<charT> os;
  155|    826|  os << arg;
  156|    826|  return os.str();
  157|    826|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    112|std::basic_string<charT> toBasicString(const T& arg) {
  154|    112|  std::basic_ostringstream<charT> os;
  155|    112|  os << arg;
  156|    112|  return os.str();
  157|    112|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|     80|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|     80|    setMsg(1);
  245|     80|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|     80|std::basic_string<charT> toBasicString(const T& arg) {
  154|     80|  std::basic_ostringstream<charT> os;
  155|     80|  os << arg;
  156|     80|  return os.str();
  157|     80|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|    250|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    250|    setMsg(1);
  245|    250|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    250|std::basic_string<charT> toBasicString(const T& arg) {
  154|    250|  std::basic_ostringstream<charT> os;
  155|    250|  os << arg;
  156|    250|  return os.str();
  157|    250|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|    112|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    112|    setMsg(1);
  245|    112|  }
_ZN5Exiv213toBasicStringIcPKcEENSt3__112basic_stringIT_NS3_11char_traitsIS5_EENS3_9allocatorIS5_EEEERKT0_:
  153|     23|std::basic_string<charT> toBasicString(const T& arg) {
  154|     23|  std::basic_ostringstream<charT> os;
  155|     23|  os << arg;
  156|     23|  return os.str();
  157|     23|}
_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEjEENS_9ErrorCodeERKT_RKT0_:
  250|      7|      code_(code), arg1_(toBasicString<char>(arg1)), arg2_(toBasicString<char>(arg2)) {
  251|      7|    setMsg(2);
  252|      7|  }
_ZN5Exiv213toBasicStringIcjEENSt3__112basic_stringIT_NS1_11char_traitsIS3_EENS1_9allocatorIS3_EEEERKT0_:
  153|      7|std::basic_string<charT> toBasicString(const T& arg) {
  154|      7|  std::basic_ostringstream<charT> os;
  155|      7|  os << arg;
  156|      7|  return os.str();
  157|      7|}
_ZN5Exiv25ErrorC2IPKcEENS_9ErrorCodeERKT_:
  243|     23|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|     23|    setMsg(1);
  245|     23|  }

_ZN5Exiv28ExifData5beginEv:
  438|  8.42k|  iterator begin() {
  439|  8.42k|    return exifMetadata_.begin();
  440|  8.42k|  }
_ZN5Exiv28ExifData3endEv:
  442|   395k|  iterator end() {
  443|   395k|    return exifMetadata_.end();
  444|   395k|  }
_ZNK5Exiv28ExifData5beginEv:
  455|  4.25k|  [[nodiscard]] const_iterator begin() const {
  456|  4.25k|    return exifMetadata_.begin();
  457|  4.25k|  }
_ZNK5Exiv28ExifData3endEv:
  459|   731k|  [[nodiscard]] const_iterator end() const {
  460|   731k|    return exifMetadata_.end();
  461|   731k|  }
_ZNK5Exiv28ExifData5emptyEv:
  468|  1.93k|  [[nodiscard]] bool empty() const {
  469|  1.93k|    return exifMetadata_.empty();
  470|  1.93k|  }

_ZNK5Exiv215ImageCtorParams6createEv:
   53|  9.67k|  bool create() const {
   54|  9.67k|    return create_;
   55|  9.67k|  }
_ZNK5Exiv215ImageCtorParams19max_recursion_depthEv:
   57|  35.4k|  size_t max_recursion_depth() const {
   58|  35.4k|    return max_recursion_depth_;
   59|  35.4k|  }
_ZN5Exiv25Image16setTypeSupportedENS_9ImageTypeEt:
  481|     75|  void setTypeSupported(ImageType imageType, uint16_t supportedMetadata) {
  482|     75|    imageType_ = imageType;
  483|     75|    supportedMetadata_ = supportedMetadata;
  484|     75|  }

_ZN5Exiv28IptcData5clearEv:
  199|  32.6k|  void clear() {
  200|  32.6k|    iptcMetadata_.clear();
  201|  32.6k|  }
_ZN5Exiv28IptcData3endEv:
  211|  31.4k|  iterator end() {
  212|  31.4k|    return iptcMetadata_.end();
  213|  31.4k|  }
_ZNK5Exiv28IptcData5emptyEv:
  247|  4.65k|  [[nodiscard]] bool empty() const {
  248|  4.65k|    return iptcMetadata_.empty();
  249|  4.65k|  }

_ZN5Exiv28Internal11MatroskaTagC2EmNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS0_16matroskaTypeEnumENS0_19matroskaProcessEnumE:
   69|    396|      _id(id), _label(std::move(label)), _type(type), _process(process) {
   70|    396|  }
_ZN5Exiv28Internal11MatroskaTagC2EmNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   73|    152|      _id(id),
   74|    152|      _label(std::move(label)),
   75|    152|      _type(matroskaTypeEnum::UndefinedType),
   76|    152|      _process(matroskaProcessEnum::Undefined) {
   77|    152|  }
_ZNK5Exiv28Internal11MatroskaTageqEm:
   79|  4.53M|  bool operator==(uint64_t id) const {
   80|  4.53M|    return id == _id;
   81|  4.53M|  }
_ZNK5Exiv28Internal11MatroskaTag9isSkippedEv:
   83|   112k|  [[nodiscard]] bool isSkipped() const {
   84|   112k|    return _process == Skip;
   85|   112k|  }
_ZNK5Exiv28Internal11MatroskaTag11isCompositeEv:
   86|  77.7k|  [[nodiscard]] bool isComposite() const {
   87|  77.7k|    return _process == Composite;
   88|  77.7k|  }

_ZN5Exiv29MetadatumC2Ev:
  261|  2.71M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  5.48M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|  78.4k|  Key(const Key&) = default;

_ZNK5Exiv212DecodeParams19max_recursion_depthEv:
   25|  28.1k|  size_t max_recursion_depth() const {
   26|  28.1k|    return max_recursion_depth_;
   27|  28.1k|  }

_ZNK5Exiv28PgfImage8mimeTypeEv:
   51|    284|  [[nodiscard]] std::string mimeType() const override {
   52|    284|    return "image/pgf";
   53|    284|  }

_ZN5Exiv212PreviewImageD2Ev:
   54|     39|  ~PreviewImage() = default;

_ZN5Exiv213XmpProperties7XmpLockC2Ev:
   76|  1.68M|    XmpLock() : lock_(getMutex()) {
   77|  1.68M|    }

_ZNK5Exiv29RiffVideo12HeaderReader7getSizeEv:
   55|  22.4k|    [[nodiscard]] uint64_t getSize() const {
   56|  22.4k|      return size_;
   57|  22.4k|    }
_ZNK5Exiv29RiffVideo12HeaderReader5getIdEv:
   59|   222k|    [[nodiscard]] const std::string& getId() const {
   60|   222k|      return id_;
   61|   222k|    }

_ZN5Exiv28Internal9SliceBaseC2Emm:
   20|  3.72M|  SliceBase(size_t begin, size_t end) : begin_(begin), end_(end) {
   21|  3.72M|    if (begin >= end) {
  ------------------
  |  Branch (21:9): [True: 0, False: 3.72M]
  ------------------
   22|      0|      throw std::out_of_range("Begin must be smaller than end");
   23|      0|    }
   24|  3.72M|  }
_ZNK5Exiv28Internal9SliceBase4sizeEv:
   29|  7.45M|  [[nodiscard]] size_t size() const noexcept {
   30|       |    // cannot underflow, as we know that begin < end
   31|  7.45M|    return end_ - begin_;
   32|  7.45M|  }
_ZNK5Exiv28Internal9SliceBase10rangeCheckEm:
   41|  7.45M|  void rangeCheck(size_t index) const {
   42|  7.45M|    if (index >= size()) {
  ------------------
  |  Branch (42:9): [True: 0, False: 7.45M]
  ------------------
   43|      0|      throw std::out_of_range("Index outside of the slice");
   44|      0|    }
   45|  7.45M|  }
_ZN5Exiv25SliceIPKhEC2ES2_mm:
  451|  3.72M|      Internal::ConstSliceBase<Internal::PtrSliceStorage, const T*>(ptr, begin, end) {
  452|       |    // TODO: use using in C++11
  453|  3.72M|  }
_ZN5Exiv28Internal14ConstSliceBaseINS0_15PtrSliceStorageEPKhEC2ERS4_mm:
   90|  3.72M|  ConstSliceBase(data_type& data, size_t begin, size_t end) : SliceBase(begin, end), storage_(data, begin, end) {
   91|  3.72M|  }
_ZN5Exiv28Internal15PtrSliceStorageIPKhEC2ES3_mm:
  319|  3.72M|  PtrSliceStorage(storage_type ptr, size_t /*begin*/, size_t /*end*/) : data_(ptr) {
  320|  3.72M|    if (!ptr) {
  ------------------
  |  Branch (320:9): [True: 0, False: 3.72M]
  ------------------
  321|      0|      throw std::invalid_argument("Null pointer passed to slice constructor");
  322|      0|    }
  323|  3.72M|  }
_ZNK5Exiv28Internal14ConstSliceBaseINS0_15PtrSliceStorageEPKhE2atEm:
   99|  7.45M|  [[nodiscard]] const auto& at(size_t index) const {
  100|  7.45M|    rangeCheck(index);
  101|       |    // we know: begin_ < end <= size() <= SIZE_T_MAX
  102|       |    // and: index < end - begin
  103|       |    // thus: index + begin < end <= SIZE_T_MAX
  104|       |    // => no overflow is possible
  105|  7.45M|    return storage_.unsafeAt(begin_ + index);
  106|  7.45M|  }
_ZNK5Exiv28Internal15PtrSliceStorageIPKhE8unsafeAtEm:
  335|  7.45M|  [[nodiscard]] const auto& unsafeAt(size_t index) const noexcept {
  336|  7.45M|    return data_[index];
  337|  7.45M|  }
_ZN5Exiv214makeSliceUntilIKhEENS_5SliceIPT_EES4_m:
  527|  3.72M|[[nodiscard]] Slice<T*> makeSliceUntil(T* ptr, size_t end) {
  528|  3.72M|  return {ptr, 0, end};
  529|  3.72M|}

_ZN5Exiv27DataBuf5beginEv:
  158|  4.24M|  [[nodiscard]] auto begin() noexcept {
  159|  4.24M|    return pData_.begin();
  160|  4.24M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  1.70k|  [[nodiscard]] auto end() noexcept {
  163|  1.70k|    return pData_.end();
  164|  1.70k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  15.6k|  [[nodiscard]] auto begin() const noexcept {
  167|  15.6k|    return pData_.begin();
  168|  15.6k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  15.6k|  [[nodiscard]] auto end() const noexcept {
  171|  15.6k|    return pData_.end();
  172|  15.6k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  2.23M|  [[nodiscard]] size_t size() const {
  175|  2.23M|    return pData_.size();
  176|  2.23M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  20.6k|  [[nodiscard]] bool empty() const {
  208|  20.6k|    return pData_.empty();
  209|  20.6k|  }
_ZN5Exiv27DataBufC2Ev:
  126|   589k|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  8.18k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  35.3k|const T* find(T (&src)[N], const K& key) {
  461|  35.3k|  static_assert(N > 0, "Passed zero length find");
  462|  35.3k|  auto rc = std::find(src, src + N, key);
  463|  35.3k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 35.3k]
  ------------------
  464|  35.3k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  60.8k|std::string toString(const T& arg) {
  480|  60.8k|  return toStringHelper(arg, std::is_integral<T>());
  481|  60.8k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  60.8k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  60.8k|  return std::to_string(arg);
  470|  60.8k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  3.72M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  3.72M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 2.30M, False: 1.42M]
  ------------------
  242|  2.30M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|  2.30M|  }
  244|  1.42M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  3.72M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|  44.8k|const T* find(T (&src)[N], const K& key) {
  461|  44.8k|  static_assert(N > 0, "Passed zero length find");
  462|  44.8k|  auto rc = std::find(src, src + N, key);
  463|  44.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 33.7k, False: 11.1k]
  ------------------
  464|  44.8k|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  4.59k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  1.67k|const T* find(T (&src)[N], const K& key) {
  461|  1.67k|  static_assert(N > 0, "Passed zero length find");
  462|  1.67k|  auto rc = std::find(src, src + N, key);
  463|  1.67k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.31k, False: 360]
  ------------------
  464|  1.67k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|  52.2k|const T* find(T (&src)[N], const K& key) {
  461|  52.2k|  static_assert(N > 0, "Passed zero length find");
  462|  52.2k|  auto rc = std::find(src, src + N, key);
  463|  52.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 40.3k, False: 11.9k]
  ------------------
  464|  52.2k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|   892k|const T* find(T (&src)[N], const K& key) {
  461|   892k|  static_assert(N > 0, "Passed zero length find");
  462|   892k|  auto rc = std::find(src, src + N, key);
  463|   892k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 26, False: 892k]
  ------------------
  464|   892k|}
_ZN5Exiv24findIKNS_8mimeTypeEiLm6EEEPKT_RAT1__S3_RKT0_:
  460|    133|const T* find(T (&src)[N], const K& key) {
  461|    133|  static_assert(N > 0, "Passed zero length find");
  462|    133|  auto rc = std::find(src, src + N, key);
  463|    133|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 127, False: 6]
  ------------------
  464|    133|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  1.77M|const T* find(T (&src)[N], const K& key) {
  461|  1.77M|  static_assert(N > 0, "Passed zero length find");
  462|  1.77M|  auto rc = std::find(src, src + N, key);
  463|  1.77M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 742k, False: 1.02M]
  ------------------
  464|  1.77M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    338|T stringTo(const std::string& s, bool& ok) {
  496|    338|  std::istringstream is(s);
  497|    338|  T tmp = T();
  498|    338|  ok = static_cast<bool>(is >> tmp);
  499|    338|  std::string rest;
  500|    338|  is >> std::skipws >> rest;
  501|    338|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 275, False: 63]
  ------------------
  502|    275|    ok = false;
  503|    338|  return tmp;
  504|    338|}
_ZN5Exiv28stringToIdEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    329|T stringTo(const std::string& s, bool& ok) {
  496|    329|  std::istringstream is(s);
  497|    329|  T tmp = T();
  498|    329|  ok = static_cast<bool>(is >> tmp);
  499|    329|  std::string rest;
  500|    329|  is >> std::skipws >> rest;
  501|    329|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 267, False: 62]
  ------------------
  502|    267|    ok = false;
  503|    329|  return tmp;
  504|    329|}
_ZN5Exiv28stringToINSt3__14pairIiiEEEET_RKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERb:
  495|    326|T stringTo(const std::string& s, bool& ok) {
  496|    326|  std::istringstream is(s);
  497|    326|  T tmp = T();
  498|    326|  ok = static_cast<bool>(is >> tmp);
  499|    326|  std::string rest;
  500|    326|  is >> std::skipws >> rest;
  501|    326|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 131, False: 195]
  ------------------
  502|    131|    ok = false;
  503|    326|  return tmp;
  504|    326|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  14.4k|std::string toString(const T& arg) {
  480|  14.4k|  return toStringHelper(arg, std::is_integral<T>());
  481|  14.4k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  14.4k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  14.4k|  return std::to_string(arg);
  470|  14.4k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.34k|std::string toString(const T& arg) {
  480|  1.34k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.34k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  1.34k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  1.34k|  return std::to_string(arg);
  470|  1.34k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   129k|std::string toString(const T& arg) {
  480|   129k|  return toStringHelper(arg, std::is_integral<T>());
  481|   129k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   129k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   129k|  return std::to_string(arg);
  470|   129k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.67k|std::string toString(const T& arg) {
  480|  1.67k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.67k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  1.67k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  1.67k|  std::ostringstream os;
  475|  1.67k|  os << arg;
  476|  1.67k|  return os.str();
  477|  1.67k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   112k|std::string toString(const T& arg) {
  480|   112k|  return toStringHelper(arg, std::is_integral<T>());
  481|   112k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   112k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   112k|  std::ostringstream os;
  475|   112k|  os << arg;
  476|   112k|  return os.str();
  477|   112k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  11.5k|std::string toString(const T& arg) {
  480|  11.5k|  return toStringHelper(arg, std::is_integral<T>());
  481|  11.5k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  11.5k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  11.5k|  return std::to_string(arg);
  470|  11.5k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|  1.44k|const T* find(T (&src)[N], const K& key) {
  461|  1.44k|  static_assert(N > 0, "Passed zero length find");
  462|  1.44k|  auto rc = std::find(src, src + N, key);
  463|  1.44k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.02k, False: 421]
  ------------------
  464|  1.44k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|  2.03k|const T* find(T (&src)[N], const K& key) {
  461|  2.03k|  static_assert(N > 0, "Passed zero length find");
  462|  2.03k|  auto rc = std::find(src, src + N, key);
  463|  2.03k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 660, False: 1.37k]
  ------------------
  464|  2.03k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|    343|const T* find(T (&src)[N], const K& key) {
  461|    343|  static_assert(N > 0, "Passed zero length find");
  462|    343|  auto rc = std::find(src, src + N, key);
  463|    343|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 190, False: 153]
  ------------------
  464|    343|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|  79.5k|const T* find(T (&src)[N], const K& key) {
  461|  79.5k|  static_assert(N > 0, "Passed zero length find");
  462|  79.5k|  auto rc = std::find(src, src + N, key);
  463|  79.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.66k, False: 77.8k]
  ------------------
  464|  79.5k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  3.70k|const T* find(T (&src)[N], const K& key) {
  461|  3.70k|  static_assert(N > 0, "Passed zero length find");
  462|  3.70k|  auto rc = std::find(src, src + N, key);
  463|  3.70k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.01k, False: 1.69k]
  ------------------
  464|  3.70k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  11.8k|const T* find(T (&src)[N], const K& key) {
  461|  11.8k|  static_assert(N > 0, "Passed zero length find");
  462|  11.8k|  auto rc = std::find(src, src + N, key);
  463|  11.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 9.09k, False: 2.71k]
  ------------------
  464|  11.8k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  3.75k|const T* find(T (&src)[N], const K& key) {
  461|  3.75k|  static_assert(N > 0, "Passed zero length find");
  462|  3.75k|  auto rc = std::find(src, src + N, key);
  463|  3.75k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.81k, False: 941]
  ------------------
  464|  3.75k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  2.09k|std::string toString(const T& arg) {
  480|  2.09k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.09k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  2.09k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  2.09k|  std::ostringstream os;
  475|  2.09k|  os << arg;
  476|  2.09k|  return os.str();
  477|  2.09k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.73k|std::string toString(const T& arg) {
  480|  1.73k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.73k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  1.73k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  1.73k|  return std::to_string(arg);
  470|  1.73k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   393k|std::string toString(const T& arg) {
  480|   393k|  return toStringHelper(arg, std::is_integral<T>());
  481|   393k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   393k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   393k|  std::ostringstream os;
  475|   393k|  os << arg;
  476|   393k|  return os.str();
  477|   393k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|    353|const T* find(T (&src)[N], const K& key) {
  461|    353|  static_assert(N > 0, "Passed zero length find");
  462|    353|  auto rc = std::find(src, src + N, key);
  463|    353|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 273, False: 80]
  ------------------
  464|    353|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  4.90k|const T* find(T (&src)[N], const K& key) {
  461|  4.90k|  static_assert(N > 0, "Passed zero length find");
  462|  4.90k|  auto rc = std::find(src, src + N, key);
  463|  4.90k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.83k, False: 1.07k]
  ------------------
  464|  4.90k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  4.90k|const T* find(T (&src)[N], const K& key) {
  461|  4.90k|  static_assert(N > 0, "Passed zero length find");
  462|  4.90k|  auto rc = std::find(src, src + N, key);
  463|  4.90k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.24k, False: 656]
  ------------------
  464|  4.90k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  460|   116k|const T* find(T (&src)[N], const K& key) {
  461|   116k|  static_assert(N > 0, "Passed zero length find");
  462|   116k|  auto rc = std::find(src, src + N, key);
  463|   116k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 100k, False: 15.9k]
  ------------------
  464|   116k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  33.5k|const T* find(T (&src)[N], const K& key) {
  461|  33.5k|  static_assert(N > 0, "Passed zero length find");
  462|  33.5k|  auto rc = std::find(src, src + N, key);
  463|  33.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 11.7k, False: 21.7k]
  ------------------
  464|  33.5k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  5.40k|const T* find(T (&src)[N], const K& key) {
  461|  5.40k|  static_assert(N > 0, "Passed zero length find");
  462|  5.40k|  auto rc = std::find(src, src + N, key);
  463|  5.40k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.66k, False: 738]
  ------------------
  464|  5.40k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  5.38k|const T* find(T (&src)[N], const K& key) {
  461|  5.38k|  static_assert(N > 0, "Passed zero length find");
  462|  5.38k|  auto rc = std::find(src, src + N, key);
  463|  5.38k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.14k, False: 1.23k]
  ------------------
  464|  5.38k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|    891|const T* find(T (&src)[N], const K& key) {
  461|    891|  static_assert(N > 0, "Passed zero length find");
  462|    891|  auto rc = std::find(src, src + N, key);
  463|    891|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 148, False: 743]
  ------------------
  464|    891|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   122k|const T* find(T (&src)[N], const K& key) {
  461|   122k|  static_assert(N > 0, "Passed zero length find");
  462|   122k|  auto rc = std::find(src, src + N, key);
  463|   122k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 99.2k, False: 22.7k]
  ------------------
  464|   122k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|  57.1k|const T* find(T (&src)[N], const K& key) {
  461|  57.1k|  static_assert(N > 0, "Passed zero length find");
  462|  57.1k|  auto rc = std::find(src, src + N, key);
  463|  57.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 54.2k, False: 2.84k]
  ------------------
  464|  57.1k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  3.48k|const T* find(T (&src)[N], const K& key) {
  461|  3.48k|  static_assert(N > 0, "Passed zero length find");
  462|  3.48k|  auto rc = std::find(src, src + N, key);
  463|  3.48k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 648, False: 2.83k]
  ------------------
  464|  3.48k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  1.48k|const T* find(T (&src)[N], const K& key) {
  461|  1.48k|  static_assert(N > 0, "Passed zero length find");
  462|  1.48k|  auto rc = std::find(src, src + N, key);
  463|  1.48k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 350, False: 1.13k]
  ------------------
  464|  1.48k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  4.24M|const T* find(T (&src)[N], const K& key) {
  461|  4.24M|  static_assert(N > 0, "Passed zero length find");
  462|  4.24M|  auto rc = std::find(src, src + N, key);
  463|  4.24M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 4.24M]
  ------------------
  464|  4.24M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  2.01M|const T* find(T (&src)[N], const K& key) {
  461|  2.01M|  static_assert(N > 0, "Passed zero length find");
  462|  2.01M|  auto rc = std::find(src, src + N, key);
  463|  2.01M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 2.01M]
  ------------------
  464|  2.01M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  1.03M|const T* find(T (&src)[N], const K& key) {
  461|  1.03M|  static_assert(N > 0, "Passed zero length find");
  462|  1.03M|  auto rc = std::find(src, src + N, key);
  463|  1.03M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.02M, False: 11.7k]
  ------------------
  464|  1.03M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  11.2k|const T* find(T (&src)[N], const K& key) {
  461|  11.2k|  static_assert(N > 0, "Passed zero length find");
  462|  11.2k|  auto rc = std::find(src, src + N, key);
  463|  11.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.76k, False: 6.48k]
  ------------------
  464|  11.2k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|    439|const T* find(T (&src)[N], const K& key) {
  461|    439|  static_assert(N > 0, "Passed zero length find");
  462|    439|  auto rc = std::find(src, src + N, key);
  463|    439|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 166, False: 273]
  ------------------
  464|    439|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     26|T stringTo(const std::string& s, bool& ok) {
  496|     26|  std::istringstream is(s);
  497|     26|  T tmp = T();
  498|     26|  ok = static_cast<bool>(is >> tmp);
  499|     26|  std::string rest;
  500|     26|  is >> std::skipws >> rest;
  501|     26|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 18, False: 8]
  ------------------
  502|     18|    ok = false;
  503|     26|  return tmp;
  504|     26|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|     54|const T* find(T (&src)[N], const K& key) {
  461|     54|  static_assert(N > 0, "Passed zero length find");
  462|     54|  auto rc = std::find(src, src + N, key);
  463|     54|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 54, False: 0]
  ------------------
  464|     54|}

_ZNK5Exiv25Value6typeIdEv:
   85|  1.48M|  TypeId typeId() const {
   86|  1.48M|    return type_;
   87|  1.48M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  2.81M|  UniquePtr clone() const {
   94|  2.81M|    return UniquePtr(clone_());
   95|  2.81M|  }
_ZNK5Exiv25Value2okEv:
  181|  5.47k|  bool ok() const {
  182|  5.47k|    return ok_;
  183|  5.47k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  58.7k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  58.7k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 23.6k, False: 35.0k]
  ------------------
  797|  23.6k|      return str1.size() > str2.size();
  798|       |
  799|  35.0k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  35.0k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  58.7k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  29.8k|inline TypeId getType<uint16_t>() {
 1084|  29.8k|  return unsignedShort;
 1085|  29.8k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  3.06k|inline TypeId getType<uint32_t>() {
 1089|  3.06k|  return unsignedLong;
 1090|  3.06k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  6.73k|inline TypeId getType<URational>() {
 1094|  6.73k|  return unsignedRational;
 1095|  6.73k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  13.7k|inline TypeId getType<int16_t>() {
 1099|  13.7k|  return signedShort;
 1100|  13.7k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  8.45k|inline TypeId getType<int32_t>() {
 1104|  8.45k|  return signedLong;
 1105|  8.45k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  2.78k|inline TypeId getType<Rational>() {
 1109|  2.78k|  return signedRational;
 1110|  2.78k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  3.18k|inline TypeId getType<float>() {
 1114|  3.18k|  return tiffFloat;
 1115|  3.18k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  5.17k|inline TypeId getType<double>() {
 1119|  5.17k|  return tiffDouble;
 1120|  5.17k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.48M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.48M|  return getUShort(buf, byteOrder);
 1316|  1.48M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|   465k|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|   465k|  return getULong(buf, byteOrder);
 1321|   465k|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   558k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   558k|  return getURational(buf, byteOrder);
 1326|   558k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   675k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   675k|  return getShort(buf, byteOrder);
 1331|   675k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   215k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   215k|  return getLong(buf, byteOrder);
 1336|   215k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|  43.8k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|  43.8k|  return getRational(buf, byteOrder);
 1341|  43.8k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|   182k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|   182k|  return getFloat(buf, byteOrder);
 1346|   182k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   116k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   116k|  return getDouble(buf, byteOrder);
 1351|   116k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   227k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   227k|  return us2Data(buf, t, byteOrder);
 1374|   227k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|   138k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|   138k|  return ul2Data(buf, t, byteOrder);
 1382|   138k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|  57.7k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|  57.7k|  return ur2Data(buf, t, byteOrder);
 1390|  57.7k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  15.5k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  15.5k|  return s2Data(buf, t, byteOrder);
 1398|  15.5k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   146k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   146k|  return l2Data(buf, t, byteOrder);
 1406|   146k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  41.9k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  41.9k|  return r2Data(buf, t, byteOrder);
 1414|  41.9k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  18.1k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  18.1k|  return f2Data(buf, t, byteOrder);
 1422|  18.1k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|  3.50k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|  3.50k|  return d2Data(buf, t, byteOrder);
 1430|  3.50k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.60k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.60k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.60k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  6.14k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  6.14k|  return float_to_integer_helper<uint32_t>(n);
 1555|  6.14k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  5.11k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  5.11k|  return float_to_integer_helper<int64_t>(n);
 1560|  5.11k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  11.8k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  11.8k|  return float_to_integer_helper<uint32_t>(n);
 1564|  11.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  2.29k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  2.29k|  return rational_to_integer_helper<int64_t>(n);
 1569|  2.29k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  6.01k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  6.01k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  6.01k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  2.46k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  2.46k|  return rational_to_integer_helper<int64_t>(n);
 1578|  2.46k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  9.33k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  9.33k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  9.33k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.60k|  I float_to_integer_helper(size_t n) const {
 1213|  1.60k|    const auto v = value_.at(n);
 1214|  1.60k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.31k, False: 291]
  ------------------
 1215|  1.31k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 647, False: 664]
  ------------------
 1216|    647|      return static_cast<I>(std::lround(v));
 1217|    647|    }
 1218|    955|    return 0;
 1219|  1.60k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  6.14k|  I float_to_integer_helper(size_t n) const {
 1213|  6.14k|    const auto v = value_.at(n);
 1214|  6.14k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.26k, False: 880]
  ------------------
 1215|  5.26k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.90k, False: 2.36k]
  ------------------
 1216|  2.90k|      return static_cast<I>(std::lround(v));
 1217|  2.90k|    }
 1218|  3.24k|    return 0;
 1219|  6.14k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  5.11k|  I float_to_integer_helper(size_t n) const {
 1213|  5.11k|    const auto v = value_.at(n);
 1214|  5.11k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 4.19k, False: 926]
  ------------------
 1215|  4.19k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.14k, False: 1.04k]
  ------------------
 1216|  3.14k|      return static_cast<I>(std::lround(v));
 1217|  3.14k|    }
 1218|  1.97k|    return 0;
 1219|  5.11k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  11.8k|  I float_to_integer_helper(size_t n) const {
 1213|  11.8k|    const auto v = value_.at(n);
 1214|  11.8k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 9.67k, False: 2.18k]
  ------------------
 1215|  9.67k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 7.88k, False: 1.79k]
  ------------------
 1216|  7.88k|      return static_cast<I>(std::lround(v));
 1217|  7.88k|    }
 1218|  3.98k|    return 0;
 1219|  11.8k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  2.29k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.29k|    auto a = value_.at(n).first;
 1225|  2.29k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.29k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.17k, False: 1.12k]
  ------------------
 1229|  1.17k|      return 0;
 1230|  1.17k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.12k|#ifdef __cpp_if_constexpr
 1234|  1.12k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  1.12k|      const auto imin = std::numeric_limits<I>::min();
 1240|  1.12k|      const auto imax = std::numeric_limits<I>::max();
 1241|  1.12k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 1.12k]
  |  Branch (1241:23): [True: 0, False: 1.12k]
  |  Branch (1241:35): [True: 0, False: 1.12k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  1.12k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  1.12k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.29k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  6.01k|  I rational_to_integer_helper(size_t n) const {
 1224|  6.01k|    auto a = value_.at(n).first;
 1225|  6.01k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  6.01k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.06k, False: 3.95k]
  ------------------
 1229|  2.06k|      return 0;
 1230|  2.06k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  3.95k|#ifdef __cpp_if_constexpr
 1234|       |    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|       |      const auto imin = std::numeric_limits<I>::min();
 1240|       |      const auto imax = std::numeric_limits<I>::max();
 1241|       |      if (imax < b || a < imin || imax < a) {
 1242|       |        return 0;
 1243|       |      }
 1244|       |#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|  3.95k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  3.95k|      const auto imax = std::numeric_limits<I>::max();
 1257|  3.95k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 480, False: 3.47k]
  ------------------
 1258|    480|        return 0;
 1259|    480|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  3.47k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  3.47k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  3.47k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 3.47k]
  |  Branch (1263:25): [True: 0, False: 3.47k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  3.47k|    }
 1267|       |
 1268|  3.47k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  6.01k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  2.46k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.46k|    auto a = value_.at(n).first;
 1225|  2.46k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.46k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 632, False: 1.83k]
  ------------------
 1229|    632|      return 0;
 1230|    632|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.83k|#ifdef __cpp_if_constexpr
 1234|       |    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|       |      const auto imin = std::numeric_limits<I>::min();
 1240|       |      const auto imax = std::numeric_limits<I>::max();
 1241|       |      if (imax < b || a < imin || imax < a) {
 1242|       |        return 0;
 1243|       |      }
 1244|       |#ifdef __cpp_if_constexpr
 1245|  1.83k|    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|  1.83k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  1.83k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 1.83k]
  |  Branch (1251:23): [True: 0, False: 1.83k]
  ------------------
 1252|      0|        return 0;
 1253|      0|      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  1.83k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.46k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  9.33k|  I rational_to_integer_helper(size_t n) const {
 1224|  9.33k|    auto a = value_.at(n).first;
 1225|  9.33k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  9.33k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.39k, False: 7.94k]
  ------------------
 1229|  1.39k|      return 0;
 1230|  1.39k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  7.94k|#ifdef __cpp_if_constexpr
 1234|  7.94k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  7.94k|      const auto imin = std::numeric_limits<I>::min();
 1240|  7.94k|      const auto imax = std::numeric_limits<I>::max();
 1241|  7.94k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 7.94k]
  |  Branch (1241:23): [True: 0, False: 7.94k]
  |  Branch (1241:35): [True: 0, False: 7.94k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  7.94k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  7.94k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  9.33k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  29.8k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  29.8k|}
_ZN5Exiv25ValueD2Ev:
   43|  3.97M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  27.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  27.5k|  value_.clear();
 1469|  27.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  27.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 27.5k, False: 0]
  |  Branch (1470:17): [True: 442, False: 27.0k]
  ------------------
 1471|    442|    len = (len / ts) * ts;
 1472|  1.51M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.48M, False: 27.5k]
  ------------------
 1473|  1.48M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.48M|  }
 1475|  27.5k|  return 0;
 1476|  27.5k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  2.28k|int ValueType<T>::read(const std::string& buf) {
 1480|  2.28k|  std::istringstream is(buf);
 1481|  2.28k|  T tmp;
 1482|  2.28k|  ValueList val;
 1483|  5.24k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 2.96k, False: 2.28k]
  ------------------
 1484|  2.96k|    val.push_back(tmp);
 1485|  2.28k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 2.28k]
  ------------------
 1486|      0|    return 1;
 1487|  2.28k|  value_ = std::move(val);
 1488|  2.28k|  return 0;
 1489|  2.28k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.43k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.43k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.02k, False: 406]
  ------------------
 1651|  1.02k|    pDataArea_ = Blob(buf, buf + len);
 1652|    406|  else
 1653|    406|    pDataArea_.clear();
 1654|  1.43k|  return 0;
 1655|  1.43k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  5.59k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.59k|  size_t offset = 0;
 1494|   227k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 227k, False: 5.59k]
  ------------------
 1495|   227k|    offset += toData(buf + offset, val, byteOrder);
 1496|   227k|  }
 1497|  5.59k|  return offset;
 1498|  5.59k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|  1.03M|size_t ValueType<T>::count() const {
 1502|  1.03M|  return value_.size();
 1503|  1.03M|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  12.6k|size_t ValueType<T>::size() const {
 1507|  12.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  12.6k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    505|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    505|  auto end = value_.end();
 1518|    505|  auto i = value_.begin();
 1519|  5.06k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.55k, False: 505]
  ------------------
 1520|  4.55k|    os << std::setprecision(15) << *i;
 1521|  4.55k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.26k, False: 295]
  ------------------
 1522|  4.26k|      os << " ";
 1523|  4.55k|  }
 1524|    505|  return os;
 1525|    505|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   975k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   975k|  ok_ = true;
 1537|   975k|  return static_cast<int64_t>(value_.at(n));
 1538|   975k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   984k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   984k|  ok_ = true;
 1542|   984k|  return static_cast<uint32_t>(value_.at(n));
 1543|   984k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  6.29k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.29k|  return pDataArea_.size();
 1641|  6.29k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    681|DataBuf ValueType<T>::dataArea() const {
 1645|    681|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    681|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|  77.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  77.3k|  return new ValueType<T>(*this);
 1513|  77.3k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|  77.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  77.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.64k, False: 73.6k]
  ------------------
 1449|  3.64k|    pDataArea_ = rhs.pDataArea_;
 1450|  77.3k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  2.53M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  29.2k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  29.2k|  value_.clear();
 1469|  29.2k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  29.2k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 29.2k, False: 0]
  |  Branch (1470:17): [True: 27, False: 29.2k]
  ------------------
 1471|     27|    len = (len / ts) * ts;
 1472|   494k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 465k, False: 29.2k]
  ------------------
 1473|   465k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   465k|  }
 1475|  29.2k|  return 0;
 1476|  29.2k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    556|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    556|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 400, False: 156]
  ------------------
 1651|    400|    pDataArea_ = Blob(buf, buf + len);
 1652|    156|  else
 1653|    156|    pDataArea_.clear();
 1654|    556|  return 0;
 1655|    556|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  15.1k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  15.1k|  size_t offset = 0;
 1494|   138k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 138k, False: 15.1k]
  ------------------
 1495|   138k|    offset += toData(buf + offset, val, byteOrder);
 1496|   138k|  }
 1497|  15.1k|  return offset;
 1498|  15.1k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|  77.2k|size_t ValueType<T>::count() const {
 1502|  77.2k|  return value_.size();
 1503|  77.2k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  31.4k|size_t ValueType<T>::size() const {
 1507|  31.4k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  31.4k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  3.85k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  3.85k|  auto end = value_.end();
 1518|  3.85k|  auto i = value_.begin();
 1519|  26.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 22.8k, False: 3.85k]
  ------------------
 1520|  22.8k|    os << std::setprecision(15) << *i;
 1521|  22.8k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 19.2k, False: 3.60k]
  ------------------
 1522|  19.2k|      os << " ";
 1523|  22.8k|  }
 1524|  3.85k|  return os;
 1525|  3.85k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  25.3k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  25.3k|  ok_ = true;
 1537|  25.3k|  return static_cast<int64_t>(value_.at(n));
 1538|  25.3k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  25.5k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  25.5k|  ok_ = true;
 1542|  25.5k|  return static_cast<uint32_t>(value_.at(n));
 1543|  25.5k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  5.04k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.04k|  return pDataArea_.size();
 1641|  5.04k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    338|DataBuf ValueType<T>::dataArea() const {
 1645|    338|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    338|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|  95.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  95.4k|  return new ValueType<T>(*this);
 1513|  95.4k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|  95.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  95.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.49k, False: 93.9k]
  ------------------
 1449|  1.49k|    pDataArea_ = rhs.pDataArea_;
 1450|  95.4k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  6.73k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  6.73k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  6.69k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  6.69k|  value_.clear();
 1469|  6.69k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  6.69k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 6.69k, False: 0]
  |  Branch (1470:17): [True: 0, False: 6.69k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   564k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 558k, False: 6.69k]
  ------------------
 1473|   558k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   558k|  }
 1475|  6.69k|  return 0;
 1476|  6.69k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    644|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    644|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 376, False: 268]
  ------------------
 1651|    376|    pDataArea_ = Blob(buf, buf + len);
 1652|    268|  else
 1653|    268|    pDataArea_.clear();
 1654|    644|  return 0;
 1655|    644|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  1.87k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.87k|  size_t offset = 0;
 1494|  57.7k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 57.7k, False: 1.87k]
  ------------------
 1495|  57.7k|    offset += toData(buf + offset, val, byteOrder);
 1496|  57.7k|  }
 1497|  1.87k|  return offset;
 1498|  1.87k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  17.8k|size_t ValueType<T>::count() const {
 1502|  17.8k|  return value_.size();
 1503|  17.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  4.63k|size_t ValueType<T>::size() const {
 1507|  4.63k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.63k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    652|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    652|  auto end = value_.end();
 1518|    652|  auto i = value_.begin();
 1519|  9.71k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 9.06k, False: 652]
  ------------------
 1520|  9.06k|    os << std::setprecision(15) << *i;
 1521|  9.06k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 8.76k, False: 296]
  ------------------
 1522|  8.76k|      os << " ";
 1523|  9.06k|  }
 1524|    652|  return os;
 1525|    652|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  1.83k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.83k|  return pDataArea_.size();
 1641|  1.83k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|     14|DataBuf ValueType<T>::dataArea() const {
 1645|     14|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     14|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  20.9k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  20.9k|  return new ValueType<T>(*this);
 1513|  20.9k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  20.9k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  20.9k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 691, False: 20.2k]
  ------------------
 1449|    691|    pDataArea_ = rhs.pDataArea_;
 1450|  20.9k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  13.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  13.7k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  4.62k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  4.62k|  value_.clear();
 1469|  4.62k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  4.62k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 4.62k, False: 0]
  |  Branch (1470:17): [True: 36, False: 4.58k]
  ------------------
 1471|     36|    len = (len / ts) * ts;
 1472|   679k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 675k, False: 4.62k]
  ------------------
 1473|   675k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   675k|  }
 1475|  4.62k|  return 0;
 1476|  4.62k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  9.16k|int ValueType<T>::read(const std::string& buf) {
 1480|  9.16k|  std::istringstream is(buf);
 1481|  9.16k|  T tmp;
 1482|  9.16k|  ValueList val;
 1483|   251k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 241k, False: 9.16k]
  ------------------
 1484|   241k|    val.push_back(tmp);
 1485|  9.16k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 9.16k]
  ------------------
 1486|      0|    return 1;
 1487|  9.16k|  value_ = std::move(val);
 1488|  9.16k|  return 0;
 1489|  9.16k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|  1.13k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.13k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 967, False: 163]
  ------------------
 1651|    967|    pDataArea_ = Blob(buf, buf + len);
 1652|    163|  else
 1653|    163|    pDataArea_.clear();
 1654|  1.13k|  return 0;
 1655|  1.13k|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  2.15k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.15k|  size_t offset = 0;
 1494|  15.5k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 15.5k, False: 2.15k]
  ------------------
 1495|  15.5k|    offset += toData(buf + offset, val, byteOrder);
 1496|  15.5k|  }
 1497|  2.15k|  return offset;
 1498|  2.15k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  17.7k|size_t ValueType<T>::count() const {
 1502|  17.7k|  return value_.size();
 1503|  17.7k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  4.47k|size_t ValueType<T>::size() const {
 1507|  4.47k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.47k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    374|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    374|  auto end = value_.end();
 1518|    374|  auto i = value_.begin();
 1519|  1.05M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.05M, False: 374]
  ------------------
 1520|  1.05M|    os << std::setprecision(15) << *i;
 1521|  1.05M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.05M, False: 176]
  ------------------
 1522|  1.05M|      os << " ";
 1523|  1.05M|  }
 1524|    374|  return os;
 1525|    374|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|    633|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|    633|  ok_ = true;
 1537|    633|  return static_cast<int64_t>(value_.at(n));
 1538|    633|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  8.46k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  8.46k|  ok_ = true;
 1542|  8.46k|  return static_cast<uint32_t>(value_.at(n));
 1543|  8.46k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  3.52k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.52k|  return pDataArea_.size();
 1641|  3.52k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    688|DataBuf ValueType<T>::dataArea() const {
 1645|    688|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    688|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  25.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  25.7k|  return new ValueType<T>(*this);
 1513|  25.7k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  25.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  25.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.65k, False: 23.0k]
  ------------------
 1449|  2.65k|    pDataArea_ = rhs.pDataArea_;
 1450|  25.7k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  8.45k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  8.45k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  8.45k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.45k|  value_.clear();
 1469|  8.45k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.45k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.45k, False: 0]
  |  Branch (1470:17): [True: 89, False: 8.36k]
  ------------------
 1471|     89|    len = (len / ts) * ts;
 1472|   223k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 215k, False: 8.45k]
  ------------------
 1473|   215k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   215k|  }
 1475|  8.45k|  return 0;
 1476|  8.45k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    441|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    441|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 292, False: 149]
  ------------------
 1651|    292|    pDataArea_ = Blob(buf, buf + len);
 1652|    149|  else
 1653|    149|    pDataArea_.clear();
 1654|    441|  return 0;
 1655|    441|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  3.80k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  3.80k|  size_t offset = 0;
 1494|   146k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 146k, False: 3.80k]
  ------------------
 1495|   146k|    offset += toData(buf + offset, val, byteOrder);
 1496|   146k|  }
 1497|  3.80k|  return offset;
 1498|  3.80k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  21.1k|size_t ValueType<T>::count() const {
 1502|  21.1k|  return value_.size();
 1503|  21.1k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|  8.28k|size_t ValueType<T>::size() const {
 1507|  8.28k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  8.28k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    257|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    257|  auto end = value_.end();
 1518|    257|  auto i = value_.begin();
 1519|  4.27k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.01k, False: 257]
  ------------------
 1520|  4.01k|    os << std::setprecision(15) << *i;
 1521|  4.01k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.82k, False: 190]
  ------------------
 1522|  3.82k|      os << " ";
 1523|  4.01k|  }
 1524|    257|  return os;
 1525|    257|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  1.64k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  1.64k|  ok_ = true;
 1537|  1.64k|  return static_cast<int64_t>(value_.at(n));
 1538|  1.64k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  8.27k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  8.27k|  ok_ = true;
 1542|  8.27k|  return static_cast<uint32_t>(value_.at(n));
 1543|  8.27k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  1.69k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.69k|  return pDataArea_.size();
 1641|  1.69k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    205|DataBuf ValueType<T>::dataArea() const {
 1645|    205|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    205|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  27.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  27.6k|  return new ValueType<T>(*this);
 1513|  27.6k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  27.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  27.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 879, False: 26.8k]
  ------------------
 1449|    879|    pDataArea_ = rhs.pDataArea_;
 1450|  27.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  2.78k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.78k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  2.78k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  2.78k|  value_.clear();
 1469|  2.78k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  2.78k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 2.78k, False: 0]
  |  Branch (1470:17): [True: 0, False: 2.78k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  46.6k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 43.8k, False: 2.78k]
  ------------------
 1473|  43.8k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  43.8k|  }
 1475|  2.78k|  return 0;
 1476|  2.78k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    345|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    345|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 110, False: 235]
  ------------------
 1651|    110|    pDataArea_ = Blob(buf, buf + len);
 1652|    235|  else
 1653|    235|    pDataArea_.clear();
 1654|    345|  return 0;
 1655|    345|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  1.59k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.59k|  size_t offset = 0;
 1494|  41.9k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 41.9k, False: 1.59k]
  ------------------
 1495|  41.9k|    offset += toData(buf + offset, val, byteOrder);
 1496|  41.9k|  }
 1497|  1.59k|  return offset;
 1498|  1.59k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  9.57k|size_t ValueType<T>::count() const {
 1502|  9.57k|  return value_.size();
 1503|  9.57k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  3.62k|size_t ValueType<T>::size() const {
 1507|  3.62k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  3.62k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    511|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    511|  auto end = value_.end();
 1518|    511|  auto i = value_.begin();
 1519|  3.78k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 3.27k, False: 511]
  ------------------
 1520|  3.27k|    os << std::setprecision(15) << *i;
 1521|  3.27k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 2.95k, False: 311]
  ------------------
 1522|  2.95k|      os << " ";
 1523|  3.27k|  }
 1524|    511|  return os;
 1525|    511|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|    441|size_t ValueType<T>::sizeDataArea() const {
 1640|    441|  return pDataArea_.size();
 1641|    441|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     13|DataBuf ValueType<T>::dataArea() const {
 1645|     13|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     13|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  10.0k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  10.0k|  return new ValueType<T>(*this);
 1513|  10.0k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  10.0k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  10.0k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 100, False: 9.94k]
  ------------------
 1449|    100|    pDataArea_ = rhs.pDataArea_;
 1450|  10.0k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  3.18k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.18k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  3.18k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  3.18k|  value_.clear();
 1469|  3.18k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  3.18k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 3.18k, False: 0]
  |  Branch (1470:17): [True: 0, False: 3.18k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   185k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 182k, False: 3.18k]
  ------------------
 1473|   182k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   182k|  }
 1475|  3.18k|  return 0;
 1476|  3.18k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    728|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    728|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 190, False: 538]
  ------------------
 1651|    190|    pDataArea_ = Blob(buf, buf + len);
 1652|    538|  else
 1653|    538|    pDataArea_.clear();
 1654|    728|  return 0;
 1655|    728|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  1.75k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.75k|  size_t offset = 0;
 1494|  18.1k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 18.1k, False: 1.75k]
  ------------------
 1495|  18.1k|    offset += toData(buf + offset, val, byteOrder);
 1496|  18.1k|  }
 1497|  1.75k|  return offset;
 1498|  1.75k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  16.2k|size_t ValueType<T>::count() const {
 1502|  16.2k|  return value_.size();
 1503|  16.2k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  4.75k|size_t ValueType<T>::size() const {
 1507|  4.75k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.75k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    693|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    693|  auto end = value_.end();
 1518|    693|  auto i = value_.begin();
 1519|  9.11k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 8.42k, False: 693]
  ------------------
 1520|  8.42k|    os << std::setprecision(15) << *i;
 1521|  8.42k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 8.09k, False: 328]
  ------------------
 1522|  8.09k|      os << " ";
 1523|  8.42k|  }
 1524|    693|  return os;
 1525|    693|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|    358|size_t ValueType<T>::sizeDataArea() const {
 1640|    358|  return pDataArea_.size();
 1641|    358|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|      9|DataBuf ValueType<T>::dataArea() const {
 1645|      9|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      9|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  12.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  12.7k|  return new ValueType<T>(*this);
 1513|  12.7k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  12.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  12.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 219, False: 12.5k]
  ------------------
 1449|    219|    pDataArea_ = rhs.pDataArea_;
 1450|  12.7k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  5.17k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.17k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  5.17k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.17k|  value_.clear();
 1469|  5.17k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.17k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.17k, False: 0]
  |  Branch (1470:17): [True: 0, False: 5.17k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   121k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 116k, False: 5.17k]
  ------------------
 1473|   116k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   116k|  }
 1475|  5.17k|  return 0;
 1476|  5.17k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    634|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    634|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 175, False: 459]
  ------------------
 1651|    175|    pDataArea_ = Blob(buf, buf + len);
 1652|    459|  else
 1653|    459|    pDataArea_.clear();
 1654|    634|  return 0;
 1655|    634|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|    622|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    622|  size_t offset = 0;
 1494|  3.50k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 3.50k, False: 622]
  ------------------
 1495|  3.50k|    offset += toData(buf + offset, val, byteOrder);
 1496|  3.50k|  }
 1497|    622|  return offset;
 1498|    622|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  13.3k|size_t ValueType<T>::count() const {
 1502|  13.3k|  return value_.size();
 1503|  13.3k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  1.49k|size_t ValueType<T>::size() const {
 1507|  1.49k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.49k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    561|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    561|  auto end = value_.end();
 1518|    561|  auto i = value_.begin();
 1519|  4.02M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.02M, False: 561]
  ------------------
 1520|  4.02M|    os << std::setprecision(15) << *i;
 1521|  4.02M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.02M, False: 360]
  ------------------
 1522|  4.02M|      os << " ";
 1523|  4.02M|  }
 1524|    561|  return os;
 1525|    561|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|    985|size_t ValueType<T>::sizeDataArea() const {
 1640|    985|  return pDataArea_.size();
 1641|    985|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|      9|DataBuf ValueType<T>::dataArea() const {
 1645|      9|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      9|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  13.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  13.1k|  return new ValueType<T>(*this);
 1513|  13.1k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  13.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  13.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 575, False: 12.5k]
  ------------------
 1449|    575|    pDataArea_ = rhs.pDataArea_;
 1450|  13.1k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|  1.01M|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  3.06k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.06k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  4.19k|  [[nodiscard]] bool usePacket() const {
  218|  4.19k|    return usePacket_;
  219|  4.19k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  47.3k|  bool usePacket(bool b) {
  223|  47.3k|    bool r = usePacket_;
  224|  47.3k|    usePacket_ = b;
  225|  47.3k|    return r;
  226|  47.3k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  47.3k|  void setPacket(std::string xmpPacket) {
  229|  47.3k|    xmpPacket_ = std::move(xmpPacket);
  230|  47.3k|    usePacket(false);
  231|  47.3k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  40.1k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  26.3k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  26.3k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  26.3k|  return *this;
  406|  26.3k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   112k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   112k|    setValue(Exiv2::toString(value));
  405|   112k|  return *this;
  406|   112k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  11.5k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  11.5k|    setValue(Exiv2::toString(value));
  405|  11.5k|  return *this;
  406|  11.5k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  14.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  14.4k|    setValue(Exiv2::toString(value));
  405|  14.4k|  return *this;
  406|  14.4k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  396|  2.09k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  2.09k|    setValue(Exiv2::toString(value));
  405|  2.09k|  return *this;
  406|  2.09k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  2.92k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  2.92k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  2.92k|  return *this;
  406|  2.92k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|  1.73k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  1.73k|    setValue(Exiv2::toString(value));
  405|  1.73k|  return *this;
  406|  1.73k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  1.67k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  1.67k|    setValue(Exiv2::toString(value));
  405|  1.67k|  return *this;
  406|  1.67k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    283|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|    283|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    283|  return *this;
  406|    283|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|  60.8k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  60.8k|    setValue(Exiv2::toString(value));
  405|  60.8k|  return *this;
  406|  60.8k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  1.34k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  1.34k|    setValue(Exiv2::toString(value));
  405|  1.34k|  return *this;
  406|  1.34k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   115k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   115k|    setValue(Exiv2::toString(value));
  405|   115k|  return *this;
  406|   115k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  39.2k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  39.2k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  39.2k|  return *this;
  406|  39.2k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   129k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   129k|    setValue(Exiv2::toString(value));
  405|   129k|  return *this;
  406|   129k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|    378|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|    378|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    378|  return *this;
  406|    378|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  9.88k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  9.88k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 2.23k, False: 7.64k]
  |  Branch (43:36): [True: 2.21k, False: 25]
  |  Branch (43:62): [True: 2.19k, False: 19]
  |  Branch (43:88): [True: 2.17k, False: 13]
  ------------------
   44|  9.88k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  12.2k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  12.2k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  12.2k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  12.2k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  12.2k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  12.2k|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  16.1k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  16.1k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 12.2k, False: 3.98k]
  ------------------
   63|  12.2k|    return data1_ < other.data1_;
   64|  3.98k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 86, False: 3.89k]
  ------------------
   65|     86|    return data2_ < other.data2_;
   66|  3.89k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 57, False: 3.84k]
  ------------------
   67|     57|    return data3_ < other.data3_;
   68|  3.84k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  3.89k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  183|    726|    Image(ImageType::asf, mdNone, std::move(io), params) {
  184|    726|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  186|    756|std::string AsfVideo::mimeType() const {
  187|    756|  return "video/asf";
  188|    756|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  193|    726|void AsfVideo::readMetadata() {
  194|    726|  if (io_->open() != 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 726]
  ------------------
  195|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  196|       |
  197|       |  // Ensure that this is the correct image type
  198|    726|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 726]
  ------------------
  199|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (199:9): [True: 0, False: 0]
  |  Branch (199:25): [True: 0, False: 0]
  ------------------
  200|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  201|      0|    throw Error(ErrorCode::kerNotAnImage, "ASF");
  202|      0|  }
  203|       |
  204|    726|  IoCloser closer(*io_);
  205|    726|  clearMetadata();
  206|    726|  io_->seek(0, BasicIo::beg);
  207|    726|  height_ = width_ = 1;
  208|       |
  209|    726|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  210|    726|  xmpData()["Xmp.video.MimeType"] = mimeType();
  211|       |
  212|    726|  decodeBlock(0);
  213|       |
  214|    726|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  215|    726|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  217|  2.53k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  218|  2.53k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (218:7): [True: 2.53k, False: 0]
  ------------------
  219|  2.53k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  220|       |
  221|  2.53k|    size_ = readQWORDTag(io);
  222|  2.53k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (222:9): [True: 586, False: 1.95k]
  ------------------
  223|    586|      remaining_size_ = size_ - GUID - QWORD;
  224|  2.53k|  }
  225|  2.53k|}
_ZN5Exiv28AsfVideo11decodeBlockEm:
  227|  2.60k|void AsfVideo::decodeBlock(size_t depth) {
  228|  2.60k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  229|  2.60k|  HeaderReader objectHeader(io_);
  230|       |#ifdef EXIV2_DEBUG_MESSAGES
  231|       |  EXV_INFO << "decodeBlock = " << GUIDTag(objectHeader.getId().data()).to_string()
  232|       |           << "\tsize= " << objectHeader.getSize() << "\t " << io_->tell() << "/" << io_->size() << '\n';
  233|       |#endif
  234|  2.60k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  235|  2.60k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  236|       |
  237|  2.60k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (237:7): [True: 1.89k, False: 712]
  ------------------
  238|  1.89k|    if (tag->second == "Header")
  ------------------
  |  Branch (238:9): [True: 1.31k, False: 579]
  ------------------
  239|  1.31k|      decodeHeader(depth + 1);
  240|    579|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (240:14): [True: 0, False: 579]
  ------------------
  241|      0|      fileProperties();
  242|    579|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (242:14): [True: 0, False: 579]
  ------------------
  243|      0|      streamProperties();
  244|    579|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (244:14): [True: 0, False: 579]
  ------------------
  245|      0|      headerExtension();
  246|    579|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (246:14): [True: 0, False: 579]
  ------------------
  247|      0|      codecList();
  248|    579|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (248:14): [True: 0, False: 579]
  ------------------
  249|      0|      extendedContentDescription();
  250|    579|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (250:14): [True: 557, False: 22]
  ------------------
  251|    557|      contentDescription();
  252|     22|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (252:14): [True: 0, False: 22]
  ------------------
  253|      0|      extendedStreamProperties();
  254|     22|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (254:14): [True: 0, False: 22]
  ------------------
  255|      0|      DegradableJPEGMedia();
  256|     22|    else {  // tag found but not processed
  257|       |      // Make sure that the remaining size is non-zero, so that we won't
  258|       |      // keep revisiting the same location in the file.
  259|     22|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  260|     22|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|     22|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  262|     22|    }
  263|  1.89k|  } else {  // tag not found
  264|       |    // Make sure that the remaining size is non-zero, so that we won't keep
  265|       |    // revisiting the same location in the file.
  266|    712|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  267|    712|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  268|    712|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  269|    712|  }
  270|       |
  271|  2.60k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEm:
  273|  1.31k|void AsfVideo::decodeHeader(size_t depth) {
  274|  1.31k|  Internal::enforce(depth <= max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|  1.31k|  DataBuf nbHeadersBuf(DWORD + 1);
  276|  1.31k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  277|       |
  278|  1.31k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  279|  1.31k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  1.31k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  281|  1.31k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  282|  3.19k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (282:24): [True: 1.87k, False: 1.31k]
  ------------------
  283|  1.87k|    decodeBlock(depth);
  284|  1.87k|  }
  285|  1.31k|}
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  432|    557|void AsfVideo::contentDescription() {
  433|    557|  uint16_t title_length = readWORDTag(io_);
  434|    557|  uint16_t author_length = readWORDTag(io_);
  435|    557|  uint16_t copyright_length = readWORDTag(io_);
  436|    557|  uint16_t desc_length = readWORDTag(io_);
  437|    557|  uint16_t rating_length = readWORDTag(io_);
  438|       |
  439|    557|  if (title_length)
  ------------------
  |  Branch (439:7): [True: 329, False: 228]
  ------------------
  440|    329|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  441|       |
  442|    557|  if (author_length)
  ------------------
  |  Branch (442:7): [True: 326, False: 231]
  ------------------
  443|    326|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  444|       |
  445|    557|  if (copyright_length)
  ------------------
  |  Branch (445:7): [True: 302, False: 255]
  ------------------
  446|    302|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  447|       |
  448|    557|  if (desc_length)
  ------------------
  |  Branch (448:7): [True: 260, False: 297]
  ------------------
  449|    260|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  450|       |
  451|    557|  if (rating_length)
  ------------------
  |  Branch (451:7): [True: 302, False: 255]
  ------------------
  452|    302|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  453|       |
  454|    557|}  // AsfVideo::extendedContentDescription
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  472|    726|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  473|    726|  auto image = std::make_unique<AsfVideo>(std::move(io), params);
  474|    726|  if (!image->good()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 726]
  ------------------
  475|      0|    return nullptr;
  476|      0|  }
  477|    726|  return image;
  478|    726|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  480|  10.1k|bool isAsfType(BasicIo& iIo, bool advance) {
  481|  10.1k|  byte buf[GUID];
  482|  10.1k|  iIo.read(buf, GUID);
  483|       |
  484|  10.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (484:7): [True: 0, False: 10.1k]
  |  Branch (484:22): [True: 314, False: 9.88k]
  ------------------
  485|    314|    return false;
  486|    314|  }
  487|       |
  488|  9.88k|  bool matched = isASFType(buf);
  489|  9.88k|  if (!advance || !matched) {
  ------------------
  |  Branch (489:7): [True: 9.88k, False: 0]
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|  9.88k|    iIo.seek(0, BasicIo::beg);
  491|  9.88k|  }
  492|       |
  493|  9.88k|  return matched;
  494|  10.1k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  9.88k|static bool isASFType(const byte buf[]) {
  179|  9.88k|  return Header == AsfVideo::GUIDTag(buf);
  180|  9.88k|}

_ZN5Exiv27BasicIoD2Ev:
   60|  44.6k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   62|  2.07M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   63|  2.07M|  const size_t nread = read(buf, rcount);
   64|  2.07M|  Internal::enforce(nread == rcount, err);
   65|  2.07M|  Internal::enforce(!error(), err);
   66|  2.07M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   68|  28.1k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   69|  28.1k|  const int r = seek(offset, pos);
   70|  28.1k|  Internal::enforce(r == 0, err);
   71|  28.1k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  627|  36.2k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  628|  36.2k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  681|   337k|void MemIo::Impl::reserve(size_t wcount) {
  682|   337k|  const size_t need = wcount + idx_;
  683|   337k|  size_t blockSize = 32 * 1024;  // 32768
  684|   337k|  const size_t maxBlockSize = 4 * 1024 * 1024;
  685|       |
  686|   337k|  if (!isMalloced_) {
  ------------------
  |  Branch (686:7): [True: 4.19k, False: 332k]
  ------------------
  687|       |    // Minimum size for 1st block
  688|  4.19k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  689|  4.19k|    auto data = static_cast<byte*>(std::malloc(size));
  690|  4.19k|    if (!data) {
  ------------------
  |  Branch (690:9): [True: 0, False: 4.19k]
  ------------------
  691|      0|      throw Error(ErrorCode::kerMallocFailed);
  692|      0|    }
  693|  4.19k|    if (data_) {
  ------------------
  |  Branch (693:9): [True: 0, False: 4.19k]
  ------------------
  694|      0|      std::memcpy(data, data_, size_);
  695|      0|    }
  696|  4.19k|    data_ = data;
  697|  4.19k|    sizeAlloced_ = size;
  698|  4.19k|    isMalloced_ = true;
  699|  4.19k|  }
  700|       |
  701|   337k|  if (need > size_) {
  ------------------
  |  Branch (701:7): [True: 322k, False: 14.7k]
  ------------------
  702|   322k|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (702:9): [True: 99, False: 322k]
  ------------------
  703|     99|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  704|       |      // Allocate in blocks
  705|     99|      size_t want = blockSize * (1 + need / blockSize);
  706|     99|      data_ = static_cast<byte*>(std::realloc(data_, want));
  707|     99|      if (!data_) {
  ------------------
  |  Branch (707:11): [True: 0, False: 99]
  ------------------
  708|      0|        throw Error(ErrorCode::kerMallocFailed);
  709|      0|      }
  710|     99|      sizeAlloced_ = want;
  711|     99|    }
  712|   322k|    size_ = need;
  713|   322k|  }
  714|   337k|}
_ZN5Exiv25MemIoC2Ev:
  716|  8.38k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  717|  8.38k|}
_ZN5Exiv25MemIoC2EPKhm:
  719|  36.2k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  720|  36.2k|}
_ZN5Exiv25MemIoD2Ev:
  722|  44.6k|MemIo::~MemIo() {
  723|  44.6k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (723:7): [True: 4.19k, False: 40.4k]
  ------------------
  724|  4.19k|    std::free(p_->data_);
  725|  4.19k|  }
  726|  44.6k|}
_ZN5Exiv25MemIo5writeEPKhm:
  728|   331k|size_t MemIo::write(const byte* data, size_t wcount) {
  729|   331k|  p_->reserve(wcount);
  730|   331k|  if (data) {
  ------------------
  |  Branch (730:7): [True: 317k, False: 14.7k]
  ------------------
  731|   317k|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  732|   317k|  }
  733|   331k|  p_->idx_ += wcount;
  734|   331k|  return wcount;
  735|   331k|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  737|  4.11k|void MemIo::transfer(BasicIo& src) {
  738|  4.11k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (738:12): [True: 4.11k, False: 0]
  ------------------
  739|       |    // Optimization if src is another instance of MemIo
  740|  4.11k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (740:9): [True: 0, False: 4.11k]
  ------------------
  741|      0|      std::free(p_->data_);
  742|      0|    }
  743|  4.11k|    p_->idx_ = 0;
  744|  4.11k|    p_->data_ = memIo->p_->data_;
  745|  4.11k|    p_->size_ = memIo->p_->size_;
  746|  4.11k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  747|  4.11k|    memIo->p_->idx_ = 0;
  748|  4.11k|    memIo->p_->data_ = nullptr;
  749|  4.11k|    memIo->p_->size_ = 0;
  750|  4.11k|    memIo->p_->isMalloced_ = false;
  751|  4.11k|  } else {
  752|       |    // Generic reopen to reset position to start
  753|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (753:9): [True: 0, False: 0]
  ------------------
  754|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  755|      0|    }
  756|      0|    p_->idx_ = 0;
  757|      0|    write(src);
  758|      0|    src.close();
  759|      0|  }
  760|  4.11k|  if (error() || src.error())
  ------------------
  |  Branch (760:7): [True: 0, False: 4.11k]
  |  Branch (760:18): [True: 0, False: 4.11k]
  ------------------
  761|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  762|  4.11k|}
_ZN5Exiv25MemIo4putbEh:
  782|  5.26k|int MemIo::putb(byte data) {
  783|  5.26k|  p_->reserve(1);
  784|  5.26k|  p_->data_[p_->idx_++] = data;
  785|  5.26k|  return data;
  786|  5.26k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  788|   907k|int MemIo::seek(int64_t offset, Position pos) {
  789|   907k|  int64_t newIdx = 0;
  790|       |
  791|   907k|  switch (pos) {
  ------------------
  |  Branch (791:11): [True: 907k, False: 0]
  ------------------
  792|   660k|    case BasicIo::cur:
  ------------------
  |  Branch (792:5): [True: 660k, False: 247k]
  ------------------
  793|   660k|      newIdx = p_->idx_ + offset;
  794|   660k|      break;
  795|   247k|    case BasicIo::beg:
  ------------------
  |  Branch (795:5): [True: 247k, False: 660k]
  ------------------
  796|   247k|      newIdx = offset;
  797|   247k|      break;
  798|    158|    case BasicIo::end:
  ------------------
  |  Branch (798:5): [True: 158, False: 907k]
  ------------------
  799|    158|      newIdx = p_->size_ + offset;
  800|    158|      break;
  801|   907k|  }
  802|       |
  803|   907k|  if (newIdx < 0)
  ------------------
  |  Branch (803:7): [True: 0, False: 907k]
  ------------------
  804|      0|    return 1;
  805|       |
  806|   907k|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (806:7): [True: 4.02k, False: 903k]
  ------------------
  807|  4.02k|    p_->eof_ = true;
  808|  4.02k|    return 1;
  809|  4.02k|  }
  810|       |
  811|   903k|  p_->idx_ = static_cast<size_t>(newIdx);
  812|   903k|  p_->eof_ = false;
  813|   903k|  return 0;
  814|   907k|}
_ZN5Exiv25MemIo4mmapEb:
  816|  38.3k|byte* MemIo::mmap(bool /*isWriteable*/) {
  817|  38.3k|  return p_->data_;
  818|  38.3k|}
_ZNK5Exiv25MemIo4tellEv:
  824|   584k|size_t MemIo::tell() const {
  825|   584k|  return p_->idx_;
  826|   584k|}
_ZNK5Exiv25MemIo4sizeEv:
  828|   304k|size_t MemIo::size() const {
  829|   304k|  return p_->size_;
  830|   304k|}
_ZN5Exiv25MemIo4openEv:
  832|   126k|int MemIo::open() {
  833|   126k|  p_->idx_ = 0;
  834|   126k|  p_->eof_ = false;
  835|   126k|  return 0;
  836|   126k|}
_ZNK5Exiv25MemIo6isopenEv:
  838|  90.0k|bool MemIo::isopen() const {
  839|  90.0k|  return true;
  840|  90.0k|}
_ZN5Exiv25MemIo5closeEv:
  842|  90.0k|int MemIo::close() {
  843|  90.0k|  return 0;
  844|  90.0k|}
_ZN5Exiv25MemIo4readEm:
  846|  78.4k|DataBuf MemIo::read(size_t rcount) {
  847|  78.4k|  DataBuf buf(rcount);
  848|  78.4k|  size_t readCount = read(buf.data(), buf.size());
  849|  78.4k|  buf.resize(readCount);
  850|  78.4k|  return buf;
  851|  78.4k|}
_ZN5Exiv25MemIo4readEPhm:
  853|  3.13M|size_t MemIo::read(byte* buf, size_t rcount) {
  854|  3.13M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  855|  3.13M|  const auto allow = std::min<size_t>(rcount, avail);
  856|  3.13M|  if (allow > 0) {
  ------------------
  |  Branch (856:7): [True: 2.97M, False: 157k]
  ------------------
  857|  2.97M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  858|  2.97M|  }
  859|  3.13M|  p_->idx_ += allow;
  860|  3.13M|  if (rcount > avail) {
  ------------------
  |  Branch (860:7): [True: 12.6k, False: 3.11M]
  ------------------
  861|  12.6k|    p_->eof_ = true;
  862|  12.6k|  }
  863|  3.13M|  return allow;
  864|  3.13M|}
_ZN5Exiv25MemIo4getbEv:
  866|   767k|int MemIo::getb() {
  867|   767k|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (867:7): [True: 740, False: 767k]
  ------------------
  868|    740|    p_->eof_ = true;
  869|    740|    return EOF;
  870|    740|  }
  871|   767k|  return p_->data_[p_->idx_++];
  872|   767k|}
_ZNK5Exiv25MemIo5errorEv:
  874|  2.87M|int MemIo::error() const {
  875|  2.87M|  return 0;
  876|  2.87M|}
_ZNK5Exiv25MemIo3eofEv:
  878|   978k|bool MemIo::eof() const {
  879|   978k|  return p_->eof_;
  880|   978k|}
_ZNK5Exiv25MemIo4pathEv:
  882|  14.8k|const std::string& MemIo::path() const noexcept {
  883|  14.8k|  static std::string _path{"MemIo"};
  884|  14.8k|  return _path;
  885|  14.8k|}
_ZN5Exiv25MemIo4ImplC2Ev:
  607|  8.38k|  Impl() = default;                     //!< Default constructor

_ZN5Exiv29BmffImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   87|  3.22k|    Image(ImageType::bmff, mdExif | mdIptc | mdXmp, std::move(io), params) {
   88|  3.22k|}  // BmffImage::BmffImage
_ZN5Exiv29BmffImage7fullBoxEj:
  109|  51.6k|bool BmffImage::fullBox(uint32_t box) {
  110|  51.6k|  return box == TAG::meta || box == TAG::iinf || box == TAG::iloc || box == TAG::thmb || box == TAG::prvw;
  ------------------
  |  Branch (110:10): [True: 1.87k, False: 49.7k]
  |  Branch (110:30): [True: 397, False: 49.3k]
  |  Branch (110:50): [True: 1.83k, False: 47.5k]
  |  Branch (110:70): [True: 2.22k, False: 45.2k]
  |  Branch (110:90): [True: 394, False: 44.8k]
  ------------------
  111|  51.6k|}
_ZNK5Exiv29BmffImage8mimeTypeEv:
  120|  4.65k|std::string BmffImage::mimeType() const {
  121|  4.65k|  switch (fileType_) {
  122|      3|    case TAG::avci:
  ------------------
  |  Branch (122:5): [True: 3, False: 4.65k]
  ------------------
  123|      3|      return "image/avci";
  124|      3|    case TAG::avcs:
  ------------------
  |  Branch (124:5): [True: 3, False: 4.65k]
  ------------------
  125|      3|      return "image/avcs";
  126|      6|    case TAG::avif:
  ------------------
  |  Branch (126:5): [True: 6, False: 4.64k]
  ------------------
  127|      9|    case TAG::avio:
  ------------------
  |  Branch (127:5): [True: 3, False: 4.65k]
  ------------------
  128|     12|    case TAG::avis:
  ------------------
  |  Branch (128:5): [True: 3, False: 4.65k]
  ------------------
  129|     12|      return "image/avif";
  130|      3|    case TAG::heic:
  ------------------
  |  Branch (130:5): [True: 3, False: 4.65k]
  ------------------
  131|      6|    case TAG::heim:
  ------------------
  |  Branch (131:5): [True: 3, False: 4.65k]
  ------------------
  132|      9|    case TAG::heis:
  ------------------
  |  Branch (132:5): [True: 3, False: 4.65k]
  ------------------
  133|     12|    case TAG::heix:
  ------------------
  |  Branch (133:5): [True: 3, False: 4.65k]
  ------------------
  134|     12|      return "image/heic";
  135|      3|    case TAG::heif:
  ------------------
  |  Branch (135:5): [True: 3, False: 4.65k]
  ------------------
  136|      6|    case TAG::mif1:
  ------------------
  |  Branch (136:5): [True: 3, False: 4.65k]
  ------------------
  137|      6|      return "image/heif";
  138|      3|    case TAG::j2is:
  ------------------
  |  Branch (138:5): [True: 3, False: 4.65k]
  ------------------
  139|      3|      return "image/j2is";
  140|      3|    case TAG::j2ki:
  ------------------
  |  Branch (140:5): [True: 3, False: 4.65k]
  ------------------
  141|      3|      return "image/hej2k";
  142|      0|    case TAG::crx:
  ------------------
  |  Branch (142:5): [True: 0, False: 4.65k]
  ------------------
  143|      0|      return "image/x-canon-cr3";
  144|     21|    case TAG::jxl:
  ------------------
  |  Branch (144:5): [True: 21, False: 4.63k]
  ------------------
  145|     21|      return "image/jxl";  // https://github.com/novomesk/qt-jpegxl-image-plugin/issues/1
  146|  4.59k|    default:
  ------------------
  |  Branch (146:5): [True: 4.59k, False: 63]
  ------------------
  147|  4.59k|      return "image/generic";
  148|  4.65k|  }
  149|  4.65k|}
_ZNK5Exiv29BmffImage10pixelWidthEv:
  151|    251|uint32_t BmffImage::pixelWidth() const {
  152|    251|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
  153|    251|  if (imageWidth == exifData_.end() || imageWidth->count() == 0)
  ------------------
  |  Branch (153:7): [True: 224, False: 27]
  |  Branch (153:7): [True: 234, False: 17]
  |  Branch (153:40): [True: 10, False: 17]
  ------------------
  154|    234|    return pixelWidth_;
  155|     17|  return imageWidth->toUint32();
  156|    251|}
_ZNK5Exiv29BmffImage11pixelHeightEv:
  158|    251|uint32_t BmffImage::pixelHeight() const {
  159|    251|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
  160|    251|  if (imageHeight == exifData_.end() || imageHeight->count() == 0)
  ------------------
  |  Branch (160:7): [True: 227, False: 24]
  |  Branch (160:7): [True: 237, False: 14]
  |  Branch (160:41): [True: 10, False: 14]
  ------------------
  161|    237|    return pixelHeight_;
  162|     14|  return imageHeight->toUint32();
  163|    251|}
_ZN5Exiv29BmffImage8uuidNameERKNS_7DataBufE:
  165|    709|std::string BmffImage::uuidName(const Exiv2::DataBuf& uuid) {
  166|    709|  const char* uuidCano = "\x85\xC0\xB6\x87\x82\xF\x11\xE0\x81\x11\xF4\xCE\x46\x2B\x6A\x48";
  167|    709|  const char* uuidXmp = "\xBE\x7A\xCF\xCB\x97\xA9\x42\xE8\x9C\x71\x99\x94\x91\xE3\xAF\xAC";
  168|    709|  const char* uuidCanp = "\xEA\xF4\x2B\x5E\x1C\x98\x4B\x88\xB9\xFB\xB7\xDC\x40\x6E\x4D\x16";
  169|    709|  if (uuid.cmpBytes(0, uuidCano, 16) == 0)
  ------------------
  |  Branch (169:7): [True: 150, False: 559]
  ------------------
  170|    150|    return "cano";
  171|    559|  if (uuid.cmpBytes(0, uuidXmp, 16) == 0)
  ------------------
  |  Branch (171:7): [True: 302, False: 257]
  ------------------
  172|    302|    return "xmp";
  173|    257|  if (uuid.cmpBytes(0, uuidCanp, 16) == 0)
  ------------------
  |  Branch (173:7): [True: 97, False: 160]
  ------------------
  174|     97|    return "canp";
  175|    160|  return "";
  176|    257|}
_ZN5Exiv29BmffImage16brotliUncompressEPKhmRNS_7DataBufE:
  184|    242|void BmffImage::brotliUncompress(const byte* compressedBuf, size_t compressedBufSize, DataBuf& arr) {
  185|    242|  auto decoder = BrotliDecoder(BrotliDecoderCreateInstance(nullptr, nullptr, nullptr), BrotliDecoderDestroyInstance);
  186|    242|  size_t uncompressedLen = compressedBufSize * 2;  // just a starting point
  187|    242|  BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
  188|    242|  int dos = 0;
  189|    242|  size_t available_in = compressedBufSize;
  190|    242|  const byte* next_in = compressedBuf;
  191|    242|  size_t available_out;
  192|    242|  byte* next_out;
  193|    242|  size_t total_out = 0;
  194|       |
  195|    715|  while (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (195:10): [True: 530, False: 185]
  ------------------
  196|    530|    arr.alloc(uncompressedLen);
  197|    530|    available_out = uncompressedLen - total_out;
  198|    530|    next_out = arr.data() + total_out;
  199|    530|    result =
  200|    530|        BrotliDecoderDecompressStream(decoder.get(), &available_in, &next_in, &available_out, &next_out, &total_out);
  201|    530|    if (result == BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (201:9): [True: 185, False: 345]
  ------------------
  202|    185|      arr.resize(total_out);
  203|    345|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
  ------------------
  |  Branch (203:16): [True: 298, False: 47]
  ------------------
  204|    298|      uncompressedLen *= 2;
  205|       |      // DoS protection - can't be bigger than 128k
  206|    298|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (206:11): [True: 32, False: 266]
  ------------------
  207|     32|        if (++dos > 1 || total_out > 131072)
  ------------------
  |  Branch (207:13): [True: 10, False: 22]
  |  Branch (207:26): [True: 0, False: 22]
  ------------------
  208|     10|          break;
  209|     22|        uncompressedLen = 131072;
  210|     22|      }
  211|    298|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
  ------------------
  |  Branch (211:16): [True: 24, False: 23]
  ------------------
  212|       |      // compressed input buffer in incomplete
  213|     24|      throw Error(ErrorCode::kerFailedToReadImageData);
  214|     24|    } else {
  215|       |      // something bad happened
  216|     23|      throw Error(ErrorCode::kerErrorMessage, BrotliDecoderErrorString(BrotliDecoderGetErrorCode(decoder.get())));
  217|     23|    }
  218|    530|  }
  219|       |
  220|    195|  if (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (220:7): [True: 10, False: 185]
  ------------------
  221|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|     10|  }
  223|    195|}
_ZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmm:
  227|  52.9k|                               uint64_t pbox_end, size_t depth) {
  228|  52.9k|  const size_t address = io_->tell();
  229|       |  // never visit a box twice!
  230|  52.9k|  if (depth == 0)
  ------------------
  |  Branch (230:7): [True: 17.5k, False: 35.3k]
  ------------------
  231|  17.5k|    visits_.clear();
  232|  52.9k|  if (visits_.contains(address) || visits_.size() > visits_max_ || depth >= max_recursion_depth_) {
  ------------------
  |  Branch (232:7): [True: 0, False: 52.9k]
  |  Branch (232:36): [True: 45, False: 52.8k]
  |  Branch (232:68): [True: 1, False: 52.8k]
  ------------------
  233|     46|    throw Error(ErrorCode::kerCorruptedMetadata);
  234|     46|  }
  235|  52.8k|  visits_.insert(address);
  236|       |
  237|       |#ifdef EXIV2_DEBUG_MESSAGES
  238|       |  bool bTrace = true;
  239|       |#else
  240|  52.8k|  bool bTrace = option == kpsBasic || option == kpsRecursive;
  ------------------
  |  Branch (240:17): [True: 0, False: 52.8k]
  |  Branch (240:39): [True: 0, False: 52.8k]
  ------------------
  241|  52.8k|#endif
  242|       |
  243|       |  // 8-byte buffer for parsing the box length and type.
  244|  52.8k|  byte hdrbuf[2 * sizeof(uint32_t)];
  245|       |
  246|  52.8k|  size_t hdrsize = sizeof(hdrbuf);
  247|  52.8k|  Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  248|  52.8k|  if (io_->read(hdrbuf, sizeof(hdrbuf)) != sizeof(hdrbuf))
  ------------------
  |  Branch (248:7): [True: 0, False: 52.8k]
  ------------------
  249|      0|    return pbox_end;
  250|       |
  251|       |  // The box length is encoded as a uint32_t by default, but the special value 1 means
  252|       |  // that it's a uint64_t.
  253|  52.8k|  uint64_t box_length = getULong(&hdrbuf[0], endian_);
  254|  52.8k|  uint32_t box_type = getULong(&hdrbuf[sizeof(uint32_t)], endian_);
  255|  52.8k|  bool bLF = true;
  256|       |
  257|  52.8k|  if (bTrace) {
  ------------------
  |  Branch (257:7): [True: 0, False: 52.8k]
  ------------------
  258|      0|    bLF = true;
  259|      0|    out << Internal::indent(depth) << "Exiv2::BmffImage::boxHandler: " << toAscii(box_type)
  260|      0|        << stringFormat(" {:8}->{} ", address, box_length);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  261|      0|  }
  262|       |
  263|  52.8k|  if (box_length == 1) {
  ------------------
  |  Branch (263:7): [True: 198, False: 52.6k]
  ------------------
  264|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  265|    198|    hdrsize += 8;
  266|    198|    Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  267|    198|    DataBuf data(8);
  268|    198|    io_->read(data.data(), data.size());
  269|    198|    box_length = data.read_uint64(0, endian_);
  270|    198|  }
  271|       |
  272|  52.8k|  if (box_length == 0) {
  ------------------
  |  Branch (272:7): [True: 20.5k, False: 32.3k]
  ------------------
  273|       |    // Zero length is also valid and indicates box extends to the end of file.
  274|  20.5k|    box_length = pbox_end - address;
  275|  20.5k|  }
  276|       |
  277|       |  // read data in box and restore file position
  278|  52.8k|  const size_t restore = io_->tell();
  279|  52.8k|  Internal::enforce(box_length >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  52.8k|  Internal::enforce(box_length - hdrsize <= pbox_end - restore, Exiv2::ErrorCode::kerCorruptedMetadata);
  281|       |
  282|  52.8k|  const auto buffer_size = box_length - hdrsize;
  283|  52.8k|  if (skipBox(box_type)) {
  ------------------
  |  Branch (283:7): [True: 344, False: 52.5k]
  ------------------
  284|    344|    if (bTrace) {
  ------------------
  |  Branch (284:9): [True: 0, False: 344]
  ------------------
  285|      0|      out << '\n';
  286|      0|    }
  287|       |    // The enforce() above checks that restore + buffer_size won't
  288|       |    // exceed pbox_end, and by implication, won't exceed LONG_MAX
  289|    344|    return restore + buffer_size;
  290|    344|  }
  291|       |
  292|  52.5k|  DataBuf data(static_cast<size_t>(buffer_size));
  293|  52.5k|  const size_t box_end = restore + data.size();
  294|  52.5k|  io_->read(data.data(), data.size());
  295|  52.5k|  io_->seek(restore, BasicIo::beg);
  296|       |
  297|  52.5k|  size_t skip = 0;  // read position in data.pData_
  298|  52.5k|  uint8_t version = 0;
  299|  52.5k|  uint32_t flags = 0;
  300|       |
  301|  52.5k|  if (fullBox(box_type)) {
  ------------------
  |  Branch (301:7): [True: 6.72k, False: 45.8k]
  ------------------
  302|  6.72k|    Internal::enforce(data.size() - skip >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  303|  6.72k|    flags = data.read_uint32(skip, endian_);  // version/flags
  304|  6.72k|    version = static_cast<uint8_t>(flags >> 24);
  305|  6.72k|    flags &= 0x00ffffff;
  306|  6.72k|    skip += 4;
  307|  6.72k|  }
  308|       |
  309|  52.5k|  switch (box_type) {
  310|       |    //  See notes in skipBox()
  311|  9.69k|    case TAG::ftyp: {
  ------------------
  |  Branch (311:5): [True: 9.69k, False: 42.8k]
  ------------------
  312|  9.69k|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  313|  9.69k|      fileType_ = data.read_uint32(0, endian_);
  314|  9.69k|      if (bTrace) {
  ------------------
  |  Branch (314:11): [True: 0, False: 9.69k]
  ------------------
  315|      0|        out << "brand: " << toAscii(fileType_);
  316|      0|      }
  317|  9.69k|    } break;
  318|       |
  319|       |    // 8.11.6.1
  320|    397|    case TAG::iinf: {
  ------------------
  |  Branch (320:5): [True: 397, False: 52.1k]
  ------------------
  321|    397|      if (bTrace) {
  ------------------
  |  Branch (321:11): [True: 0, False: 397]
  ------------------
  322|      0|        out << '\n';
  323|      0|        bLF = false;
  324|      0|      }
  325|       |
  326|    397|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  327|    397|      uint16_t n = data.read_uint16(skip, endian_);
  328|    397|      skip += 2;
  329|       |
  330|    397|      io_->seek(skip, BasicIo::cur);
  331|    935|      while (n-- > 0) {
  ------------------
  |  Branch (331:14): [True: 538, False: 397]
  ------------------
  332|    538|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  333|    538|      }
  334|    397|    } break;
  335|       |
  336|       |    // 8.11.6.2
  337|  1.19k|    case TAG::infe: {  // .__._.__hvc1_ 2 0 0 1 0 1 0 0 104 118 99 49 0
  ------------------
  |  Branch (337:5): [True: 1.19k, False: 51.3k]
  ------------------
  338|  1.19k|      Internal::enforce(data.size() - skip >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  339|  1.19k|      /* getULong (data.pData_+skip,endian_) ; */ skip += 4;
  340|  1.19k|      uint16_t ID = data.read_uint16(skip, endian_);
  341|  1.19k|      skip += 2;
  342|  1.19k|      /* getShort(data.pData_+skip,endian_) ; */ skip += 2;  // protection
  343|  1.19k|      std::string id;
  344|       |      // Check that the string has a '\0' terminator.
  345|  1.19k|      const char* str = data.c_str(skip);
  346|  1.19k|      const size_t maxlen = data.size() - skip;
  347|  1.19k|      Internal::enforce(maxlen > 0 && strnlen(str, maxlen) < maxlen, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (347:25): [True: 1.18k, False: 11]
  |  Branch (347:39): [True: 1.17k, False: 2]
  ------------------
  348|  1.19k|      std::string name(str);
  349|  1.19k|      if (Internal::contains(name, "Exif")) {  // "Exif" or "ExifExif"
  ------------------
  |  Branch (349:11): [True: 142, False: 1.04k]
  ------------------
  350|    142|        exifID_ = ID;
  351|    142|        id = " *** Exif ***";
  352|  1.04k|      } else if (Internal::contains(name, "mime\0xmp") || Internal::contains(name, "mime\0application/rdf+xml")) {
  ------------------
  |  Branch (352:18): [True: 393, False: 656]
  |  Branch (352:59): [True: 0, False: 656]
  ------------------
  353|    380|        xmpID_ = ID;
  354|    380|        id = " *** XMP ***";
  355|    380|      }
  356|  1.19k|      if (bTrace) {
  ------------------
  |  Branch (356:11): [True: 0, False: 1.19k]
  ------------------
  357|      0|        out << stringFormat("ID = {:3} {} {}", ID, name, id);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  358|      0|      }
  359|  1.19k|    } break;
  360|       |
  361|  16.1k|    case TAG::moov:
  ------------------
  |  Branch (361:5): [True: 16.1k, False: 36.3k]
  ------------------
  362|  16.1k|    case TAG::iprp:
  ------------------
  |  Branch (362:5): [True: 21, False: 52.5k]
  ------------------
  363|  16.1k|    case TAG::ipco:
  ------------------
  |  Branch (363:5): [True: 13, False: 52.5k]
  ------------------
  364|  18.0k|    case TAG::meta: {
  ------------------
  |  Branch (364:5): [True: 1.86k, False: 50.6k]
  ------------------
  365|  18.0k|      if (bTrace) {
  ------------------
  |  Branch (365:11): [True: 0, False: 18.0k]
  ------------------
  366|      0|        out << '\n';
  367|      0|        bLF = false;
  368|      0|      }
  369|  18.0k|      io_->seek(skip, BasicIo::cur);
  370|  52.4k|      while (io_->tell() < box_end) {
  ------------------
  |  Branch (370:14): [True: 34.3k, False: 18.0k]
  ------------------
  371|  34.3k|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  372|  34.3k|      }
  373|       |      // post-process meta box to recover Exif and XMP
  374|  18.0k|      if (box_type == TAG::meta) {
  ------------------
  |  Branch (374:11): [True: 1.63k, False: 16.4k]
  ------------------
  375|  1.63k|        auto ilo = ilocs_.find(exifID_);
  376|  1.63k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (376:13): [True: 53, False: 1.57k]
  ------------------
  377|     53|          const Iloc& iloc = ilo->second;
  378|     53|          if (bTrace) {
  ------------------
  |  Branch (378:15): [True: 0, False: 53]
  ------------------
  379|      0|            out << Internal::indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString() << '\n';
  380|      0|          }
  381|     53|          parseTiff(Internal::Tag::root, iloc.length_, iloc.start_);
  382|     53|        }
  383|  1.63k|        ilo = ilocs_.find(xmpID_);
  384|  1.63k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (384:13): [True: 75, False: 1.55k]
  ------------------
  385|     75|          const Iloc& iloc = ilo->second;
  386|     75|          if (bTrace) {
  ------------------
  |  Branch (386:15): [True: 0, False: 75]
  ------------------
  387|      0|            out << Internal::indent(depth) << "Exiv2::BMFF XMP: " << iloc.toString() << '\n';
  388|      0|          }
  389|     75|          parseXmp(iloc.length_, iloc.start_);
  390|     75|        }
  391|  1.63k|        ilocs_.clear();
  392|  1.63k|      }
  393|  18.0k|    } break;
  394|       |
  395|       |    // 8.11.3.1
  396|  1.83k|    case TAG::iloc: {
  ------------------
  |  Branch (396:5): [True: 1.83k, False: 50.6k]
  ------------------
  397|  1.83k|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  398|  1.83k|      uint8_t u = data.read_uint8(skip++);
  399|  1.83k|      uint16_t offsetSize = u >> 4;
  400|  1.83k|      uint16_t lengthSize = u & 0xF;
  401|       |#if 0
  402|       |                uint16_t indexSize  = 0       ;
  403|       |                u             = data.read_uint8(skip++);
  404|       |                if ( version == 1 || version == 2 ) {
  405|       |                    indexSize = u & 0xF ;
  406|       |                }
  407|       |#else
  408|  1.83k|      skip++;
  409|  1.83k|#endif
  410|  1.83k|      Internal::enforce(data.size() - skip >= (version < 2u ? 2u : 4u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (410:48): [True: 1.53k, False: 297]
  ------------------
  411|  1.83k|      uint32_t itemCount = version < 2 ? data.read_uint16(skip, endian_) : data.read_uint32(skip, endian_);
  ------------------
  |  Branch (411:28): [True: 1.52k, False: 304]
  ------------------
  412|  1.83k|      skip += version < 2 ? 2 : 4;
  ------------------
  |  Branch (412:15): [True: 1.52k, False: 304]
  ------------------
  413|  1.83k|      if (itemCount && itemCount < box_length / 14 && offsetSize == 4 && lengthSize == 4 &&
  ------------------
  |  Branch (413:11): [True: 1.79k, False: 34]
  |  Branch (413:24): [True: 1.39k, False: 401]
  |  Branch (413:55): [True: 949, False: 448]
  |  Branch (413:74): [True: 939, False: 10]
  ------------------
  414|    939|          ((box_length - 16) % itemCount) == 0) {
  ------------------
  |  Branch (414:11): [True: 920, False: 19]
  ------------------
  415|    920|        if (bTrace) {
  ------------------
  |  Branch (415:13): [True: 0, False: 920]
  ------------------
  416|      0|          out << '\n';
  417|      0|          bLF = false;
  418|      0|        }
  419|    920|        auto step = (static_cast<size_t>(box_length) - 16) / itemCount;  // length of data per item.
  420|    920|        size_t base = skip;
  421|  6.44k|        for (uint32_t i = 0; i < itemCount; i++) {
  ------------------
  |  Branch (421:30): [True: 5.52k, False: 920]
  ------------------
  422|  5.52k|          skip = base + (i * step);  // move in 14, 16 or 18 byte steps
  423|  5.52k|          Internal::enforce(data.size() - skip >= (version > 2u ? 4u : 2u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (423:52): [True: 1.93k, False: 3.59k]
  ------------------
  424|  5.52k|          Internal::enforce(data.size() - skip >= step, Exiv2::ErrorCode::kerCorruptedMetadata);
  425|  5.52k|          uint32_t ID = version > 2 ? data.read_uint32(skip, endian_) : data.read_uint16(skip, endian_);
  ------------------
  |  Branch (425:25): [True: 1.81k, False: 3.71k]
  ------------------
  426|  5.52k|          auto offset = [&data, skip, step] {
  427|  5.52k|            if (step == 14 || step == 16)
  428|  5.52k|              return data.read_uint32(skip + step - 8, endian_);
  429|  5.52k|            if (step == 18)
  430|  5.52k|              return data.read_uint32(skip + 4, endian_);
  431|  5.52k|            return 0u;
  432|  5.52k|          }();
  433|       |
  434|  5.52k|          uint32_t ldata = data.read_uint32(skip + step - 4, endian_);
  435|  5.52k|          if (bTrace) {
  ------------------
  |  Branch (435:15): [True: 0, False: 5.52k]
  ------------------
  436|      0|            out << Internal::indent(depth)
  437|      0|                << stringFormat("{:8} | {:8} |   ID | {:4} | {:6},{:6}\n", address + skip, step, ID, offset, ldata);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  438|      0|          }
  439|       |          // save data for post-processing in meta box
  440|  5.52k|          if (offset && ldata && ID != unknownID_) {
  ------------------
  |  Branch (440:15): [True: 4.47k, False: 1.04k]
  |  Branch (440:25): [True: 4.28k, False: 190]
  |  Branch (440:34): [True: 4.17k, False: 115]
  ------------------
  441|  4.17k|            ilocs_[ID] = Iloc{ID, offset, ldata};
  442|  4.17k|          }
  443|  5.52k|        }
  444|    920|      }
  445|  1.83k|    } break;
  446|       |
  447|    510|    case TAG::ispe: {
  ------------------
  |  Branch (447:5): [True: 510, False: 52.0k]
  ------------------
  448|    510|      Internal::enforce(data.size() - skip >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  449|    510|      skip += 4;
  450|    510|      uint32_t width = data.read_uint32(skip, endian_);
  451|    510|      skip += 4;
  452|    510|      uint32_t height = data.read_uint32(skip, endian_);
  453|    510|      skip += 4;
  454|    510|      if (bTrace) {
  ------------------
  |  Branch (454:11): [True: 0, False: 510]
  ------------------
  455|      0|        out << stringFormat("pixelWidth_, pixelHeight_ = {}, {}", width, height);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  456|      0|      }
  457|       |      // HEIC files can have multiple ispe records
  458|       |      // Store largest width/height
  459|    510|      if (width > pixelWidth_ && height > pixelHeight_) {
  ------------------
  |  Branch (459:11): [True: 271, False: 239]
  |  Branch (459:34): [True: 68, False: 203]
  ------------------
  460|     68|        pixelWidth_ = width;
  461|     68|        pixelHeight_ = height;
  462|     68|      }
  463|    510|    } break;
  464|       |
  465|       |    // 12.1.5.2
  466|    361|    case TAG::colr: {
  ------------------
  |  Branch (466:5): [True: 361, False: 52.1k]
  ------------------
  467|    361|      if (data.size() >= (skip + 4 + 8)) {  // .____.HLino..__mntrR 2 0 0 0 0 12 72 76 105 110 111 2 16 ...
  ------------------
  |  Branch (467:11): [True: 127, False: 234]
  ------------------
  468|       |        // https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf
  469|    127|        uint8_t meth = data.read_uint8(skip + 0);
  470|    127|        uint8_t prec = data.read_uint8(skip + 1);
  471|    127|        uint8_t approx = data.read_uint8(skip + 2);
  472|    127|        auto colour_type = std::string(data.c_str(), 4);
  473|    127|        skip += 4;
  474|    127|        if (colour_type == "rICC" || colour_type == "prof") {
  ------------------
  |  Branch (474:13): [True: 10, False: 117]
  |  Branch (474:38): [True: 11, False: 106]
  ------------------
  475|     21|          DataBuf profile(data.c_data(skip), data.size() - skip);
  476|     21|          setIccProfile(std::move(profile));
  477|    106|        } else if (meth == 2 && prec == 0 && approx == 0) {
  ------------------
  |  Branch (477:20): [True: 76, False: 30]
  |  Branch (477:33): [True: 58, False: 18]
  |  Branch (477:46): [True: 48, False: 10]
  ------------------
  478|       |          // JP2000 files have a 3 byte head // 2 0 0 icc......
  479|     48|          skip -= 1;
  480|     48|          DataBuf profile(data.c_data(skip), data.size() - skip);
  481|     48|          setIccProfile(std::move(profile));
  482|     48|        }
  483|    127|      }
  484|    361|    } break;
  485|       |
  486|    709|    case TAG::uuid: {
  ------------------
  |  Branch (486:5): [True: 709, False: 51.8k]
  ------------------
  487|    709|      DataBuf uuid(16);
  488|    709|      io_->read(uuid.data(), uuid.size());
  489|    709|      std::string name = uuidName(uuid);
  490|    709|      if (bTrace) {
  ------------------
  |  Branch (490:11): [True: 0, False: 709]
  ------------------
  491|      0|        out << " uuidName " << name << '\n';
  492|      0|        bLF = false;
  493|      0|      }
  494|    709|      if (name == "cano" || name == "canp") {
  ------------------
  |  Branch (494:11): [True: 150, False: 559]
  |  Branch (494:29): [True: 97, False: 462]
  ------------------
  495|    247|        if (name == "canp") {
  ------------------
  |  Branch (495:13): [True: 97, False: 150]
  ------------------
  496|       |          // based on
  497|       |          // https://github.com/lclevy/canon_cr3/blob/7be75d6/parse_cr3.py#L271
  498|     97|          io_->seek(8, BasicIo::cur);
  499|     97|        }
  500|    659|        while (io_->tell() < box_end) {
  ------------------
  |  Branch (500:16): [True: 412, False: 247]
  ------------------
  501|    412|          io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  502|    412|        }
  503|    462|      } else if (name == "xmp") {
  ------------------
  |  Branch (503:18): [True: 302, False: 160]
  ------------------
  504|    302|        parseXmp(box_length, io_->tell());
  505|    302|      }
  506|    709|    } break;
  507|       |
  508|    293|    case TAG::cmt1:
  ------------------
  |  Branch (508:5): [True: 293, False: 52.2k]
  ------------------
  509|    293|      parseTiff(Internal::Tag::root, box_length);
  510|    293|      break;
  511|    172|    case TAG::cmt2:
  ------------------
  |  Branch (511:5): [True: 172, False: 52.3k]
  ------------------
  512|    172|      parseTiff(Internal::Tag::cmt2, box_length);
  513|    172|      break;
  514|    700|    case TAG::cmt3:
  ------------------
  |  Branch (514:5): [True: 700, False: 51.8k]
  ------------------
  515|    700|      parseTiff(Internal::Tag::cmt3, box_length);
  516|    700|      break;
  517|    146|    case TAG::cmt4:
  ------------------
  |  Branch (517:5): [True: 146, False: 52.3k]
  ------------------
  518|    146|      parseTiff(Internal::Tag::cmt4, box_length);
  519|    146|      break;
  520|  1.05k|    case TAG::exif:
  ------------------
  |  Branch (520:5): [True: 1.05k, False: 51.4k]
  ------------------
  521|  1.05k|      parseTiff(Internal::Tag::root, buffer_size, io_->tell());
  522|  1.05k|      break;
  523|    439|    case TAG::xml:
  ------------------
  |  Branch (523:5): [True: 439, False: 52.0k]
  ------------------
  524|    439|      parseXmp(buffer_size, io_->tell());
  525|    439|      break;
  526|    246|    case TAG::brob: {
  ------------------
  |  Branch (526:5): [True: 246, False: 52.2k]
  ------------------
  527|    246|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  528|    246|      uint32_t realType = data.read_uint32(0, endian_);
  529|    246|      if (bTrace) {
  ------------------
  |  Branch (529:11): [True: 0, False: 246]
  ------------------
  530|      0|        out << "type: " << toAscii(realType);
  531|      0|      }
  532|    246|#ifdef EXV_HAVE_BROTLI
  533|    246|      DataBuf arr;
  534|    246|      brotliUncompress(data.c_data(4), data.size() - 4, arr);
  535|    246|      const DecodeParams dp(max_recursion_depth_);
  536|    246|      if (realType == TAG::exif) {
  ------------------
  |  Branch (536:11): [True: 1, False: 245]
  ------------------
  537|      1|        uint32_t offset = Safe::add(arr.read_uint32(0, endian_), 4u);
  538|      1|        Internal::enforce(Safe::add(offset, 4u) < arr.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  539|      1|        Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), arr.c_data(offset), arr.size() - offset,
  540|      1|                                           Internal::Tag::root, Internal::TiffMapping::findDecoder, dp);
  541|    245|      } else if (realType == TAG::xml) {
  ------------------
  |  Branch (541:18): [True: 62, False: 183]
  ------------------
  542|     62|        try {
  543|     62|          Exiv2::XmpParser::decode(xmpData(), std::string(arr.c_str(), arr.size()), dp);
  544|     62|        } catch (...) {
  545|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  546|      0|        }
  547|     62|      }
  548|    246|#endif
  549|    246|    } break;
  550|  2.22k|    case TAG::thmb:
  ------------------
  |  Branch (550:5): [True: 2.22k, False: 50.3k]
  ------------------
  551|  2.22k|      switch (version) {
  552|  1.67k|        case 0:  // JPEG
  ------------------
  |  Branch (552:9): [True: 1.67k, False: 552]
  ------------------
  553|  1.67k|          parseCr3Preview(data, out, bTrace, version, skip, skip + 2, skip + 4, skip + 12);
  554|  1.67k|          break;
  555|    438|        case 1:  // HDR
  ------------------
  |  Branch (555:9): [True: 438, False: 1.78k]
  ------------------
  556|    438|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  557|    438|          break;
  558|    114|        default:
  ------------------
  |  Branch (558:9): [True: 114, False: 2.11k]
  ------------------
  559|    114|          break;
  560|  2.22k|      }
  561|  2.22k|      break;
  562|  2.22k|    case TAG::prvw:
  ------------------
  |  Branch (562:5): [True: 394, False: 52.1k]
  ------------------
  563|    394|      switch (version) {
  564|     15|        case 0:  // JPEG
  ------------------
  |  Branch (564:9): [True: 15, False: 379]
  ------------------
  565|    343|        case 1:  // HDR
  ------------------
  |  Branch (565:9): [True: 328, False: 66]
  ------------------
  566|    343|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  567|    343|          break;
  568|     51|        default:
  ------------------
  |  Branch (568:9): [True: 51, False: 343]
  ------------------
  569|     51|          break;
  570|    394|      }
  571|    393|      break;
  572|       |
  573|  13.1k|    default:
  ------------------
  |  Branch (573:5): [True: 13.1k, False: 39.3k]
  ------------------
  574|  13.1k|      break; /* do nothing */
  575|  52.5k|  }
  576|  35.0k|  if (bLF && bTrace)
  ------------------
  |  Branch (576:7): [True: 35.0k, False: 0]
  |  Branch (576:14): [True: 0, False: 35.0k]
  ------------------
  577|      0|    out << '\n';
  578|       |
  579|       |  // return address of next box
  580|  35.0k|  return box_end;
  581|  52.5k|}
_ZN5Exiv29BmffImage9parseTiffEjmm:
  583|  1.11k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length, uint64_t start) {
  584|  1.11k|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  585|  1.11k|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  586|  1.11k|  Internal::enforce(start <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()),
  587|  1.11k|                    ErrorCode::kerCorruptedMetadata);
  588|  1.11k|  Internal::enforce(length <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  589|       |
  590|       |  // read and parse exif data
  591|  1.11k|  const size_t restore = io_->tell();
  592|  1.11k|  DataBuf exif(static_cast<size_t>(length));
  593|  1.11k|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  594|  1.11k|  if (exif.size() > 8 && io_->read(exif.data(), exif.size()) == exif.size()) {
  ------------------
  |  Branch (594:7): [True: 1.04k, False: 67]
  |  Branch (594:26): [True: 1.04k, False: 0]
  ------------------
  595|       |    // hunt for "II" or "MM"
  596|  1.04k|    const size_t eof = std::numeric_limits<size_t>::max();  // impossible value for punt
  597|  1.04k|    size_t punt = eof;
  598|  1.43M|    for (size_t i = 0; i < exif.size() - 9 && punt == eof; ++i) {
  ------------------
  |  Branch (598:24): [True: 1.43M, False: 427]
  |  Branch (598:47): [True: 1.43M, False: 616]
  ------------------
  599|  1.43M|      auto charCurrent = exif.read_uint8(i);
  600|  1.43M|      auto charNext = exif.read_uint8(i + 1);
  601|  1.43M|      if (charCurrent == charNext && (charCurrent == 'I' || charCurrent == 'M'))
  ------------------
  |  Branch (601:11): [True: 584k, False: 853k]
  |  Branch (601:39): [True: 107, False: 584k]
  |  Branch (601:61): [True: 530, False: 584k]
  ------------------
  602|    637|        punt = i;
  603|  1.43M|    }
  604|  1.04k|    if (punt != eof) {
  ------------------
  |  Branch (604:9): [True: 637, False: 406]
  ------------------
  605|    637|      const DecodeParams dp(max_recursion_depth_);
  606|    637|      Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), exif.c_data(punt), exif.size() - punt,
  607|    637|                                         root_tag, Internal::TiffMapping::findDecoder, dp);
  608|    637|    }
  609|  1.04k|  }
  610|  1.11k|  io_->seek(restore, BasicIo::beg);
  611|  1.11k|}
_ZN5Exiv29BmffImage9parseTiffEjm:
  613|  1.31k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length) {
  614|  1.31k|  if (length > 8) {
  ------------------
  |  Branch (614:7): [True: 912, False: 399]
  ------------------
  615|    912|    Internal::enforce(length - 8 <= io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  616|    912|    Internal::enforce(length - 8 <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  617|    912|    DataBuf data(static_cast<size_t>(length - 8u));
  618|    912|    const size_t bufRead = io_->read(data.data(), data.size());
  619|       |
  620|    912|    if (io_->error())
  ------------------
  |  Branch (620:9): [True: 0, False: 912]
  ------------------
  621|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  622|    912|    if (bufRead != data.size())
  ------------------
  |  Branch (622:9): [True: 0, False: 912]
  ------------------
  623|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  624|       |
  625|    912|    const DecodeParams dp(max_recursion_depth_);
  626|    912|    Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), data.c_data(), data.size(), root_tag,
  627|    912|                                       Internal::TiffMapping::findDecoder, dp);
  628|    912|  }
  629|  1.31k|}
_ZN5Exiv29BmffImage8parseXmpEmm:
  631|    816|void BmffImage::parseXmp(uint64_t length, uint64_t start) {
  632|    816|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  633|    816|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  634|       |
  635|    816|  const size_t restore = io_->tell();
  636|    816|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  637|       |
  638|    816|  auto lengthSizeT = static_cast<size_t>(length);
  639|    816|  DataBuf xmp(lengthSizeT + 1);
  640|    816|  xmp.write_uint8(lengthSizeT, 0);  // ensure xmp is null terminated!
  641|    816|  if (io_->read(xmp.data(), lengthSizeT) != lengthSizeT)
  ------------------
  |  Branch (641:7): [True: 0, False: 816]
  ------------------
  642|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  643|    816|  if (io_->error())
  ------------------
  |  Branch (643:7): [True: 0, False: 816]
  ------------------
  644|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  645|    816|  try {
  646|    816|    const DecodeParams dp(max_recursion_depth_);
  647|    816|    Exiv2::XmpParser::decode(xmpData(), std::string(xmp.c_str()), dp);
  648|    816|  } catch (...) {
  649|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  650|      0|  }
  651|       |
  652|    739|  io_->seek(restore, BasicIo::beg);
  653|    739|}
_ZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmm:
  658|  2.45k|                                size_t relative_position) {
  659|       |  // Derived from https://github.com/lclevy/canon_cr3
  660|  2.45k|  const size_t here = io_->tell();
  661|  2.45k|  Internal::enforce(here <= std::numeric_limits<size_t>::max() - relative_position, ErrorCode::kerCorruptedMetadata);
  662|  2.45k|  NativePreview nativePreview;
  663|  2.45k|  nativePreview.position_ = here + relative_position;
  664|  2.45k|  nativePreview.width_ = data.read_uint16(width_offset, endian_);
  665|  2.45k|  nativePreview.height_ = data.read_uint16(height_offset, endian_);
  666|  2.45k|  nativePreview.size_ = data.read_uint32(size_offset, endian_);
  667|  2.45k|  nativePreview.filter_ = "";
  668|  2.45k|  nativePreview.mimeType_ = [version] {
  669|  2.45k|    if (version == 0)
  670|  2.45k|      return "image/jpeg";
  671|  2.45k|    return "application/octet-stream";
  672|  2.45k|  }();
  673|  2.45k|  if (bTrace) {
  ------------------
  |  Branch (673:7): [True: 0, False: 2.45k]
  ------------------
  674|      0|    out << stringFormat("width,height,size = {},{},{}", nativePreview.width_, nativePreview.height_,
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  675|      0|                        nativePreview.size_);
  676|      0|  }
  677|  2.45k|  nativePreviews_.push_back(std::move(nativePreview));
  678|  2.45k|}
_ZNK5Exiv29BmffImage11openOrThrowEv:
  697|  3.22k|void BmffImage::openOrThrow() const {
  698|  3.22k|  if (io_->open() != 0) {
  ------------------
  |  Branch (698:7): [True: 0, False: 3.22k]
  ------------------
  699|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  700|      0|  }
  701|       |  // Ensure that this is the correct image type
  702|  3.22k|  if (!isBmffType(*io_, false)) {
  ------------------
  |  Branch (702:7): [True: 0, False: 3.22k]
  ------------------
  703|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (703:9): [True: 0, False: 0]
  |  Branch (703:25): [True: 0, False: 0]
  ------------------
  704|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  705|      0|    throw Error(ErrorCode::kerNotAnImage, "BMFF");
  706|      0|  }
  707|  3.22k|}
_ZN5Exiv29BmffImage12readMetadataEv:
  709|  3.22k|void BmffImage::readMetadata() {
  710|  3.22k|  openOrThrow();
  711|  3.22k|  IoCloser closer(*io_);
  712|       |
  713|  3.22k|  clearMetadata();
  714|  3.22k|  ilocs_.clear();
  715|  3.22k|  visits_max_ = io_->size() / 16;
  716|  3.22k|  unknownID_ = 0xffff;
  717|  3.22k|  exifID_ = unknownID_;
  718|  3.22k|  xmpID_ = unknownID_;
  719|       |
  720|  3.22k|  uint64_t address = 0;
  721|  3.22k|  const auto file_end = io_->size();
  722|  20.8k|  while (address < file_end) {
  ------------------
  |  Branch (722:10): [True: 17.5k, False: 3.22k]
  ------------------
  723|  17.5k|    io_->seek(address, BasicIo::beg);
  724|  17.5k|    address = boxHandler(std::cout, kpsNone, file_end, 0);
  725|  17.5k|  }
  726|  3.22k|  bReadMetadata_ = true;
  727|  3.22k|}  // BmffImage::readMetadata
_ZN5Exiv215newBmffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|  3.22k|Image::UniquePtr newBmffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|  3.22k|  auto image = std::make_unique<BmffImage>(std::move(io), params);
  774|  3.22k|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 3.22k]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|  3.22k|  return image;
  778|  3.22k|}
_ZN5Exiv210isBmffTypeERNS_7BasicIoEb:
  780|  10.3k|bool isBmffType(BasicIo& iIo, bool advance) {
  781|  10.3k|  const int32_t len = 12;
  782|  10.3k|  byte buf[len];
  783|  10.3k|  iIo.read(buf, len);
  784|  10.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (784:7): [True: 0, False: 10.3k]
  |  Branch (784:22): [True: 314, False: 10.0k]
  ------------------
  785|    314|    return false;
  786|    314|  }
  787|       |
  788|       |  // bmff should start with "ftyp"
  789|  10.0k|  bool const is_ftyp = (buf[4] == 'f' && buf[5] == 't' && buf[6] == 'y' && buf[7] == 'p');
  ------------------
  |  Branch (789:25): [True: 9.28k, False: 738]
  |  Branch (789:42): [True: 9.27k, False: 14]
  |  Branch (789:59): [True: 9.26k, False: 10]
  |  Branch (789:76): [True: 9.25k, False: 4]
  ------------------
  790|       |  // jxl files have a special start indicator of "JXL "
  791|  10.0k|  bool const is_jxl = (buf[4] == 'J' && buf[5] == 'X' && buf[6] == 'L' && buf[7] == ' ');
  ------------------
  |  Branch (791:24): [True: 460, False: 9.56k]
  |  Branch (791:41): [True: 448, False: 12]
  |  Branch (791:58): [True: 436, False: 12]
  |  Branch (791:75): [True: 423, False: 13]
  ------------------
  792|       |
  793|  10.0k|  bool matched = is_jxl || is_ftyp;
  ------------------
  |  Branch (793:18): [True: 423, False: 9.60k]
  |  Branch (793:28): [True: 9.25k, False: 343]
  ------------------
  794|  10.0k|  if (!advance || !matched) {
  ------------------
  |  Branch (794:7): [True: 10.0k, False: 0]
  |  Branch (794:19): [True: 0, False: 0]
  ------------------
  795|  10.0k|    iIo.seek(0, BasicIo::beg);
  796|  10.0k|  }
  797|  10.0k|  return matched;
  798|  10.3k|}
bmffimage.cpp:_ZN5Exiv2L7skipBoxEj:
  113|  51.9k|static bool skipBox(uint32_t box) {
  114|       |  // Allows boxHandler() to optimise the reading of files by identifying
  115|       |  // box types that we're not interested in. Box types listed here must
  116|       |  // not appear in the cases in switch (box_type) in boxHandler().
  117|  51.9k|  return box == 0 || box == TAG::mdat;  // mdat is where the main image lives and can be huge
  ------------------
  |  Branch (117:10): [True: 142, False: 51.8k]
  |  Branch (117:22): [True: 202, False: 51.6k]
  ------------------
  118|  51.9k|}
bmffimage.cpp:_ZZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmmENK3$_0clEv:
  426|  5.40k|          auto offset = [&data, skip, step] {
  427|  5.40k|            if (step == 14 || step == 16)
  ------------------
  |  Branch (427:17): [True: 2.95k, False: 2.45k]
  |  Branch (427:31): [True: 1.65k, False: 800]
  ------------------
  428|  4.60k|              return data.read_uint32(skip + step - 8, endian_);
  429|    800|            if (step == 18)
  ------------------
  |  Branch (429:17): [True: 246, False: 554]
  ------------------
  430|    246|              return data.read_uint32(skip + 4, endian_);
  431|    554|            return 0u;
  432|    800|          }();
bmffimage.cpp:_ZZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmmENK3$_0clEv:
  668|  2.45k|  nativePreview.mimeType_ = [version] {
  669|  2.45k|    if (version == 0)
  ------------------
  |  Branch (669:9): [True: 1.68k, False: 765]
  ------------------
  670|  1.68k|      return "image/jpeg";
  671|    765|    return "application/octet-stream";
  672|  2.45k|  }();

_ZN5Exiv28BmpImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   27|    610|    Image(ImageType::bmp, mdNone, std::move(io), params) {
   28|    610|}
_ZNK5Exiv28BmpImage8mimeTypeEv:
   30|      6|std::string BmpImage::mimeType() const {
   31|       |  // "image/bmp" is a Generic Bitmap
   32|      6|  return "image/x-ms-bmp";  // Microsoft Bitmap
   33|      6|}
_ZN5Exiv28BmpImage12readMetadataEv:
   47|    600|void BmpImage::readMetadata() {
   48|       |#ifdef EXIV2_DEBUG_MESSAGES
   49|       |  std::cerr << "Exiv2::BmpImage::readMetadata: Reading Windows bitmap file " << io_->path() << "\n";
   50|       |#endif
   51|    600|  if (io_->open() != 0) {
  ------------------
  |  Branch (51:7): [True: 0, False: 600]
  ------------------
   52|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   53|      0|  }
   54|    600|  IoCloser closer(*io_);
   55|       |
   56|       |  // Ensure that this is the correct image type
   57|    600|  if (!isBmpType(*io_, false)) {
  ------------------
  |  Branch (57:7): [True: 0, False: 600]
  ------------------
   58|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  |  Branch (58:25): [True: 0, False: 0]
  ------------------
   59|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   60|      0|    throw Error(ErrorCode::kerNotAnImage, "BMP");
   61|      0|  }
   62|    600|  clearMetadata();
   63|       |
   64|       |  /*
   65|       |    The Windows bitmap header goes as follows -- all numbers are in little-endian byte order:
   66|       |
   67|       |    offset  length   name                   description
   68|       |    ======  =======  =====================  =======
   69|       |     0      2 bytes  signature              always 'BM'
   70|       |     2      4 bytes  bitmap size
   71|       |     6      4 bytes  reserved
   72|       |    10      4 bytes  bitmap offset
   73|       |    14      4 bytes  header size
   74|       |    18      4 bytes  bitmap width
   75|       |    22      4 bytes  bitmap height
   76|       |    26      2 bytes  plane count
   77|       |    28      2 bytes  depth
   78|       |    30      4 bytes  compression            0 = none; 1 = RLE, 8 bits/pixel; 2 = RLE, 4 bits/pixel; 3 = bitfield;
   79|       |    4 = JPEG; 5 = PNG 34      4 bytes  image size             size of the raw bitmap data, in bytes 38      4
   80|       |    bytes  horizontal resolution  (in pixels per meter) 42      4 bytes  vertical resolution    (in pixels per
   81|       |    meter) 46      4 bytes  color count 50      4 bytes  important colors       number of "important" colors
   82|       |
   83|       |    The layout above describes the BITMAPINFOHEADER (and later) variants, identified by a header size
   84|       |    of 40 bytes or more. The older OS/2 1.x / Windows 2.x format uses the shorter, 12-byte
   85|       |    BITMAPCOREHEADER instead, in which the width and height fields are only 2 bytes wide:
   86|       |
   87|       |    offset  length   name                   description
   88|       |    ======  =======  =====================  =======
   89|       |    14      4 bytes  header size            always 12 for BITMAPCOREHEADER
   90|       |    18      2 bytes  bitmap width
   91|       |    20      2 bytes  bitmap height
   92|       |    22      2 bytes  plane count
   93|       |    24      2 bytes  depth
   94|       |  */
   95|    600|  byte buf[26];
   96|    600|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (96:7): [True: 600, False: 0]
  ------------------
   97|    600|    const uint32_t headerSize = getULong(buf + 14, littleEndian);
   98|    600|    if (headerSize == 12) {
  ------------------
  |  Branch (98:9): [True: 10, False: 590]
  ------------------
   99|       |      // OS/2 1.x / Windows 2.x BITMAPCOREHEADER: width and height are 16-bit fields.
  100|     10|      pixelWidth_ = getUShort(buf + 18, littleEndian);
  101|     10|      pixelHeight_ = getUShort(buf + 20, littleEndian);
  102|    590|    } else {
  103|    590|      pixelWidth_ = getULong(buf + 18, littleEndian);
  104|    590|      pixelHeight_ = getULong(buf + 22, littleEndian);
  105|    590|    }
  106|    600|  }
  107|    600|}
_ZN5Exiv214newBmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  116|    610|Image::UniquePtr newBmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  117|    610|  auto image = std::make_unique<BmpImage>(std::move(io), params);
  118|    610|  if (!image->good()) {
  ------------------
  |  Branch (118:7): [True: 10, False: 600]
  ------------------
  119|     10|    return nullptr;
  120|     10|  }
  121|    600|  return image;
  122|    610|}
_ZN5Exiv29isBmpTypeERNS_7BasicIoEb:
  124|  16.0k|bool isBmpType(BasicIo& iIo, bool advance) {
  125|  16.0k|  const int32_t len = 2;
  126|  16.0k|  const std::array<byte, len> BmpImageId{'B', 'M'};
  127|  16.0k|  std::array<byte, len> buf;
  128|  16.0k|  iIo.read(buf.data(), len);
  129|  16.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 16.0k]
  |  Branch (129:22): [True: 314, False: 15.7k]
  ------------------
  130|    314|    return false;
  131|    314|  }
  132|  15.7k|  bool matched = buf == BmpImageId;
  133|  15.7k|  if (!advance || !matched) {
  ------------------
  |  Branch (133:7): [True: 15.7k, False: 0]
  |  Branch (133:19): [True: 0, False: 0]
  ------------------
  134|  15.7k|    iIo.seek(-len, BasicIo::cur);
  135|  15.7k|  }
  136|  15.7k|  return matched;
  137|  16.0k|}

_ZN5Exiv28Internal7canonEvEl:
 3062|     42|float canonEv(int64_t val) {
 3063|       |  // temporarily remove sign
 3064|     42|  int sign = 1;
 3065|     42|  if (val < 0) {
  ------------------
  |  Branch (3065:7): [True: 0, False: 42]
  ------------------
 3066|      0|    sign = -1;
 3067|      0|    val = -val;
 3068|      0|  }
 3069|       |  // remove fraction
 3070|     42|  const auto remainder = val & 0x1f;
 3071|     42|  val -= remainder;
 3072|     42|  auto frac = static_cast<float>(remainder);
 3073|       |  // convert 1/3 (0x0c) and 2/3 (0x14) codes
 3074|     42|  if (frac == 0x0c) {
  ------------------
  |  Branch (3074:7): [True: 0, False: 42]
  ------------------
 3075|      0|    frac = 32.0F / 3;
 3076|     42|  } else if (frac == 0x14) {
  ------------------
  |  Branch (3076:14): [True: 0, False: 42]
  ------------------
 3077|      0|    frac = 64.0F / 3;
 3078|     42|  } else if ((val == 160) && (frac == 0x08)) {  // for Sigma f/6.3 lenses that report f/6.2 to camera
  ------------------
  |  Branch (3078:14): [True: 0, False: 42]
  |  Branch (3078:30): [True: 0, False: 0]
  ------------------
 3079|      0|    frac = 30.0F / 3;
 3080|      0|  }
 3081|     42|  return sign * (val + frac) / 32.0F;
 3082|     42|}

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|  43.7k|  static constexpr auto tagList() {
   39|  43.7k|    return tagInfo_;
   40|  43.7k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  1.25k|  static constexpr auto tagListCs() {
   43|  1.25k|    return tagInfoCs_;
   44|  1.25k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|    552|  static constexpr auto tagListSi() {
   47|    552|    return tagInfoSi_;
   48|    552|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  1.17k|  static constexpr auto tagListCf() {
   55|  1.17k|    return tagInfoCf_;
   56|  1.17k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|    878|  static constexpr auto tagListPi() {
   59|    878|    return tagInfoPi_;
   60|    878|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    269|  static constexpr auto tagListTi() {
   63|    269|    return tagInfoTi_;
   64|    269|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|    671|  static constexpr auto tagListFi() {
   67|    671|    return tagInfoFi_;
   68|    671|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|  9.48k|  static constexpr auto tagListPa() {
   51|  9.48k|    return tagInfoPa_;
   52|  9.48k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    381|  static constexpr auto tagListPr() {
   71|    381|    return tagInfoPr_;
   72|    381|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    642|  static constexpr auto tagListVigCor2() {
  135|    642|    return tagInfoVigCor2_;
  136|    642|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    309|  static constexpr auto tagListLiOp() {
  139|    309|    return tagInfoLiOp_;
  140|    309|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    363|  static constexpr auto tagListAfMiAdj() {
  127|    363|    return tagInfoAfMiAdj_;
  128|    363|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|   213k|  static constexpr auto tagListLe() {
  143|   213k|    return tagInfoLe_;
  144|   213k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    237|  static constexpr auto tagListAm() {
  147|    237|    return tagInfoAm_;
  148|    237|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    234|  static constexpr auto tagListFil() {
  155|    234|    return tagInfoFil_;
  156|    234|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    217|  static constexpr auto tagListMe() {
  151|    217|    return tagInfoMe_;
  152|    217|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    248|  static constexpr auto tagListHdr() {
  159|    248|    return tagInfoHdr_;
  160|    248|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    222|  static constexpr auto tagListAfC() {
  163|    222|    return tagInfoAfC_;
  164|    222|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    254|  static constexpr auto tagListRawB() {
  167|    254|    return tagInfoRawB_;
  168|    254|  }

_ZN5Exiv28Internal14CasioMakerNote7tagListEv:
   34|    278|  static constexpr auto tagList() {
   35|    278|    return tagInfo_;
   36|    278|  }
_ZN5Exiv28Internal15Casio2MakerNote7tagListEv:
   52|  34.9k|  static constexpr auto tagList() {
   53|  34.9k|    return tagInfo_;
   54|  34.9k|  }

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  1.94k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  1.94k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  1.94k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  1.94k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.88k|void Converter::cnvFromXmp() {
  511|   489k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 489k, False: 3.88k]
  ------------------
  512|   489k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 403k, False: 85.4k]
  |  Branch (512:37): [True: 201k, False: 201k]
  |  Branch (512:52): [True: 85.4k, False: 201k]
  |  Branch (512:79): [True: 42.7k, False: 42.7k]
  ------------------
  513|   244k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   244k|    }
  515|   489k|  }
  516|  3.88k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  4.42k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  4.42k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  4.42k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 4.42k, False: 0]
  ------------------
  524|  4.42k|    return true;
  525|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (525:7): [True: 0, False: 0]
  |  Branch (525:22): [True: 0, False: 0]
  ------------------
  526|      0|    return false;
  527|      0|  exifData_->erase(pos);
  528|      0|  return true;
  529|      0|}
_ZN5Exiv29Converter17prepareIptcTargetEPKcb:
  531|    591|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    591|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    591|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 591, False: 0]
  ------------------
  534|    591|    return true;
  535|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  |  Branch (535:22): [True: 0, False: 0]
  ------------------
  536|      0|    return false;
  537|      0|  while ((pos = iptcData_->findKey(IptcKey(to))) != iptcData_->end()) {
  ------------------
  |  Branch (537:10): [True: 0, False: 0]
  ------------------
  538|      0|    iptcData_->erase(pos);
  539|      0|  }
  540|      0|  return true;
  541|      0|}
_ZN5Exiv29Converter11cnvXmpValueEPKcS2_:
  844|   174k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   174k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   174k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 174k, False: 358]
  ------------------
  847|   174k|    return;
  848|    358|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 358]
  ------------------
  849|      0|    return;
  850|    358|  std::string value;
  851|    358|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 0, False: 358]
  ------------------
  852|      0|#ifndef SUPPRESS_WARNINGS
  853|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  854|      0|#endif
  855|      0|    return;
  856|      0|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    358|  ExifKey key(to);
  859|    358|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 358, False: 0]
  ------------------
  860|    358|    exifData_->add(ed);
  861|    358|  }
  862|    358|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 358]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    358|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.94k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.94k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.94k]
  ------------------
  868|      0|    return;
  869|  1.94k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.94k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.94k, False: 0]
  ------------------
  871|  1.94k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  1.94k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.94k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.94k]
  ------------------
  887|      0|    return;
  888|  1.94k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.94k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.94k, False: 0]
  ------------------
  890|  1.94k|    return;
  891|      0|  std::string array;
  892|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (892:22): [True: 0, False: 0]
  ------------------
  893|      0|    std::string value = pos->toString(i);
  894|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (894:9): [True: 0, False: 0]
  ------------------
  895|      0|#ifndef SUPPRESS_WARNINGS
  896|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  897|      0|#endif
  898|      0|      return;
  899|      0|    }
  900|      0|    array += value;
  901|      0|    if (i != pos->count() - 1)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|      array += " ";
  903|      0|  }
  904|      0|  (*exifData_)[to] = array;
  905|      0|  if (erase_)
  ------------------
  |  Branch (905:7): [True: 0, False: 0]
  ------------------
  906|      0|    xmpData_->erase(pos);
  907|      0|}
_ZN5Exiv29Converter10cnvXmpDateEPKcS2_:
  909|  7.76k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  7.76k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  7.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 7.58k, False: 178]
  ------------------
  912|  7.58k|    return;
  913|    178|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 178]
  ------------------
  914|      0|    return;
  915|    178|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    178|  std::string value = pos->toString();
  917|    178|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 178]
  ------------------
  918|      0|#ifndef SUPPRESS_WARNINGS
  919|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  920|      0|#endif
  921|      0|    return;
  922|      0|  }
  923|    178|  XMP_DateTime datetime;
  924|    178|  try {
  925|    178|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    178|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 54, False: 124]
  ------------------
  927|     54|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|     54|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|     54|#define stringFormat std::format
  ------------------
  930|     54|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|     54|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 6, False: 48]
  ------------------
  933|      6|        const char* subsecTag = nullptr;
  934|      6|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 6, False: 0]
  ------------------
  935|      6|          subsecTag = "Exif.Photo.SubSecTime";
  936|      6|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 0, False: 0]
  ------------------
  937|      0|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|      0|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 0, False: 0]
  ------------------
  939|      0|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|      0|        }
  941|      6|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 6, False: 0]
  ------------------
  942|      6|          prepareExifTarget(subsecTag, true);
  943|      6|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|      6|        }
  945|      6|      }
  946|    124|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    124|      URational rhour(datetime.hour, 1);
  950|    124|      URational rmin(datetime.minute, 1);
  951|    124|      URational rsec(datetime.second, 1);
  952|    124|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 124]
  ------------------
  953|      0|        if (datetime.second != 0) {
  ------------------
  |  Branch (953:13): [True: 0, False: 0]
  ------------------
  954|       |          // Add the seconds to rmin so that the ns fit into rsec
  955|      0|          rmin.second = 60;
  956|      0|          rmin.first *= 60;
  957|      0|          rmin.first += datetime.second;
  958|      0|        }
  959|      0|        rsec.second = 1000000000;
  960|      0|        rsec.first = datetime.nanoSecond;
  961|      0|      }
  962|       |
  963|    124|      std::ostringstream array;
  964|    124|      array << rhour << " " << rmin << " " << rsec;
  965|    124|      (*exifData_)[to] = array.str();
  966|       |
  967|    124|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    124|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    124|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    124|#define stringFormat std::format
  ------------------
  970|    124|    }
  971|    178|  }
  972|    178|#ifndef SUPPRESS_WARNINGS
  973|    178|  catch (const XMP_Error& e) {
  974|    124|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    124|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 124]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    124|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    124|    return;
  976|    124|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|     54|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 54]
  ------------------
  984|      0|    xmpData_->erase(pos);
  985|       |#else
  986|       |#ifndef SUPPRESS_WARNINGS
  987|       |  EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  988|       |#endif
  989|       |#endif  // !EXV_HAVE_XMP_TOOLKIT
  990|     54|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  3.88k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.88k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.88k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.88k, False: 0]
  ------------------
  995|  3.88k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  1.94k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.94k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.94k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.94k, False: 0]
  ------------------
 1015|  1.94k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  1.94k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.94k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.94k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.94k, False: 0]
  ------------------
 1035|  1.94k|    return;
 1036|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1036:7): [True: 0, False: 0]
  ------------------
 1037|      0|    return;
 1038|      0|  unsigned short value = 0;
 1039|       |
 1040|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:33): [True: 0, False: 0]
  ------------------
 1041|      0|    auto fired = pos->toUint32();
 1042|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1042:9): [True: 0, False: 0]
  ------------------
 1043|      0|      value |= fired & 1;
 1044|      0|#ifndef SUPPRESS_WARNINGS
 1045|      0|    else
 1046|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Fired"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1047|      0|                  << " to " << to << "\n";
 1048|      0|#endif
 1049|      0|  }
 1050|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Return"));
 1051|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:33): [True: 0, False: 0]
  ------------------
 1052|      0|    auto ret = pos->toUint32();
 1053|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1053:9): [True: 0, False: 0]
  ------------------
 1054|      0|      value |= (ret & 3) << 1;
 1055|      0|#ifndef SUPPRESS_WARNINGS
 1056|      0|    else
 1057|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Return"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1058|      0|                  << " to " << to << "\n";
 1059|      0|#endif
 1060|      0|  }
 1061|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Mode"));
 1062|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:33): [True: 0, False: 0]
  ------------------
 1063|      0|    auto mode = pos->toUint32();
 1064|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      value |= (mode & 3) << 3;
 1066|      0|#ifndef SUPPRESS_WARNINGS
 1067|      0|    else
 1068|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Mode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1069|      0|                  << " to " << to << "\n";
 1070|      0|#endif
 1071|      0|  }
 1072|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Function"));
 1073|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:33): [True: 0, False: 0]
  ------------------
 1074|      0|    auto function = pos->toUint32();
 1075|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1075:9): [True: 0, False: 0]
  ------------------
 1076|      0|      value |= (function & 1) << 5;
 1077|      0|#ifndef SUPPRESS_WARNINGS
 1078|      0|    else
 1079|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Function"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1080|      0|                  << " to " << to << "\n";
 1081|      0|#endif
 1082|      0|  }
 1083|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:RedEyeMode"));
 1084|      0|  if (pos != xmpData_->end()) {
  ------------------
  |  Branch (1084:7): [True: 0, False: 0]
  ------------------
 1085|      0|    if (pos->count() > 0) {
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|      auto red = pos->toUint32();
 1087|      0|      if (pos->value().ok())
  ------------------
  |  Branch (1087:11): [True: 0, False: 0]
  ------------------
 1088|      0|        value |= (red & 1) << 6;
 1089|      0|#ifndef SUPPRESS_WARNINGS
 1090|      0|      else
 1091|      0|        EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:RedEyeMode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1092|      0|                    << " to " << to << "\n";
 1093|      0|#endif
 1094|      0|    }
 1095|      0|    if (erase_)
  ------------------
  |  Branch (1095:9): [True: 0, False: 0]
  ------------------
 1096|      0|      xmpData_->erase(pos);
 1097|      0|  }
 1098|       |
 1099|      0|  (*exifData_)[to] = value;
 1100|      0|}
_ZN5Exiv29Converter14cnvXmpGPSCoordEPKcS2_:
 1102|  7.76k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  7.76k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  7.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 7.76k, False: 0]
  ------------------
 1105|  7.76k|    return;
 1106|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1106:7): [True: 0, False: 0]
  ------------------
 1107|      0|    return;
 1108|      0|  std::string value = pos->toString();
 1109|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1109:7): [True: 0, False: 0]
  ------------------
 1110|      0|#ifndef SUPPRESS_WARNINGS
 1111|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1112|      0|#endif
 1113|      0|    return;
 1114|      0|  }
 1115|      0|  if (value.empty()) {
  ------------------
  |  Branch (1115:7): [True: 0, False: 0]
  ------------------
 1116|      0|#ifndef SUPPRESS_WARNINGS
 1117|      0|    EXV_WARNING << from << " is empty\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1118|      0|#endif
 1119|      0|    return;
 1120|      0|  }
 1121|       |
 1122|      0|  double deg = 0.0;
 1123|      0|  double min = 0.0;
 1124|      0|  double sec = 0.0;
 1125|      0|  char ref = value.back();
 1126|      0|  char sep1 = '\0';
 1127|      0|  char sep2 = '\0';
 1128|       |
 1129|      0|  value.pop_back();
 1130|       |
 1131|      0|  std::istringstream in(value);
 1132|       |
 1133|      0|  in >> deg >> sep1 >> min >> sep2;
 1134|       |
 1135|      0|  if (sep2 == ',') {
  ------------------
  |  Branch (1135:7): [True: 0, False: 0]
  ------------------
 1136|      0|    in >> sec;
 1137|      0|  } else {
 1138|      0|    sec = (min - static_cast<int>(min)) * 60.0;
 1139|      0|    min = static_cast<double>(static_cast<int>(min));
 1140|      0|  }
 1141|       |
 1142|      0|  if (in.bad() || (ref != 'N' && ref != 'S' && ref != 'E' && ref != 'W') || sep1 != ',' || !in.eof()) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 0]
  |  Branch (1142:20): [True: 0, False: 0]
  |  Branch (1142:34): [True: 0, False: 0]
  |  Branch (1142:48): [True: 0, False: 0]
  |  Branch (1142:62): [True: 0, False: 0]
  |  Branch (1142:77): [True: 0, False: 0]
  |  Branch (1142:92): [True: 0, False: 0]
  ------------------
 1143|      0|#ifndef SUPPRESS_WARNINGS
 1144|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1145|      0|#endif
 1146|      0|    return;
 1147|      0|  }
 1148|       |
 1149|      0|  Rational rdeg = floatToRationalCast(static_cast<float>(deg));
 1150|      0|  Rational rmin = floatToRationalCast(static_cast<float>(min));
 1151|      0|  Rational rsec = floatToRationalCast(static_cast<float>(sec));
 1152|       |
 1153|      0|  std::ostringstream array;
 1154|      0|  array << rdeg << " " << rmin << " " << rsec;
 1155|      0|  (*exifData_)[to] = array.str();
 1156|       |
 1157|      0|  prepareExifTarget((std::string(to) + "Ref").c_str(), true);
 1158|      0|  char ref_str[2] = {ref, 0};
 1159|      0|  (*exifData_)[std::string(to) + "Ref"] = ref_str;
 1160|       |
 1161|      0|  if (erase_)
  ------------------
  |  Branch (1161:7): [True: 0, False: 0]
  ------------------
 1162|      0|    xmpData_->erase(pos);
 1163|      0|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  42.7k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  42.7k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  42.7k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 42.1k, False: 591]
  ------------------
 1196|  42.1k|    return;
 1197|    591|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 591]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    591|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 221, False: 370]
  |  Branch (1200:35): [True: 162, False: 208]
  ------------------
 1201|    383|    std::string value;
 1202|    383|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 103, False: 280]
  ------------------
 1203|    103|#ifndef SUPPRESS_WARNINGS
 1204|    103|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    103|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 103]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    103|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    103|#endif
 1206|    103|      return;
 1207|    103|    }
 1208|    280|    (*iptcData_)[to] = value;
 1209|    280|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    280|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 280]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    280|    return;
 1213|    383|  }
 1214|       |
 1215|    208|  size_t count = pos->count();
 1216|    208|  bool added = false;
 1217|  4.43k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 4.22k, False: 208]
  ------------------
 1218|  4.22k|    std::string value = pos->toString(i);
 1219|  4.22k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 4.22k]
  ------------------
 1220|      0|#ifndef SUPPRESS_WARNINGS
 1221|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1222|      0|#endif
 1223|      0|      continue;
 1224|      0|    }
 1225|  4.22k|    IptcKey key(to);
 1226|  4.22k|    Iptcdatum id(key);
 1227|  4.22k|    id.setValue(value);
 1228|  4.22k|    iptcData_->add(id);
 1229|  4.22k|    added = true;
 1230|  4.22k|  }
 1231|    208|  if (added)
  ------------------
  |  Branch (1231:7): [True: 188, False: 20]
  ------------------
 1232|    188|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    208|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 208]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    208|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.94k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.94k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.94k|  converter.cnvFromXmp();
 1333|  1.94k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.94k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.94k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.94k|  converter.cnvFromXmp();
 1371|  1.94k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  1.80k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  1.80k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 0, False: 1.80k]
  ------------------
 1382|      0|    return true;  // nothing to do
 1383|  1.80k|#ifdef EXV_HAVE_ICONV
 1384|  1.80k|  return convertStringCharsetIconv(str, from, to);
 1385|       |#elif defined _WIN32
 1386|       |  return convertStringCharsetWindows(str, from, to);
 1387|       |#else
 1388|       |#ifndef SUPPRESS_WARNINGS
 1389|       |  EXV_WARNING << "Charset conversion required but no character mapping functionality available.\n";
 1390|       |#endif
 1391|       |  return false;
 1392|       |#endif
 1393|  1.80k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  1.80k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  1.80k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 1.80k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  1.80k|  bool ret = true;
 1407|  1.80k|  auto cd = iconv_open(to.data(), from.data());
 1408|  1.80k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 1.80k]
  ------------------
 1409|      0|#ifndef SUPPRESS_WARNINGS
 1410|      0|    EXV_WARNING << "iconv_open: " << strError() << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1411|      0|#endif
 1412|      0|    return false;
 1413|      0|  }
 1414|  1.80k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  1.80k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  1.80k|#endif
 1420|  1.80k|  size_t inbytesleft = str.length();
 1421|  5.01k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 4.17k, False: 841]
  ------------------
 1422|  4.17k|    char outbuf[256];
 1423|  4.17k|    char* outptr = outbuf;
 1424|  4.17k|    size_t outbytesleft = sizeof(outbuf);
 1425|  4.17k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  4.17k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  4.17k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 3.75k, False: 420]
  |  Branch (1427:53): [True: 964, False: 2.78k]
  ------------------
 1428|    964|#ifndef SUPPRESS_WARNINGS
 1429|    964|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|    964|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 964]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    964|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|    964|#endif
 1431|    964|      ret = false;
 1432|    964|      break;
 1433|    964|    }
 1434|  3.20k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  3.20k|  }
 1436|       |
 1437|  1.80k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 1.80k, False: 0]
  ------------------
 1438|  1.80k|    iconv_close(cd);
 1439|       |
 1440|  1.80k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 841, False: 964]
  ------------------
 1441|    841|    str = std::move(outstr);
 1442|  1.80k|  return ret;
 1443|  1.80k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|    741|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|    741|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 265, False: 476]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    265|    value = pos->toString(0);
 1596|    265|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 172, False: 93]
  |  Branch (1596:31): [True: 69, False: 103]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|     69|      value = pos->toString();
 1600|     69|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 69, False: 0]
  |  Branch (1600:32): [True: 69, False: 0]
  ------------------
 1601|     69|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|     69|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 69, False: 0]
  ------------------
 1603|     69|          value = value.substr(first_space_pos + 1);
 1604|     69|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|     69|      }
 1608|     69|    }
 1609|    476|  } else {
 1610|    476|    value = pos->toString();
 1611|    476|  }
 1612|    741|  return pos->value().ok();
 1613|    741|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  34.9k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  34.9k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  34.9k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  34.9k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 34.9k]
  |  Branch (18:17): [True: 0, False: 34.9k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  34.9k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 3.94k, False: 31.0k]
  |  Branch (22:26): [True: 3.90k, False: 37]
  ------------------
   23|  3.90k|    setByteOrder(littleEndian);
   24|  31.0k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 7.58k, False: 23.4k]
  |  Branch (24:33): [True: 7.54k, False: 42]
  ------------------
   25|  7.54k|    setByteOrder(bigEndian);
   26|  23.5k|  } else {
   27|  23.5k|    return false;
   28|  23.5k|  }
   29|  11.4k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 919, False: 10.5k]
  ------------------
   30|    919|    return false;
   31|  10.5k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  10.5k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 10.2k, False: 256]
  ------------------
   33|  10.2k|    return false;
   34|    256|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|    256|  return true;
   37|  10.5k|}

_ZN5Exiv28Cr2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   24|     64|    Image(ImageType::cr2, mdExif | mdIptc | mdXmp, std::move(io), params) {
   25|     64|}  // Cr2Image::Cr2Image
_ZNK5Exiv28Cr2Image8mimeTypeEv:
   27|     72|std::string Cr2Image::mimeType() const {
   28|     72|  return "image/x-canon-cr2";
   29|     72|}
_ZNK5Exiv28Cr2Image10pixelWidthEv:
   31|     14|uint32_t Cr2Image::pixelWidth() const {
   32|     14|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
   33|     14|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (33:7): [True: 0, False: 14]
  |  Branch (33:7): [True: 0, False: 14]
  |  Branch (33:40): [True: 0, False: 0]
  ------------------
   34|      0|    return imageWidth->toUint32();
   35|      0|  }
   36|     14|  return 0;
   37|     14|}
_ZNK5Exiv28Cr2Image11pixelHeightEv:
   39|     14|uint32_t Cr2Image::pixelHeight() const {
   40|     14|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
   41|     14|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 14]
  |  Branch (41:7): [True: 0, False: 14]
  |  Branch (41:41): [True: 0, False: 0]
  ------------------
   42|      0|    return imageHeight->toUint32();
   43|      0|  }
   44|     14|  return 0;
   45|     14|}
_ZN5Exiv28Cr2Image12readMetadataEv:
   59|     64|void Cr2Image::readMetadata() {
   60|       |#ifdef EXIV2_DEBUG_MESSAGES
   61|       |  std::cerr << "Reading CR2 file " << io_->path() << "\n";
   62|       |#endif
   63|     64|  if (io_->open() != 0) {
  ------------------
  |  Branch (63:7): [True: 0, False: 64]
  ------------------
   64|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   65|      0|  }
   66|     64|  IoCloser closer(*io_);
   67|       |  // Ensure that this is the correct image type
   68|     64|  if (!isCr2Type(*io_, false)) {
  ------------------
  |  Branch (68:7): [True: 0, False: 64]
  ------------------
   69|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (69:9): [True: 0, False: 0]
  |  Branch (69:25): [True: 0, False: 0]
  ------------------
   70|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   71|      0|    throw Error(ErrorCode::kerNotAnImage, "CR2");
   72|      0|  }
   73|     64|  clearMetadata();
   74|     64|  const DecodeParams dp(max_recursion_depth_);
   75|     64|  ByteOrder bo = Cr2Parser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size(), dp);
   76|     64|  setByteOrder(bo);
   77|     64|}  // Cr2Image::readMetadata
_ZN5Exiv29Cr2Parser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmRKNS_12DecodeParamsE:
  104|     64|                            const DecodeParams& dp) {
  105|     64|  Internal::Cr2Header cr2Header;
  106|     64|  return Internal::TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Internal::Tag::root,
  107|     64|                                            Internal::TiffMapping::findDecoder, dp, &cr2Header);
  108|     64|}
_ZN5Exiv214newCr2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  133|     64|Image::UniquePtr newCr2Instance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  134|     64|  auto image = std::make_unique<Cr2Image>(std::move(io), params);
  135|     64|  if (!image->good()) {
  ------------------
  |  Branch (135:7): [True: 0, False: 64]
  ------------------
  136|      0|    return nullptr;
  137|      0|  }
  138|     64|  return image;
  139|     64|}
_ZN5Exiv29isCr2TypeERNS_7BasicIoEb:
  141|  35.0k|bool isCr2Type(BasicIo& iIo, bool advance) {
  142|  35.0k|  const int32_t len = 16;
  143|  35.0k|  byte buf[len];
  144|  35.0k|  iIo.read(buf, len);
  145|  35.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (145:7): [True: 0, False: 35.0k]
  |  Branch (145:22): [True: 143, False: 34.9k]
  ------------------
  146|    143|    return false;
  147|    143|  }
  148|  34.9k|  Internal::Cr2Header header;
  149|  34.9k|  bool rc = header.read(buf, len);
  150|  34.9k|  if (!advance || !rc) {
  ------------------
  |  Branch (150:7): [True: 34.9k, False: 0]
  |  Branch (150:19): [True: 0, False: 0]
  ------------------
  151|  34.9k|    iIo.seek(-len, BasicIo::cur);
  152|  34.9k|  }
  153|  34.9k|  return rc;
  154|  35.0k|}

_ZN5Exiv28CrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   27|    574|    Image(ImageType::crw, mdExif | mdComment, std::move(io), params) {
   28|    574|}  // CrwImage::CrwImage
_ZNK5Exiv28CrwImage8mimeTypeEv:
   30|    672|std::string CrwImage::mimeType() const {
   31|    672|  return "image/x-canon-crw";
   32|    672|}
_ZNK5Exiv28CrwImage10pixelWidthEv:
   34|     40|uint32_t CrwImage::pixelWidth() const {
   35|     40|  auto widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
   36|     40|  if (widthIter != exifData_.end() && widthIter->count() > 0) {
  ------------------
  |  Branch (36:7): [True: 0, False: 40]
  |  Branch (36:7): [True: 0, False: 40]
  |  Branch (36:39): [True: 0, False: 0]
  ------------------
   37|      0|    return widthIter->toUint32();
   38|      0|  }
   39|     40|  return 0;
   40|     40|}
_ZNK5Exiv28CrwImage11pixelHeightEv:
   42|     40|uint32_t CrwImage::pixelHeight() const {
   43|     40|  auto heightIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
   44|     40|  if (heightIter != exifData_.end() && heightIter->count() > 0) {
  ------------------
  |  Branch (44:7): [True: 0, False: 40]
  |  Branch (44:7): [True: 0, False: 40]
  |  Branch (44:40): [True: 0, False: 0]
  ------------------
   45|      0|    return heightIter->toUint32();
   46|      0|  }
   47|     40|  return 0;
   48|     40|}
_ZN5Exiv28CrwImage12readMetadataEv:
   55|    574|void CrwImage::readMetadata() {
   56|       |#ifdef EXIV2_DEBUG_MESSAGES
   57|       |  std::cerr << "Reading CRW file " << io_->path() << "\n";
   58|       |#endif
   59|    574|  if (io_->open()) {
  ------------------
  |  Branch (59:7): [True: 0, False: 574]
  ------------------
   60|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   61|      0|  }
   62|    574|  IoCloser closer(*io_);
   63|       |  // Ensure that this is the correct image type
   64|    574|  if (!isCrwType(*io_, false)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 574]
  ------------------
   65|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  |  Branch (65:25): [True: 0, False: 0]
  ------------------
   66|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   67|      0|    throw Error(ErrorCode::kerNotACrwImage);
   68|      0|  }
   69|    574|  clearMetadata();
   70|    574|  DataBuf file(io().size());
   71|    574|  io_->read(file.data(), file.size());
   72|       |
   73|    574|  CrwParser::decode(this, io_->mmap(), io_->size());
   74|       |
   75|    574|}  // CrwImage::readMetadata
_ZN5Exiv29CrwParser6decodeEPNS_8CrwImageEPKhm:
  107|    574|void CrwParser::decode(CrwImage* pCrwImage, const byte* pData, size_t size) {
  108|       |  // Parse the image, starting with a CIFF header component
  109|    574|  Internal::CiffHeader header;
  110|    574|  header.read(pData, size);
  111|    574|  header.decode(*pCrwImage);
  112|       |
  113|       |  // a hack to get absolute offset of preview image inside CRW structure
  114|    574|  if (auto preview = header.findComponent(0x2007, 0x0000)) {
  ------------------
  |  Branch (114:12): [True: 10, False: 564]
  ------------------
  115|     10|    (pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = static_cast<uint32_t>(preview->pData() - pData);
  116|     10|    (pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(preview->size());
  117|     10|  }
  118|    574|}  // CrwParser::decode
_ZN5Exiv214newCrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  135|    574|Image::UniquePtr newCrwInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  136|    574|  auto image = std::make_unique<CrwImage>(std::move(io), params);
  137|    574|  if (!image->good()) {
  ------------------
  |  Branch (137:7): [True: 0, False: 574]
  ------------------
  138|      0|    return nullptr;
  139|      0|  }
  140|    574|  return image;
  141|    574|}
_ZN5Exiv29isCrwTypeERNS_7BasicIoEb:
  143|  36.0k|bool isCrwType(BasicIo& iIo, bool advance) {
  144|  36.0k|  bool result = true;
  145|  36.0k|  byte tmpBuf[14];
  146|  36.0k|  iIo.read(tmpBuf, 14);
  147|  36.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (147:7): [True: 0, False: 36.0k]
  |  Branch (147:22): [True: 143, False: 35.8k]
  ------------------
  148|    143|    return false;
  149|    143|  }
  150|  35.8k|  if (('I' != tmpBuf[0] || 'I' != tmpBuf[1]) && ('M' != tmpBuf[0] || 'M' != tmpBuf[1])) {
  ------------------
  |  Branch (150:8): [True: 31.3k, False: 4.51k]
  |  Branch (150:28): [True: 37, False: 4.47k]
  |  Branch (150:50): [True: 23.4k, False: 7.91k]
  |  Branch (150:70): [True: 42, False: 7.87k]
  ------------------
  151|  23.5k|    result = false;
  152|  23.5k|  }
  153|  35.8k|  if (result && std::memcmp(tmpBuf + 6, Internal::CiffHeader::signature(), 8) != 0) {
  ------------------
  |  Branch (153:7): [True: 12.3k, False: 23.5k]
  |  Branch (153:17): [True: 10.6k, False: 1.72k]
  ------------------
  154|  10.6k|    result = false;
  155|  10.6k|  }
  156|  35.8k|  if (!advance || !result)
  ------------------
  |  Branch (156:7): [True: 35.8k, False: 0]
  |  Branch (156:19): [True: 0, False: 0]
  ------------------
  157|  35.8k|    iIo.seek(-14, BasicIo::cur);
  158|  35.8k|  return result;
  159|  36.0k|}

_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  127|  6.91k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  128|  6.91k|  return doAdd(std::move(component));
  129|  6.91k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  135|  6.91k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  136|  6.91k|  return components_.emplace_back(std::move(component));
  137|  6.91k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  141|    574|void CiffHeader::read(const byte* pData, size_t size) {
  142|    574|  if (size < 14)
  ------------------
  |  Branch (142:7): [True: 0, False: 574]
  ------------------
  143|      0|    throw Error(ErrorCode::kerNotACrwImage);
  144|       |
  145|    574|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (145:7): [True: 337, False: 237]
  |  Branch (145:26): [True: 337, False: 0]
  ------------------
  146|    337|    byteOrder_ = littleEndian;
  147|    337|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (147:14): [True: 237, False: 0]
  |  Branch (147:33): [True: 237, False: 0]
  ------------------
  148|    237|    byteOrder_ = bigEndian;
  149|    237|  } else {
  150|      0|    throw Error(ErrorCode::kerNotACrwImage);
  151|      0|  }
  152|    574|  offset_ = getULong(pData + 2, byteOrder_);
  153|    574|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (153:7): [True: 12, False: 562]
  |  Branch (153:23): [True: 53, False: 509]
  ------------------
  154|     65|    throw Error(ErrorCode::kerNotACrwImage);
  155|    509|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (155:7): [True: 0, False: 509]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotACrwImage);
  157|      0|  }
  158|       |
  159|    509|  pPadding_.clear();
  160|    509|  if (offset_ > 14) {
  ------------------
  |  Branch (160:7): [True: 351, False: 158]
  ------------------
  161|    351|    pPadding_.resize(offset_ - 14);
  162|    351|    padded_ = offset_ - 14;
  163|    351|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  164|    351|  }
  165|       |
  166|    509|  pRootDir_ = std::make_unique<CiffDirectory>();
  167|    509|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  168|    509|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  170|  7.08k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  171|  7.08k|  doRead(pData, size, start, byteOrder);
  172|  7.08k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  174|  7.08k|void CiffComponent::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  175|       |  // We're going read 10 bytes. Make sure they won't be out-of-bounds.
  176|  7.08k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (176:11): [True: 7.08k, False: 0]
  |  Branch (176:25): [True: 7.08k, False: 0]
  ------------------
  177|  7.08k|  tag_ = getUShort(pData + start, byteOrder);
  178|       |
  179|  7.08k|  DataLocId dl = dataLocation();
  180|       |
  181|  7.08k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (181:7): [True: 3.50k, False: 3.58k]
  ------------------
  182|  3.50k|    size_ = getULong(pData + start + 2, byteOrder);
  183|  3.50k|    offset_ = getULong(pData + start + 6, byteOrder);
  184|       |
  185|       |    // Make sure that the sub-region does not overlap with the 10 bytes
  186|       |    // that we just read. (Otherwise a malicious file could cause an
  187|       |    // infinite recursion.) There are two cases two consider because
  188|       |    // the sub-region is allowed to be either before or after the 10
  189|       |    // bytes in memory.
  190|  3.50k|    if (offset_ < start) {
  ------------------
  |  Branch (190:9): [True: 3.05k, False: 455]
  ------------------
  191|       |      // Sub-region is before in memory.
  192|  3.05k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  193|  3.05k|    } else {
  194|       |      // Sub-region is after in memory.
  195|    455|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  196|    455|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  197|    455|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  198|    455|    }
  199|  3.50k|  }
  200|  7.08k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (200:7): [True: 3.56k, False: 3.52k]
  ------------------
  201|  3.56k|    size_ = 8;
  202|  3.56k|    offset_ = start + 2;
  203|  3.56k|  }
  204|  7.08k|  pData_ = pData + offset_;
  205|       |#ifdef EXIV2_DEBUG_MESSAGES
  206|       |  std::cout << "  Entry for tag 0x" << std::hex << tagId() << " (0x" << tag() << "), " << std::dec << size_
  207|       |            << " Bytes, Offset is " << offset_ << "\n";
  208|       |#endif
  209|       |
  210|  7.08k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  212|  1.82k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  213|  1.82k|  CiffComponent::doRead(pData, size, start, byteOrder);
  214|       |#ifdef EXIV2_DEBUG_MESSAGES
  215|       |  std::cout << "Reading directory 0x" << std::hex << tag() << "\n";
  216|       |#endif
  217|  1.82k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (217:7): [True: 0, False: 1.82k]
  ------------------
  218|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  219|       |
  220|  1.82k|  readDirectory(pData + offset(), this->size(), byteOrder);
  221|       |#ifdef EXIV2_DEBUG_MESSAGES
  222|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  223|       |#endif
  224|  1.82k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  226|  2.31k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  227|  2.31k|  if (size < 4)
  ------------------
  |  Branch (227:7): [True: 16, False: 2.29k]
  ------------------
  228|     16|    throw Error(ErrorCode::kerCorruptedMetadata);
  229|  2.29k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  230|  2.29k|  if (o > size - 2)
  ------------------
  |  Branch (230:7): [True: 43, False: 2.25k]
  ------------------
  231|     43|    throw Error(ErrorCode::kerCorruptedMetadata);
  232|  2.25k|  uint16_t count = getUShort(pData + o, byteOrder);
  233|       |#ifdef EXIV2_DEBUG_MESSAGES
  234|       |  std::cout << "Directory at offset " << std::dec << o << ", " << count << " entries \n";
  235|       |#endif
  236|  2.25k|  o += 2;
  237|  2.25k|  if (count * 10u > size - o)
  ------------------
  |  Branch (237:7): [True: 22, False: 2.23k]
  ------------------
  238|     22|    throw Error(ErrorCode::kerCorruptedMetadata);
  239|       |
  240|  9.32k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (240:24): [True: 7.08k, False: 2.23k]
  ------------------
  241|  7.08k|    uint16_t tag = getUShort(pData + o, byteOrder);
  242|  7.08k|    auto m = [this, tag]() -> UniquePtr {
  243|  7.08k|      if (this->typeId(tag) == TypeId::directory)
  244|  7.08k|        return std::make_unique<CiffDirectory>();
  245|  7.08k|      return std::make_unique<CiffEntry>();
  246|  7.08k|    }();
  247|  7.08k|    m->setDir(this->tag());
  248|  7.08k|    m->read(pData, size, o, byteOrder);
  249|  7.08k|    add(std::move(m));
  250|  7.08k|    o += 10;
  251|  7.08k|  }
  252|  2.23k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  254|    265|void CiffHeader::decode(Image& image) const {
  255|       |  // Nothing to decode from the header itself, just add correct byte order
  256|    265|  if (pRootDir_)
  ------------------
  |  Branch (256:7): [True: 265, False: 0]
  ------------------
  257|    265|    pRootDir_->decode(image, byteOrder_);
  258|    265|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  260|  5.90k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  261|  5.90k|  doDecode(image, byteOrder);
  262|  5.90k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  264|  4.35k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  265|  4.35k|  CrwMap::decode(*this, image, byteOrder);
  266|  4.35k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  268|  1.55k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  269|  5.64k|  for (auto&& component : components_) {
  ------------------
  |  Branch (269:25): [True: 5.64k, False: 1.55k]
  ------------------
  270|  5.64k|    component->decode(image, byteOrder);
  271|  5.64k|  }
  272|  1.55k|}  // CiffDirectory::doDecode
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  436|  8.86k|TypeId CiffComponent::typeId(uint16_t tag) {
  437|  8.86k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (437:11): [True: 8.76k, False: 92]
  ------------------
  438|  1.94k|    case 0x0000:
  ------------------
  |  Branch (438:5): [True: 1.94k, False: 6.91k]
  ------------------
  439|  1.94k|      return unsignedByte;
  440|  1.77k|    case 0x0800:
  ------------------
  |  Branch (440:5): [True: 1.77k, False: 7.08k]
  ------------------
  441|  1.77k|      return asciiString;
  442|    844|    case 0x1000:
  ------------------
  |  Branch (442:5): [True: 844, False: 8.01k]
  ------------------
  443|    844|      return unsignedShort;
  444|  1.04k|    case 0x1800:
  ------------------
  |  Branch (444:5): [True: 1.04k, False: 7.81k]
  ------------------
  445|  1.04k|      return unsignedLong;
  446|  1.32k|    case 0x2000:
  ------------------
  |  Branch (446:5): [True: 1.32k, False: 7.53k]
  ------------------
  447|  1.32k|      return undefined;
  448|    292|    case 0x2800:
  ------------------
  |  Branch (448:5): [True: 292, False: 8.56k]
  ------------------
  449|  1.82k|    case 0x3000:
  ------------------
  |  Branch (449:5): [True: 1.53k, False: 7.32k]
  ------------------
  450|  1.82k|      return directory;
  451|  8.86k|  }
  452|     92|  return invalidTypeId;
  453|  8.86k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  455|  7.08k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  456|  7.08k|  switch (tag & 0xc000) {
  457|  3.50k|    case 0x0000:
  ------------------
  |  Branch (457:5): [True: 3.50k, False: 3.58k]
  ------------------
  458|  3.50k|      return DataLocId::valueData;
  459|  3.56k|    case 0x4000:
  ------------------
  |  Branch (459:5): [True: 3.56k, False: 3.52k]
  ------------------
  460|  3.56k|      return DataLocId::directoryData;
  461|     15|    default:
  ------------------
  |  Branch (461:5): [True: 15, False: 7.07k]
  ------------------
  462|     15|      throw Error(ErrorCode::kerCorruptedMetadata);
  463|  7.08k|  }
  464|  7.08k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  471|    265|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  472|    265|  if (!pRootDir_)
  ------------------
  |  Branch (472:7): [True: 0, False: 265]
  ------------------
  473|      0|    return nullptr;
  474|    265|  return pRootDir_->findComponent(crwTagId, crwDir);
  475|    265|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  477|  5.88k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  478|  5.88k|  return doFindComponent(crwTagId, crwDir);
  479|  5.88k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  481|  4.33k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  482|  4.33k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (482:7): [True: 75, False: 4.26k]
  |  Branch (482:30): [True: 10, False: 65]
  ------------------
  483|     10|    return this;
  484|     10|  }
  485|  4.32k|  return nullptr;
  486|  4.33k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  488|  1.55k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  489|  5.62k|  for (auto&& component : components_) {
  ------------------
  |  Branch (489:25): [True: 5.62k, False: 1.54k]
  ------------------
  490|  5.62k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (490:14): [True: 10, False: 5.61k]
  ------------------
  491|     10|      return cc;
  492|  5.62k|  }
  493|  1.54k|  return nullptr;
  494|  1.55k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  605|  4.35k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  606|  4.35k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  607|  4.35k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (607:7): [True: 689, False: 3.66k]
  |  Branch (607:14): [True: 689, False: 0]
  ------------------
  608|    689|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  609|    689|  }
  610|  4.35k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  612|  4.35k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  613|  87.1k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (613:19): [True: 87.1k, False: 3.66k]
  ------------------
  614|  87.1k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (614:9): [True: 11.0k, False: 76.1k]
  |  Branch (614:34): [True: 689, False: 10.3k]
  ------------------
  615|    689|      return &crw;
  616|    689|    }
  617|  87.1k|  }
  618|  3.66k|  return nullptr;
  619|  4.35k|}  // CrwMap::crwMapping
_ZN5Exiv28Internal6CrwMap12decode0x0805ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  622|     20|                          ByteOrder /*byteOrder*/) {
  623|     20|  auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
  624|     20|  image.setComment(s);
  625|     20|}  // CrwMap::decode0x0805
_ZN5Exiv28Internal6CrwMap12decode0x080aERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  628|    111|                          ByteOrder byteOrder) {
  629|    111|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (629:7): [True: 0, False: 111]
  ------------------
  630|      0|    return;
  631|       |
  632|       |  // Make
  633|    111|  ExifKey key1("Exif.Image.Make");
  634|    111|  auto value1 = Value::create(ciffComponent.typeId());
  635|    111|  uint32_t i = 0;
  636|    524|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (636:10): [True: 490, False: 34]
  ------------------
  637|    490|    ++i;
  638|    490|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (638:9): [True: 77, False: 413]
  ------------------
  639|     77|      break;
  640|     77|    }
  641|    490|  }
  642|    111|  value1->read(ciffComponent.pData(), i, byteOrder);
  643|    111|  image.exifData().add(key1, value1.get());
  644|       |
  645|       |  // Model
  646|    111|  ExifKey key2("Exif.Image.Model");
  647|    111|  auto value2 = Value::create(ciffComponent.typeId());
  648|    111|  uint32_t j = i;
  649|    339|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (649:10): [True: 281, False: 58]
  ------------------
  650|    281|    ++i;
  651|    281|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (651:9): [True: 53, False: 228]
  ------------------
  652|     53|      break;
  653|     53|    }
  654|    281|  }
  655|    111|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  656|    111|  image.exifData().add(key2, value2.get());
  657|    111|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  660|     62|                         ByteOrder byteOrder) {
  661|     62|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (661:7): [True: 0, False: 62]
  ------------------
  662|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  663|      0|    return;
  664|      0|  }
  665|       |
  666|     62|  int64_t aperture = 0;
  667|     62|  int64_t shutterSpeed = 0;
  668|       |
  669|     62|  auto ifdId = [pCrwMapping] {
  670|     62|    if (pCrwMapping->tag_ == 0x0001)
  671|     62|      return IfdId::canonCsId;
  672|     62|    if (pCrwMapping->tag_ == 0x0004)
  673|     62|      return IfdId::canonSiId;
  674|     62|    if (pCrwMapping->tag_ == 0x000f)
  675|     62|      return IfdId::canonCfId;
  676|     62|    if (pCrwMapping->tag_ == 0x0012)
  677|     62|      return IfdId::canonPiId;
  678|     62|    return IfdId::ifdIdNotSet;
  679|     62|  }();
  680|       |
  681|     62|  std::string groupName(Internal::groupName(ifdId));
  682|     62|  const size_t component_size = ciffComponent.size();
  683|     62|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  684|     62|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  685|     62|          ErrorCode::kerCorruptedMetadata);
  686|     62|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  687|     62|  uint16_t c = 1;
  688|    248|  while (c < num_components) {
  ------------------
  |  Branch (688:10): [True: 186, False: 62]
  ------------------
  689|    186|    uint16_t n = 1;
  690|    186|    ExifKey key(c, groupName);
  691|    186|    UShortValue value;
  692|    186|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (692:9): [True: 33, False: 153]
  |  Branch (692:38): [True: 0, False: 33]
  |  Branch (692:49): [True: 0, False: 0]
  ------------------
  693|      0|      n = 3;
  694|    186|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  695|    186|    image.exifData().add(key, &value);
  696|    186|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (696:9): [True: 63, False: 123]
  |  Branch (696:38): [True: 0, False: 63]
  ------------------
  697|      0|      aperture = value.toInt64();
  698|    186|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (698:9): [True: 63, False: 123]
  |  Branch (698:38): [True: 0, False: 63]
  ------------------
  699|      0|      shutterSpeed = value.toInt64();
  700|    186|    c += n;
  701|    186|  }
  702|       |
  703|     62|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (703:7): [True: 21, False: 41]
  ------------------
  704|       |    // Exif.Photo.FNumber
  705|     21|    float f = fnumber(canonEv(aperture));
  706|     21|    auto [r, s] = floatToRationalCast(f);
  707|     21|    auto ur = URational(r, s);
  708|     21|    URationalValue fn;
  709|     21|    fn.value_.push_back(ur);
  710|     21|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  711|       |
  712|       |    // Exif.Photo.ExposureTime
  713|     21|    ur = exposureTime(canonEv(shutterSpeed));
  714|     21|    URationalValue et;
  715|     21|    et.value_.push_back(ur);
  716|     21|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  717|     21|  }
  718|     62|}  // CrwMap::decodeArray
_ZN5Exiv28Internal6CrwMap12decode0x180eERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  721|     22|                          ByteOrder byteOrder) {
  722|     22|  if (ciffComponent.size() < 8 || ciffComponent.typeId() != unsignedLong) {
  ------------------
  |  Branch (722:7): [True: 0, False: 22]
  |  Branch (722:35): [True: 0, False: 22]
  ------------------
  723|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  724|      0|    return;
  725|      0|  }
  726|     22|  ULongValue v;
  727|     22|  v.read(ciffComponent.pData(), 8, byteOrder);
  728|     22|  time_t t = v.value_.at(0);
  729|     22|  std::tm r;
  730|       |#ifdef _WIN32
  731|       |  auto tm = localtime_s(&r, &t) ? nullptr : &r;
  732|       |#else
  733|     22|  auto tm = localtime_r(&t, &r);
  734|     22|#endif
  735|     22|  if (!tm)
  ------------------
  |  Branch (735:7): [True: 0, False: 22]
  ------------------
  736|      0|    return;
  737|     22|  const size_t m = 20;
  738|     22|  char s[m];
  739|     22|  std::strftime(s, m, "%Y:%m:%d %T", tm);
  740|       |
  741|     22|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  742|     22|  AsciiValue value;
  743|     22|  value.read(s);
  744|     22|  image.exifData().add(key, &value);
  745|     22|}  // CrwMap::decode0x180e
_ZN5Exiv28Internal6CrwMap12decode0x1810ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  748|     40|                          ByteOrder byteOrder) {
  749|     40|  if (ciffComponent.typeId() != unsignedLong || ciffComponent.size() < 28) {
  ------------------
  |  Branch (749:7): [True: 0, False: 40]
  |  Branch (749:49): [True: 40, False: 0]
  ------------------
  750|     40|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  751|     40|    return;
  752|     40|  }
  753|       |
  754|      0|  ExifKey key1("Exif.Photo.PixelXDimension");
  755|      0|  ULongValue value1;
  756|      0|  value1.read(ciffComponent.pData(), 4, byteOrder);
  757|      0|  image.exifData().add(key1, &value1);
  758|       |
  759|      0|  ExifKey key2("Exif.Photo.PixelYDimension");
  760|      0|  ULongValue value2;
  761|      0|  value2.read(ciffComponent.pData() + 4, 4, byteOrder);
  762|      0|  image.exifData().add(key2, &value2);
  763|       |
  764|      0|  int32_t r = getLong(ciffComponent.pData() + 12, byteOrder);
  765|      0|  uint16_t o = RotationMap::orientation(r);
  766|      0|  image.exifData()["Exif.Image.Orientation"] = o;
  767|       |
  768|      0|}  // CrwMap::decode0x1810
_ZN5Exiv28Internal6CrwMap12decode0x2008ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  771|     28|                          ByteOrder /*byteOrder*/) {
  772|     28|  ExifThumb exifThumb(image.exifData());
  773|     28|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  774|     28|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  777|    446|                         ByteOrder byteOrder) {
  778|       |  // create a key and value pair
  779|    446|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  780|    446|  Value::UniquePtr value;
  781|    446|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (781:7): [True: 446, False: 0]
  ------------------
  782|    446|    value = Value::create(ciffComponent.typeId());
  783|    446|    size_t size = 0;
  784|    446|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (784:9): [True: 21, False: 425]
  ------------------
  785|     21|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  786|    425|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (786:16): [True: 199, False: 226]
  ------------------
  787|       |      // determine size from the data, by looking for the first 0
  788|    199|      uint32_t i = 0;
  789|  1.12k|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (789:14): [True: 1.07k, False: 46]
  ------------------
  790|  1.07k|        ++i;
  791|  1.07k|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (791:13): [True: 153, False: 922]
  ------------------
  792|    153|          break;
  793|    153|        }
  794|  1.07k|      }
  795|    199|      size = i;
  796|    226|    } else {
  797|       |      // by default, use the size from the directory entry
  798|    226|      size = ciffComponent.size();
  799|    226|    }
  800|    446|    enforce(size <= ciffComponent.size(), ErrorCode::kerCorruptedMetadata);
  801|    446|    value->read(ciffComponent.pData(), size, byteOrder);
  802|    446|  }
  803|       |  // Add metadatum to exif data
  804|    446|  image.exifData().add(key, value.get());
  805|    446|}  // CrwMap::decodeBasic
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  242|  7.08k|    auto m = [this, tag]() -> UniquePtr {
  243|  7.08k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (243:11): [True: 1.82k, False: 5.26k]
  ------------------
  244|  1.82k|        return std::make_unique<CiffDirectory>();
  245|  5.26k|      return std::make_unique<CiffEntry>();
  246|  7.08k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderEENK3$_0clEv:
  669|     62|  auto ifdId = [pCrwMapping] {
  670|     62|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (670:9): [True: 11, False: 51]
  ------------------
  671|     11|      return IfdId::canonCsId;
  672|     51|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (672:9): [True: 21, False: 30]
  ------------------
  673|     21|      return IfdId::canonSiId;
  674|     30|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (674:9): [True: 10, False: 20]
  ------------------
  675|     10|      return IfdId::canonCfId;
  676|     20|    if (pCrwMapping->tag_ == 0x0012)
  ------------------
  |  Branch (676:9): [True: 20, False: 0]
  ------------------
  677|     20|      return IfdId::canonPiId;
  678|      0|    return IfdId::ifdIdNotSet;
  679|     20|  }();

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  2.78k|  [[nodiscard]] const byte* pData() const {
  214|  2.78k|    return pData_;
  215|  2.78k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  6.44k|  [[nodiscard]] size_t size() const {
  204|  6.44k|    return size_;
  205|  6.44k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  12.8k|  static auto signature() {
  419|  12.8k|    return signature_;
  420|  12.8k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  7.08k|  void setDir(uint16_t dir) {
  147|  7.08k|    dir_ = dir;
  148|  7.08k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  4.43k|  [[nodiscard]] uint16_t dir() const {
  184|  4.43k|    return dir_;
  185|  4.43k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|  7.08k|  [[nodiscard]] uint16_t tag() const {
  189|  7.08k|    return tag_;
  190|  7.08k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  3.61k|  [[nodiscard]] size_t offset() const {
  209|  3.61k|    return offset_;
  210|  3.61k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  8.69k|  [[nodiscard]] uint16_t tagId() const {
  219|  8.69k|    return tag_ & 0x3fff;
  220|  8.69k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  1.77k|  [[nodiscard]] TypeId typeId() const {
  224|  1.77k|    return typeId(tag_);
  225|  1.77k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  7.08k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  7.08k|    return dataLocation(tag_);
  230|  7.08k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  7.59k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  7.59k|  virtual ~CiffComponent() = default;

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   136k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   136k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 68.0k, False: 68.1k]
  |  Branch (378:31): [True: 17.9k, False: 50.1k]
  ------------------
  379|  17.9k|    return -1;
  380|   118k|  const DataSet* dataSet = records_[recordId];
  381|   118k|  int idx;
  382|  1.88M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 1.77M, False: 105k]
  ------------------
  383|  1.77M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 12.6k, False: 1.76M]
  ------------------
  384|  12.6k|      return -1;
  385|  1.77M|  }
  386|   105k|  return idx;
  387|   118k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  5.56k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  5.56k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 5.09k, False: 468]
  |  Branch (390:31): [True: 0, False: 5.09k]
  ------------------
  391|      0|    return -1;
  392|  5.56k|  const DataSet* dataSet = records_[recordId];
  393|  5.56k|  int idx;
  394|   146k|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 141k, False: 5.56k]
  ------------------
  395|   141k|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 141k]
  ------------------
  396|      0|      return -1;
  397|   141k|  }
  398|  5.56k|  return idx;
  399|  5.56k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  45.3k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  45.3k|  int idx = dataSetIdx(number, recordId);
  403|  45.3k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 10.1k, False: 35.1k]
  ------------------
  404|  10.1k|    return unknownDataSet.type_;
  405|  35.1k|  return records_[recordId][idx].type_;
  406|  45.3k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|  46.0k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|  46.0k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 35.9k, False: 10.1k]
  ------------------
  410|  35.9k|    return records_[recordId][idx].name_;
  411|       |
  412|  10.1k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  10.1k|#define stringFormat std::format
  ------------------
  413|  46.0k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  44.7k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  44.7k|  int idx = dataSetIdx(number, recordId);
  438|  44.7k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 10.1k, False: 34.5k]
  ------------------
  439|  10.1k|    return unknownDataSet.repeatable_;
  440|  34.5k|  return records_[recordId][idx].repeatable_;
  441|  44.7k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  5.56k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  5.56k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 5.56k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  5.56k|    return records_[recordId][idx].number_;
  447|  5.56k|  }
  448|      0|  if (!isHex(dataSetName, 4, "0x"))
  ------------------
  |  Branch (448:7): [True: 0, False: 0]
  ------------------
  449|      0|    throw Error(ErrorCode::kerInvalidDataset, dataSetName);
  450|      0|  return static_cast<uint16_t>(std::stoi(dataSetName, nullptr, 16));
  451|      0|}
_ZN5Exiv212IptcDataSets10recordNameEt:
  453|  46.0k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|  46.0k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 22.9k, False: 23.1k]
  |  Branch (454:31): [True: 17.2k, False: 5.97k]
  ------------------
  455|  40.1k|    return recordInfo_[recordId].name_;
  456|  40.1k|  }
  457|       |
  458|  5.97k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  5.97k|#define stringFormat std::format
  ------------------
  459|  46.0k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  5.56k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  5.56k|  uint16_t i;
  470|  6.03k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 6.03k, False: 0]
  ------------------
  471|  6.03k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 5.56k, False: 468]
  ------------------
  472|  5.56k|      break;
  473|  6.03k|  }
  474|  5.56k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 5.56k]
  ------------------
  475|      0|    if (!isHex(recordName, 4, "0x"))
  ------------------
  |  Branch (475:9): [True: 0, False: 0]
  ------------------
  476|      0|      throw Error(ErrorCode::kerInvalidRecord, recordName);
  477|      0|    i = static_cast<uint16_t>(std::stoi(recordName, nullptr, 16));
  478|      0|  }
  479|  5.56k|  return i;
  480|  5.56k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  5.56k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  5.56k|  decomposeKey();
  492|  5.56k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  40.5k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  40.5k|  makeKey();
  496|  40.5k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   277k|uint16_t IptcKey::tag() const {
  523|   277k|  return tag_;
  524|   277k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   112k|uint16_t IptcKey::record() const {
  531|   112k|  return record_;
  532|   112k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|  78.4k|IptcKey::UniquePtr IptcKey::clone() const {
  535|  78.4k|  return UniquePtr(clone_());
  536|  78.4k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|  78.4k|IptcKey* IptcKey::clone_() const {
  539|  78.4k|  return new IptcKey(*this);
  540|  78.4k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  5.56k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  5.56k|  auto posDot1 = key_.find('.');
  545|  5.56k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  5.56k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 5.56k]
  |  Branch (547:39): [True: 0, False: 5.56k]
  ------------------
  548|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  549|      0|  }
  550|       |
  551|       |  // Get the family name, record name and dataSet name parts of the key
  552|  5.56k|  const std::string familyName = key_.substr(0, posDot1);
  553|  5.56k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 5.56k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  5.56k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  5.56k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  5.56k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  5.56k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  5.56k|  recordName = IptcDataSets::recordName(recId);
  565|  5.56k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  5.56k|  tag_ = dataSet;
  568|  5.56k|  record_ = recId;
  569|  5.56k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  5.56k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  40.5k|void IptcKey::makeKey() {
  573|  40.5k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  40.5k|         IptcDataSets::dataSetName(tag_, record_);
  575|  40.5k|}

_ZN5Exiv28Internal7enforceIJEEEvbNS_9ErrorCodeEDpOT_:
   46|  6.22M|constexpr void enforce(bool condition, Exiv2::ErrorCode err_code, T&&... args) {
   47|  6.22M|  enforce<Exiv2::Error>(condition, err_code, std::forward<T>(args)...);
   48|  6.22M|}
_ZN5Exiv28Internal7enforceINS_5ErrorEJRNS_9ErrorCodeEEEEvbDpOT0_:
   35|  6.22M|constexpr void enforce(bool condition, T&&... args) {
   36|  6.22M|  if (!condition) {
  ------------------
  |  Branch (36:7): [True: 9.77k, False: 6.21M]
  ------------------
   37|  9.77k|    throw exception_t(std::forward<T>(args)...);
   38|  9.77k|  }
   39|  6.22M|}

_ZN5Exiv28EpsImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1027|  3.37k|    Image(ImageType::eps, mdXmp, std::move(io), params) {
 1028|       |  // LogMsg::setLevel(LogMsg::debug);
 1029|  3.37k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (1029:7): [True: 0, False: 3.37k]
  |  Branch (1029:26): [True: 0, False: 0]
  ------------------
 1030|       |#ifdef DEBUG
 1031|       |    EXV_DEBUG << "Exiv2::EpsImage:: Creating blank EPS image\n";
 1032|       |#endif
 1033|      0|    IoCloser closer(*io_);
 1034|      0|    if (io_->write(reinterpret_cast<const byte*>(epsBlank.data()), epsBlank.size()) != epsBlank.size()) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 0]
  ------------------
 1035|      0|#ifndef SUPPRESS_WARNINGS
 1036|      0|      EXV_WARNING << "Failed to write blank EPS image.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1037|      0|#endif
 1038|      0|      throw Error(ErrorCode::kerImageWriteFailed);
 1039|      0|    }
 1040|      0|  }
 1041|  3.37k|}
_ZNK5Exiv28EpsImage8mimeTypeEv:
 1043|  4.78k|std::string EpsImage::mimeType() const {
 1044|  4.78k|  return "application/postscript";
 1045|  4.78k|}
_ZN5Exiv28EpsImage12readMetadataEv:
 1051|  3.37k|void EpsImage::readMetadata() {
 1052|       |#ifdef DEBUG
 1053|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Reading EPS file " << io_->path() << "\n";
 1054|       |#endif
 1055|       |
 1056|       |  // read metadata
 1057|  3.37k|  readWriteEpsMetadata(*io_, xmpPacket_, nativePreviews_, /* write = */ false);
 1058|       |
 1059|       |  // decode XMP metadata
 1060|  3.37k|  const DecodeParams dp(max_recursion_depth_);
 1061|  3.37k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp) > 1) {
  ------------------
  |  Branch (1061:7): [True: 371, False: 2.99k]
  |  Branch (1061:30): [True: 142, False: 229]
  ------------------
 1062|    142|#ifndef SUPPRESS_WARNINGS
 1063|    142|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    142|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 142]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    142|  LogMsg(LogMsg::warn).os()
  ------------------
 1064|    142|#endif
 1065|    142|    throw Error(ErrorCode::kerFailedToReadImageData);
 1066|    142|  }
 1067|       |
 1068|       |#ifdef DEBUG
 1069|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Finished reading EPS file " << io_->path() << "\n";
 1070|       |#endif
 1071|  3.37k|}
_ZN5Exiv214newEpsInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1096|  3.37k|Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1097|  3.37k|  auto image = std::make_unique<EpsImage>(std::move(io), params);
 1098|  3.37k|  if (!image->good()) {
  ------------------
  |  Branch (1098:7): [True: 0, False: 3.37k]
  ------------------
 1099|      0|    return nullptr;
 1100|      0|  }
 1101|  3.37k|  return image;
 1102|  3.37k|}
_ZN5Exiv29isEpsTypeERNS_7BasicIoEb:
 1104|  24.3k|bool isEpsType(BasicIo& iIo, bool advance) {
 1105|       |  // read as many bytes as needed for the longest (DOS) EPS signature
 1106|  24.3k|  constexpr auto bufSize = [] {
 1107|  24.3k|    auto f = [](const auto& a, const auto& b) { return a.size() < b.size(); };
 1108|  24.3k|    return std::max_element(epsFirstLine.begin(), epsFirstLine.end(), f)->size();
 1109|  24.3k|  }();
 1110|  24.3k|  const size_t restore = iIo.tell();  // save
 1111|  24.3k|  DataBuf buf = iIo.read(bufSize);
 1112|  24.3k|  if (iIo.error() || buf.size() != bufSize) {
  ------------------
  |  Branch (1112:7): [True: 0, False: 24.3k]
  |  Branch (1112:22): [True: 0, False: 24.3k]
  ------------------
 1113|      0|    iIo.seek(restore, BasicIo::beg);
 1114|      0|    return false;
 1115|      0|  }
 1116|       |  // check for all possible (DOS) EPS signatures
 1117|  24.3k|  bool matched = (buf.cmpBytes(0, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
 1118|  24.3k|  if (!matched) {
  ------------------
  |  Branch (1118:7): [True: 23.3k, False: 984]
  ------------------
 1119|  62.6k|    for (auto&& eps : epsFirstLine) {
  ------------------
  |  Branch (1119:21): [True: 62.6k, False: 17.6k]
  ------------------
 1120|  62.6k|      if (buf.cmpBytes(0, eps.data(), eps.size()) == 0) {
  ------------------
  |  Branch (1120:11): [True: 5.75k, False: 56.9k]
  ------------------
 1121|  5.75k|        matched = true;
 1122|  5.75k|        break;
 1123|  5.75k|      }
 1124|  62.6k|    }
 1125|  23.3k|  }
 1126|       |  // seek back if possible and requested
 1127|  24.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (1127:7): [True: 24.3k, False: 0]
  |  Branch (1127:19): [True: 0, False: 0]
  ------------------
 1128|  24.3k|    iIo.seek(restore, BasicIo::beg);
 1129|  24.3k|  }
 1130|  24.3k|  return matched;
 1131|  24.3k|}
epsimage.cpp:_ZN12_GLOBAL__N_120readWriteEpsMetadataERN5Exiv27BasicIoERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS3_6vectorINS0_13NativePreviewENS7_ISC_EEEEb:
  224|  3.37k|void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList& nativePreviews, bool write) {
  225|       |  // open input file
  226|  3.37k|  if (io.open() != 0) {
  ------------------
  |  Branch (226:7): [True: 0, False: 3.37k]
  ------------------
  227|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  228|      0|  }
  229|  3.37k|  IoCloser closer(io);
  230|       |
  231|       |  // read from input file via memory map
  232|  3.37k|  const byte* data = io.mmap();
  233|       |
  234|       |  // default positions and sizes
  235|  3.37k|  const size_t size = io.size();
  236|  3.37k|  size_t posEps = 0;
  237|  3.37k|  size_t posEndEps = size;
  238|  3.37k|  uint32_t posWmf = 0;
  239|  3.37k|  uint32_t sizeWmf = 0;
  240|  3.37k|  uint32_t posTiff = 0;
  241|  3.37k|  uint32_t sizeTiff = 0;
  242|       |
  243|  3.37k|  ErrorCode errcode = write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData;
  ------------------
  |  Branch (243:23): [True: 0, False: 3.37k]
  ------------------
  244|       |
  245|       |  // check for DOS EPS
  246|  3.37k|  const bool dosEps =
  247|  3.37k|      (size >= dosEpsSignature.size() && memcmp(data, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
  ------------------
  |  Branch (247:8): [True: 3.37k, False: 0]
  |  Branch (247:42): [True: 492, False: 2.87k]
  ------------------
  248|  3.37k|  if (dosEps) {
  ------------------
  |  Branch (248:7): [True: 492, False: 2.87k]
  ------------------
  249|       |#ifdef DEBUG
  250|       |    EXV_DEBUG << "readWriteEpsMetadata: Found DOS EPS signature\n";
  251|       |#endif
  252|       |
  253|    492|    enforce(size >= 30, errcode);
  254|    492|    posEps = getULong(data + 4, littleEndian);
  255|    492|    posEndEps = getULong(data + 8, littleEndian) + posEps;
  256|    492|    posWmf = getULong(data + 12, littleEndian);
  257|    492|    sizeWmf = getULong(data + 16, littleEndian);
  258|    492|    posTiff = getULong(data + 20, littleEndian);
  259|    492|    sizeTiff = getULong(data + 24, littleEndian);
  260|       |#ifdef DEBUG
  261|       |    EXV_DEBUG << "readWriteEpsMetadata: EPS section at position " << posEps << ", size " << (posEndEps - posEps)
  262|       |              << "\n";
  263|       |    EXV_DEBUG << "readWriteEpsMetadata: WMF section at position " << posWmf << ", size " << sizeWmf << "\n";
  264|       |    EXV_DEBUG << "readWriteEpsMetadata: TIFF section at position " << posTiff << ", size " << sizeTiff << "\n";
  265|       |#endif
  266|    492|    if (uint16_t checksum = getUShort(data + 28, littleEndian); checksum != 0xFFFF) {
  ------------------
  |  Branch (266:65): [True: 435, False: 57]
  ------------------
  267|       |#ifdef DEBUG
  268|       |      EXV_DEBUG << "readWriteEpsMetadata: DOS EPS checksum is not FFFF\n";
  269|       |#endif
  270|    435|    }
  271|    492|    if ((posWmf != 0 || sizeWmf != 0) && (posTiff != 0 || sizeTiff != 0)) {
  ------------------
  |  Branch (271:10): [True: 343, False: 149]
  |  Branch (271:25): [True: 40, False: 109]
  |  Branch (271:43): [True: 278, False: 93]
  |  Branch (271:59): [True: 55, False: 38]
  ------------------
  272|    333|#ifndef SUPPRESS_WARNINGS
  273|    333|      EXV_WARNING << "DOS EPS file has both WMF and TIFF section. Only one of those is allowed.\n";
  ------------------
  |  |  138|    333|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 333]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    333|  LogMsg(LogMsg::warn).os()
  ------------------
  274|    333|#endif
  275|    333|      if (write)
  ------------------
  |  Branch (275:11): [True: 0, False: 333]
  ------------------
  276|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  277|    333|    }
  278|    492|    if (sizeWmf == 0 && sizeTiff == 0) {
  ------------------
  |  Branch (278:9): [True: 233, False: 259]
  |  Branch (278:25): [True: 77, False: 156]
  ------------------
  279|     77|#ifndef SUPPRESS_WARNINGS
  280|     77|      EXV_WARNING << "DOS EPS file has neither WMF nor TIFF section. Exactly one of those is required.\n";
  ------------------
  |  |  138|     77|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 77]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     77|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     77|#endif
  282|     77|      if (write)
  ------------------
  |  Branch (282:11): [True: 0, False: 77]
  ------------------
  283|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  284|     77|    }
  285|    492|    enforce(30 <= posEps, errcode);
  286|    492|    enforce(sizeWmf == 0 || 30 <= posWmf, errcode);
  ------------------
  |  Branch (286:13): [True: 260, False: 232]
  |  Branch (286:29): [True: 190, False: 42]
  ------------------
  287|    492|    enforce(sizeTiff == 0 || 30 <= posTiff, errcode);
  ------------------
  |  Branch (287:13): [True: 173, False: 319]
  |  Branch (287:30): [True: 258, False: 61]
  ------------------
  288|       |
  289|    492|    enforce(posEps <= posEndEps && posEndEps <= size, errcode);
  ------------------
  |  Branch (289:13): [True: 345, False: 147]
  |  Branch (289:36): [True: 182, False: 163]
  ------------------
  290|    492|    enforce(posWmf <= size && sizeWmf <= size - posWmf, errcode);
  ------------------
  |  Branch (290:13): [True: 151, False: 341]
  |  Branch (290:31): [True: 122, False: 29]
  ------------------
  291|    492|    enforce(posTiff <= size && sizeTiff <= size - posTiff, errcode);
  ------------------
  |  Branch (291:13): [True: 94, False: 398]
  |  Branch (291:32): [True: 68, False: 26]
  ------------------
  292|    492|  }
  293|       |
  294|       |  // check first line
  295|  3.37k|  std::string firstLine;
  296|  3.37k|  const size_t posSecondLine = readLine(firstLine, data, posEps, posEndEps);
  297|       |#ifdef DEBUG
  298|       |  EXV_DEBUG << "readWriteEpsMetadata: First line: " << firstLine << "\n";
  299|       |#endif
  300|  3.37k|  auto it = std::find(epsFirstLine.begin(), epsFirstLine.end(), firstLine);
  301|  3.37k|  if (it == epsFirstLine.end()) {
  ------------------
  |  Branch (301:7): [True: 112, False: 3.25k]
  ------------------
  302|    112|    throw Error(ErrorCode::kerNotAnImage, "EPS");
  303|    112|  }
  304|       |
  305|       |  // determine line ending style of the first line
  306|  3.25k|  if (posSecondLine >= posEndEps) {
  ------------------
  |  Branch (306:7): [True: 12, False: 3.24k]
  ------------------
  307|     12|#ifndef SUPPRESS_WARNINGS
  308|     12|    EXV_WARNING << "Premature end of file after first line.\n";
  ------------------
  |  |  138|     12|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 12]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     12|  LogMsg(LogMsg::warn).os()
  ------------------
  309|     12|#endif
  310|     12|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (310:17): [True: 0, False: 12]
  ------------------
  311|     12|  }
  312|  3.24k|  const std::string lineEnding(reinterpret_cast<const char*>(data + posEps + firstLine.size()),
  313|  3.24k|                               posSecondLine - (posEps + firstLine.size()));
  314|       |#ifdef DEBUG
  315|       |  if (lineEnding == "\n") {
  316|       |    EXV_DEBUG << "readWriteEpsMetadata: Line ending style: Unix (LF)\n";
  317|       |  } else if (lineEnding == "\r") {
  318|       |    EXV_DEBUG << "readWriteEpsMetadata: Line ending style: Mac (CR)\n";
  319|       |  } else if (lineEnding == "\r\n") {
  320|       |    EXV_DEBUG << "readWriteEpsMetadata: Line ending style: DOS (CR LF)\n";
  321|       |  } else {
  322|       |    EXV_DEBUG << "readWriteEpsMetadata: Line ending style: (unknown)\n";
  323|       |  }
  324|       |#endif
  325|       |
  326|       |  // scan comments
  327|  3.24k|  size_t posLanguageLevel = posEndEps;
  328|  3.24k|  size_t posContainsXmp = posEndEps;
  329|  3.24k|  size_t posPages = posEndEps;
  330|  3.24k|  size_t posExiv2Version = posEndEps;
  331|  3.24k|  size_t posExiv2Website = posEndEps;
  332|  3.24k|  size_t posEndComments = posEndEps;
  333|  3.24k|  size_t posAi7Thumbnail = posEndEps;
  334|  3.24k|  size_t posAi7ThumbnailEndData = posEndEps;
  335|  3.24k|  size_t posBeginPhotoshop = posEndEps;
  336|  3.24k|  size_t posEndPhotoshop = posEndEps;
  337|  3.24k|  size_t posPage = posEndEps;
  338|  3.24k|  size_t posBeginPageSetup = posEndEps;
  339|  3.24k|  size_t posEndPageSetup = posEndEps;
  340|  3.24k|  size_t posPageTrailer = posEndEps;
  341|  3.24k|  size_t posEof = posEndEps;
  342|  3.24k|  std::vector<std::pair<size_t, size_t>> removableEmbeddings;
  343|  3.24k|  size_t depth = 0;
  344|  3.24k|  const size_t maxDepth = std::numeric_limits<size_t>::max();
  345|  3.24k|  bool illustrator8 = false;
  346|  3.24k|  bool corelDraw = false;
  347|  3.24k|  bool implicitPage = false;
  348|  3.24k|  bool implicitPageSetup = false;
  349|  3.24k|  bool implicitPageTrailer = false;
  350|  3.24k|  bool inDefaultsPreviewPrologSetup = false;
  351|  3.24k|  bool inRemovableEmbedding = false;
  352|  3.24k|  std::string removableEmbeddingEndLine;
  353|  3.24k|  size_t removableEmbeddingsWithUnmarkedTrailer = 0;
  354|   392k|  for (size_t pos = posEps; pos < posEof;) {
  ------------------
  |  Branch (354:29): [True: 388k, False: 3.18k]
  ------------------
  355|   388k|    const size_t startPos = pos;
  356|   388k|    std::string line;
  357|   388k|    pos = readLine(line, data, startPos, posEndEps);
  358|       |#ifdef DEBUG
  359|       |    bool significantLine = true;
  360|       |#endif
  361|       |    // nested documents
  362|   388k|    if (posPage == posEndEps && (line.starts_with("%%IncludeDocument:") || line.starts_with("%%BeginDocument:"))) {
  ------------------
  |  Branch (362:9): [True: 78.2k, False: 310k]
  |  Branch (362:34): [True: 16, False: 78.2k]
  |  Branch (362:76): [True: 10, False: 78.1k]
  ------------------
  363|     26|#ifndef SUPPRESS_WARNINGS
  364|     26|      EXV_WARNING << "Nested document at invalid position: " << startPos << "\n";
  ------------------
  |  |  138|     26|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 26]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     26|  LogMsg(LogMsg::warn).os()
  ------------------
  365|     26|#endif
  366|     26|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (366:19): [True: 0, False: 26]
  ------------------
  367|     26|    }
  368|   388k|    if (line.starts_with("%%BeginDocument:")) {
  ------------------
  |  Branch (368:9): [True: 41.7k, False: 347k]
  ------------------
  369|  41.7k|      if (depth == maxDepth) {
  ------------------
  |  Branch (369:11): [True: 0, False: 41.7k]
  ------------------
  370|      0|#ifndef SUPPRESS_WARNINGS
  371|      0|        EXV_WARNING << "Document too deeply nested at position: " << startPos << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  372|      0|#endif
  373|      0|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (373:21): [True: 0, False: 0]
  ------------------
  374|      0|      }
  375|  41.7k|      depth++;
  376|   347k|    } else if (line.starts_with("%%EndDocument")) {
  ------------------
  |  Branch (376:16): [True: 211, False: 347k]
  ------------------
  377|    211|      if (depth == 0) {
  ------------------
  |  Branch (377:11): [True: 11, False: 200]
  ------------------
  378|     11|#ifndef SUPPRESS_WARNINGS
  379|     11|        EXV_WARNING << "Unmatched EndDocument at position: " << startPos << "\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  380|     11|#endif
  381|     11|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (381:21): [True: 0, False: 11]
  ------------------
  382|     11|      }
  383|    200|      depth--;
  384|   347k|    } else {
  385|       |#ifdef DEBUG
  386|       |      significantLine = false;
  387|       |#endif
  388|   347k|    }
  389|       |#ifdef DEBUG
  390|       |    if (significantLine) {
  391|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  392|       |    }
  393|       |    significantLine = true;
  394|       |#endif
  395|   388k|    if (depth != 0)
  ------------------
  |  Branch (395:9): [True: 52.1k, False: 336k]
  ------------------
  396|  52.1k|      continue;
  397|       |    // explicit "Begin" comments
  398|   336k|    if (line.starts_with("%%BeginPreview:")) {
  ------------------
  |  Branch (398:9): [True: 264, False: 336k]
  ------------------
  399|    264|      inDefaultsPreviewPrologSetup = true;
  400|   336k|    } else if (line == "%%BeginDefaults") {
  ------------------
  |  Branch (400:16): [True: 371, False: 336k]
  ------------------
  401|    371|      inDefaultsPreviewPrologSetup = true;
  402|   336k|    } else if (line == "%%BeginProlog") {
  ------------------
  |  Branch (402:16): [True: 871, False: 335k]
  ------------------
  403|    871|      inDefaultsPreviewPrologSetup = true;
  404|   335k|    } else if (line == "%%BeginSetup") {
  ------------------
  |  Branch (404:16): [True: 204, False: 335k]
  ------------------
  405|    204|      inDefaultsPreviewPrologSetup = true;
  406|   335k|    } else if (posPage == posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (406:16): [True: 77.2k, False: 257k]
  |  Branch (406:40): [True: 108, False: 77.1k]
  ------------------
  407|    108|      posPage = startPos;
  408|   334k|    } else if (posPage != posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (408:16): [True: 257k, False: 77.1k]
  |  Branch (408:40): [True: 24, False: 257k]
  ------------------
  409|     24|      if (implicitPage) {
  ------------------
  |  Branch (409:11): [True: 13, False: 11]
  ------------------
  410|     13|#ifndef SUPPRESS_WARNINGS
  411|     13|        EXV_WARNING << "Page at position " << startPos << " conflicts with implicit page at position: " << posPage
  ------------------
  |  |  138|     13|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     13|  LogMsg(LogMsg::warn).os()
  ------------------
  412|      0|                    << "\n";
  413|     13|#endif
  414|     13|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (414:21): [True: 0, False: 13]
  ------------------
  415|     13|      }
  416|     11|#ifndef SUPPRESS_WARNINGS
  417|     11|      EXV_WARNING << "Unable to handle multiple PostScript pages. Found second page at position: " << startPos << "\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  418|     11|#endif
  419|     11|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (419:19): [True: 0, False: 11]
  ------------------
  420|   334k|    } else if (line == "%%BeginPageSetup") {
  ------------------
  |  Branch (420:16): [True: 216, False: 334k]
  ------------------
  421|    216|      posBeginPageSetup = startPos;
  422|   334k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: Before %%EndPageSetup") {
  ------------------
  |  Branch (422:16): [True: 193k, False: 141k]
  |  Branch (422:41): [True: 978, False: 192k]
  ------------------
  423|    978|      inRemovableEmbedding = true;
  424|    978|      removableEmbeddings.emplace_back(startPos, startPos);
  425|    978|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  426|   333k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: After %%PageTrailer") {
  ------------------
  |  Branch (426:16): [True: 192k, False: 141k]
  |  Branch (426:41): [True: 1.74k, False: 190k]
  ------------------
  427|  1.74k|      inRemovableEmbedding = true;
  428|  1.74k|      removableEmbeddings.emplace_back(startPos, startPos);
  429|  1.74k|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  430|   331k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageSetup End \"AI11EPS\"") {
  ------------------
  |  Branch (430:16): [True: 190k, False: 141k]
  |  Branch (430:41): [True: 414, False: 190k]
  ------------------
  431|    414|      inRemovableEmbedding = true;
  432|    414|      removableEmbeddings.emplace_back(startPos, startPos);
  433|    414|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageSetup End \"AI11EPS\"";
  434|   331k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageTrailer Start \"AI11EPS\"") {
  ------------------
  |  Branch (434:16): [True: 190k, False: 141k]
  |  Branch (434:41): [True: 370, False: 189k]
  ------------------
  435|    370|      inRemovableEmbedding = true;
  436|    370|      removableEmbeddings.emplace_back(startPos, startPos);
  437|    370|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageTrailer Start \"AI11EPS\"";
  438|   331k|    } else if (!inRemovableEmbedding && line == "%begin_xml_code") {
  ------------------
  |  Branch (438:16): [True: 189k, False: 141k]
  |  Branch (438:41): [True: 5.32k, False: 184k]
  ------------------
  439|  5.32k|      inRemovableEmbedding = true;
  440|  5.32k|      removableEmbeddings.emplace_back(startPos, startPos);
  441|  5.32k|      removableEmbeddingEndLine = "%end_xml_code";
  442|  5.32k|      removableEmbeddingsWithUnmarkedTrailer++;
  443|   325k|    } else {
  444|       |#ifdef DEBUG
  445|       |      significantLine = false;
  446|       |#endif
  447|   325k|    }
  448|       |#ifdef DEBUG
  449|       |    if (significantLine) {
  450|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  451|       |    }
  452|       |    significantLine = true;
  453|       |#endif
  454|       |    // implicit comments
  455|   336k|    if (line == "%%EOF" || line == "%begin_xml_code" || line.size() < 2 || line.front() != '%' || '\x21' > line[1] ||
  ------------------
  |  Branch (455:9): [True: 16, False: 336k]
  |  Branch (455:28): [True: 9.49k, False: 327k]
  |  Branch (455:57): [True: 45.6k, False: 281k]
  |  Branch (455:76): [True: 145k, False: 135k]
  |  Branch (455:99): [True: 5.26k, False: 130k]
  ------------------
  456|   206k|        line[1] > '\x7e') {
  ------------------
  |  Branch (456:9): [True: 202, False: 130k]
  ------------------
  457|   206k|      if (posEndComments == posEndEps) {
  ------------------
  |  Branch (457:11): [True: 1.92k, False: 204k]
  ------------------
  458|  1.92k|        posEndComments = startPos;
  459|       |#ifdef DEBUG
  460|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndComments at position: " << startPos << "\n";
  461|       |#endif
  462|  1.92k|      }
  463|   206k|    }
  464|   336k|    if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding &&
  ------------------
  |  Branch (464:9): [True: 78.0k, False: 258k]
  |  Branch (464:33): [True: 61.1k, False: 16.9k]
  |  Branch (464:64): [True: 38.5k, False: 22.6k]
  |  Branch (464:97): [True: 3.83k, False: 34.6k]
  ------------------
  465|  3.83k|        !onlyWhitespaces(line)) {
  ------------------
  |  Branch (465:9): [True: 1.59k, False: 2.24k]
  ------------------
  466|  1.59k|      posPage = startPos;
  467|  1.59k|      implicitPage = true;
  468|       |#ifdef DEBUG
  469|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page at position: " << startPos << "\n";
  470|       |#endif
  471|  1.59k|    }
  472|   336k|    if (posBeginPageSetup == posEndEps &&
  ------------------
  |  Branch (472:9): [True: 79.7k, False: 257k]
  ------------------
  473|  79.7k|        (implicitPage || (posPage != posEndEps && !inRemovableEmbedding && !line.empty() && line.front() != '%'))) {
  ------------------
  |  Branch (473:10): [True: 1.57k, False: 78.1k]
  |  Branch (473:27): [True: 1.70k, False: 76.4k]
  |  Branch (473:51): [True: 1.42k, False: 282]
  |  Branch (473:76): [True: 1.17k, False: 255]
  |  Branch (473:93): [True: 56, False: 1.11k]
  ------------------
  474|  1.62k|      posBeginPageSetup = startPos;
  475|  1.62k|      implicitPageSetup = true;
  476|       |#ifdef DEBUG
  477|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  478|       |#endif
  479|  1.62k|    }
  480|   336k|    if (posEndPageSetup == posEndEps && implicitPageSetup && !inRemovableEmbedding && !line.empty() &&
  ------------------
  |  Branch (480:9): [True: 87.4k, False: 249k]
  |  Branch (480:41): [True: 9.47k, False: 78.0k]
  |  Branch (480:62): [True: 5.18k, False: 4.29k]
  |  Branch (480:87): [True: 4.49k, False: 689]
  ------------------
  481|  4.49k|        line.front() != '%') {
  ------------------
  |  Branch (481:9): [True: 1.34k, False: 3.14k]
  ------------------
  482|  1.34k|      posEndPageSetup = startPos;
  483|       |#ifdef DEBUG
  484|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  485|       |#endif
  486|  1.34k|    }
  487|   336k|    if (!line.empty() && line.front() != '%')
  ------------------
  |  Branch (487:9): [True: 294k, False: 41.9k]
  |  Branch (487:26): [True: 148k, False: 145k]
  ------------------
  488|   148k|      continue;  // performance optimization
  489|   187k|    if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
  ------------------
  |  Branch (489:9): [True: 16, False: 187k]
  |  Branch (489:28): [True: 279, False: 187k]
  |  Branch (489:51): [True: 371, False: 187k]
  ------------------
  490|    666|      if (posBeginPageSetup == posEndEps) {
  ------------------
  |  Branch (490:11): [True: 28, False: 638]
  ------------------
  491|     28|        posBeginPageSetup = startPos;
  492|     28|        implicitPageSetup = true;
  493|       |#ifdef DEBUG
  494|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  495|       |#endif
  496|     28|      }
  497|    666|      if (posEndPageSetup == posEndEps) {
  ------------------
  |  Branch (497:11): [True: 48, False: 618]
  ------------------
  498|     48|        posEndPageSetup = startPos;
  499|     48|        implicitPageSetup = true;
  500|       |#ifdef DEBUG
  501|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  502|       |#endif
  503|     48|      }
  504|    666|    }
  505|   187k|    if ((line == "%%EOF" || line == "%%Trailer") && posPageTrailer == posEndEps) {
  ------------------
  |  Branch (505:10): [True: 16, False: 187k]
  |  Branch (505:29): [True: 279, False: 187k]
  |  Branch (505:53): [True: 55, False: 240]
  ------------------
  506|     55|      posPageTrailer = startPos;
  507|     55|      implicitPageTrailer = true;
  508|       |#ifdef DEBUG
  509|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit PageTrailer at position: " << startPos << "\n";
  510|       |#endif
  511|     55|    }
  512|       |    // remaining explicit comments
  513|   187k|    if (posEndComments == posEndEps && posLanguageLevel == posEndEps && line.starts_with("%%LanguageLevel:")) {
  ------------------
  |  Branch (513:9): [True: 17.9k, False: 169k]
  |  Branch (513:40): [True: 17.7k, False: 249]
  |  Branch (513:73): [True: 35, False: 17.6k]
  ------------------
  514|     35|      posLanguageLevel = startPos;
  515|   187k|    } else if (posEndComments == posEndEps && posContainsXmp == posEndEps && line.starts_with("%ADO_ContainsXMP:")) {
  ------------------
  |  Branch (515:16): [True: 17.9k, False: 169k]
  |  Branch (515:47): [True: 17.2k, False: 671]
  |  Branch (515:78): [True: 600, False: 16.6k]
  ------------------
  516|    600|      posContainsXmp = startPos;
  517|   187k|    } else if (posEndComments == posEndEps && posPages == posEndEps && line.starts_with("%%Pages:")) {
  ------------------
  |  Branch (517:16): [True: 17.3k, False: 169k]
  |  Branch (517:47): [True: 16.5k, False: 810]
  |  Branch (517:72): [True: 57, False: 16.4k]
  ------------------
  518|     57|      posPages = startPos;
  519|   187k|    } else if (posEndComments == posEndEps && posExiv2Version == posEndEps && line.starts_with("%Exiv2Version:")) {
  ------------------
  |  Branch (519:16): [True: 17.2k, False: 169k]
  |  Branch (519:47): [True: 17.0k, False: 243]
  |  Branch (519:79): [True: 27, False: 17.0k]
  ------------------
  520|     27|      posExiv2Version = startPos;
  521|   187k|    } else if (posEndComments == posEndEps && posExiv2Website == posEndEps && line.starts_with("%Exiv2Website:")) {
  ------------------
  |  Branch (521:16): [True: 17.2k, False: 169k]
  |  Branch (521:47): [True: 16.6k, False: 564]
  |  Branch (521:79): [True: 24, False: 16.6k]
  ------------------
  522|     24|      posExiv2Website = startPos;
  523|   187k|    } else if (posEndComments == posEndEps && line.starts_with("%%Creator: Adobe Illustrator") &&
  ------------------
  |  Branch (523:16): [True: 17.2k, False: 169k]
  |  Branch (523:47): [True: 1.07k, False: 16.1k]
  ------------------
  524|  1.07k|               firstLine == "%!PS-Adobe-3.0 EPSF-3.0") {
  ------------------
  |  Branch (524:16): [True: 211, False: 864]
  ------------------
  525|    211|      illustrator8 = true;
  526|   186k|    } else if (posEndComments == posEndEps && line.starts_with("%AI7_Thumbnail:")) {
  ------------------
  |  Branch (526:16): [True: 17.0k, False: 169k]
  |  Branch (526:47): [True: 820, False: 16.2k]
  ------------------
  527|    820|      posAi7Thumbnail = startPos;
  528|   186k|    } else if (posEndComments == posEndEps && posAi7Thumbnail != posEndEps && posAi7ThumbnailEndData == posEndEps &&
  ------------------
  |  Branch (528:16): [True: 16.2k, False: 169k]
  |  Branch (528:47): [True: 4.64k, False: 11.5k]
  |  Branch (528:79): [True: 3.82k, False: 818]
  ------------------
  529|  3.82k|               line == "%%EndData") {
  ------------------
  |  Branch (529:16): [True: 425, False: 3.40k]
  ------------------
  530|    425|      posAi7ThumbnailEndData = startPos;
  531|   185k|    } else if (posEndComments == posEndEps && line == "%%EndComments") {
  ------------------
  |  Branch (531:16): [True: 15.7k, False: 169k]
  |  Branch (531:47): [True: 6, False: 15.7k]
  ------------------
  532|      6|      posEndComments = startPos;
  533|   185k|    } else if (inDefaultsPreviewPrologSetup && line.starts_with("%%BeginResource: procset wCorel")) {
  ------------------
  |  Branch (533:16): [True: 74.2k, False: 111k]
  |  Branch (533:48): [True: 3.17k, False: 71.0k]
  ------------------
  534|  3.17k|      corelDraw = true;
  535|   182k|    } else if (line == "%%EndPreview") {
  ------------------
  |  Branch (535:16): [True: 5.84k, False: 176k]
  ------------------
  536|  5.84k|      inDefaultsPreviewPrologSetup = false;
  537|   176k|    } else if (line == "%%EndDefaults") {
  ------------------
  |  Branch (537:16): [True: 639, False: 176k]
  ------------------
  538|    639|      inDefaultsPreviewPrologSetup = false;
  539|   176k|    } else if (line == "%%EndProlog") {
  ------------------
  |  Branch (539:16): [True: 213, False: 175k]
  ------------------
  540|    213|      inDefaultsPreviewPrologSetup = false;
  541|   175k|    } else if (line == "%%EndSetup") {
  ------------------
  |  Branch (541:16): [True: 265, False: 175k]
  ------------------
  542|    265|      inDefaultsPreviewPrologSetup = false;
  543|   175k|    } else if (posEndPageSetup == posEndEps && line == "%%EndPageSetup") {
  ------------------
  |  Branch (543:16): [True: 51.4k, False: 124k]
  |  Branch (543:48): [True: 10, False: 51.4k]
  ------------------
  544|     10|      posEndPageSetup = startPos;
  545|   175k|    } else if (posPageTrailer == posEndEps && line == "%%PageTrailer") {
  ------------------
  |  Branch (545:16): [True: 141k, False: 34.0k]
  |  Branch (545:47): [True: 23, False: 141k]
  ------------------
  546|     23|      posPageTrailer = startPos;
  547|   175k|    } else if (posBeginPhotoshop == posEndEps && line.starts_with("%BeginPhotoshop:")) {
  ------------------
  |  Branch (547:16): [True: 155k, False: 20.0k]
  |  Branch (547:50): [True: 134, False: 155k]
  ------------------
  548|    134|      posBeginPhotoshop = pos;
  549|   175k|    } else if (posBeginPhotoshop != posEndEps && posEndPhotoshop == posEndEps && line == "%EndPhotoshop") {
  ------------------
  |  Branch (549:16): [True: 20.0k, False: 155k]
  |  Branch (549:50): [True: 19.3k, False: 655]
  |  Branch (549:82): [True: 43, False: 19.3k]
  ------------------
  550|     43|      posEndPhotoshop = startPos;
  551|   175k|    } else if (inRemovableEmbedding && line == removableEmbeddingEndLine) {
  ------------------
  |  Branch (551:16): [True: 101k, False: 73.3k]
  |  Branch (551:40): [True: 8.39k, False: 93.5k]
  ------------------
  552|  8.39k|      inRemovableEmbedding = false;
  553|  8.39k|      removableEmbeddings.back().second = pos;
  554|   166k|    } else if (line == "%%EOF") {
  ------------------
  |  Branch (554:16): [True: 16, False: 166k]
  ------------------
  555|     16|      posEof = startPos;
  556|   166k|    } else {
  557|       |#ifdef DEBUG
  558|       |      significantLine = false;
  559|       |#endif
  560|   166k|    }
  561|       |#ifdef DEBUG
  562|       |    if (significantLine) {
  563|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  564|       |    }
  565|       |#endif
  566|   187k|  }
  567|       |
  568|       |  // check for unfinished nested documents
  569|  3.18k|  if (depth != 0) {
  ------------------
  |  Branch (569:7): [True: 32, False: 3.15k]
  ------------------
  570|     32|#ifndef SUPPRESS_WARNINGS
  571|     32|    EXV_WARNING << "Unmatched BeginDocument (" << depth << "x)\n";
  ------------------
  |  |  138|     32|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 32]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     32|  LogMsg(LogMsg::warn).os()
  ------------------
  572|     32|#endif
  573|     32|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (573:17): [True: 0, False: 32]
  ------------------
  574|     32|  }
  575|       |
  576|       |  // look for the unmarked trailers of some removable XMP embeddings
  577|  3.15k|  size_t posXmpTrailerEnd = posEof;
  578|  3.23k|  for (size_t i = 0; i < removableEmbeddingsWithUnmarkedTrailer; i++) {
  ------------------
  |  Branch (578:22): [True: 397, False: 2.84k]
  ------------------
  579|    397|    std::string line1;
  580|    397|    const size_t posLine1 = readPrevLine(line1, data, posXmpTrailerEnd, posEndEps);
  581|    397|    std::string line2;
  582|    397|    const size_t posLine2 = readPrevLine(line2, data, posLine1, posEndEps);
  583|    397|    size_t posXmpTrailer;
  584|    397|    if (line1 == "[/EMC pdfmark") {  // Exiftool style
  ------------------
  |  Branch (584:9): [True: 86, False: 311]
  ------------------
  585|     86|      posXmpTrailer = posLine1;
  586|    311|    } else if (line1 == "[/NamespacePop pdfmark" &&
  ------------------
  |  Branch (586:16): [True: 27, False: 284]
  ------------------
  587|     27|               line2 ==
  ------------------
  |  Branch (587:16): [True: 0, False: 27]
  ------------------
  588|     27|                   "[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT "
  589|     27|                   "pdfmark") {  // Photoshop style
  590|      0|      posXmpTrailer = posLine2;
  591|    311|    } else {
  592|    311|#ifndef SUPPRESS_WARNINGS
  593|    311|      EXV_WARNING << "Unable to find XMP embedding trailer ending at position: " << posXmpTrailerEnd << "\n";
  ------------------
  |  |  138|    311|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 311]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    311|  LogMsg(LogMsg::warn).os()
  ------------------
  594|    311|#endif
  595|    311|      if (write)
  ------------------
  |  Branch (595:11): [True: 0, False: 311]
  ------------------
  596|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  597|    311|      break;
  598|    311|    }
  599|     86|    removableEmbeddings.emplace_back(posXmpTrailer, posXmpTrailerEnd);
  600|       |#ifdef DEBUG
  601|       |    auto [r, s] = removableEmbeddings.back();
  602|       |    EXV_DEBUG << "readWriteEpsMetadata: Recognized unmarked trailer of removable XMP embedding at [" << r << "," << s
  603|       |              << ")\n";
  604|       |#endif
  605|     86|    posXmpTrailerEnd = posXmpTrailer;
  606|     86|  }
  607|       |
  608|       |  // interpret comment "%ADO_ContainsXMP:"
  609|  3.15k|  std::string line;
  610|  3.15k|  readLine(line, data, posContainsXmp, posEndEps);
  611|  3.15k|  bool containsXmp;
  612|  3.15k|  if (line == "%ADO_ContainsXMP: MainFirst" || line == "%ADO_ContainsXMP:MainFirst") {
  ------------------
  |  Branch (612:7): [True: 434, False: 2.71k]
  |  Branch (612:48): [True: 435, False: 2.28k]
  ------------------
  613|    445|    containsXmp = true;
  614|  2.70k|  } else if (line.empty() || line == "%ADO_ContainsXMP: NoMain" || line == "%ADO_ContainsXMP:NoMain") {
  ------------------
  |  Branch (614:14): [True: 2.55k, False: 151]
  |  Branch (614:30): [True: 17, False: 134]
  |  Branch (614:68): [True: 10, False: 124]
  ------------------
  615|  2.16k|    containsXmp = false;
  616|  2.16k|  } else {
  617|    548|#ifndef SUPPRESS_WARNINGS
  618|    548|    EXV_WARNING << "Invalid line \"" << line << "\" at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|    548|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 548]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    548|  LogMsg(LogMsg::warn).os()
  ------------------
  619|    548|#endif
  620|    548|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (620:17): [True: 0, False: 548]
  ------------------
  621|    548|  }
  622|       |
  623|  2.60k|  const bool deleteXmp = (write && xmpPacket.empty());
  ------------------
  |  Branch (623:27): [True: 0, False: 2.60k]
  |  Branch (623:36): [True: 0, False: 0]
  ------------------
  624|  2.60k|  bool fixBeginXmlPacket = false;
  625|  2.60k|  bool useFlexibleEmbedding = false;
  626|  2.60k|  size_t xmpPos = posEndEps;
  627|  2.60k|  size_t xmpSize = 0;
  628|  2.60k|  if (containsXmp) {
  ------------------
  |  Branch (628:7): [True: 445, False: 2.16k]
  ------------------
  629|       |    // search for XMP metadata
  630|    445|    findXmp(xmpPos, xmpSize, data, posEps, posEndEps, write);
  631|    445|    if (xmpPos == posEndEps) {
  ------------------
  |  Branch (631:9): [True: 45, False: 400]
  ------------------
  632|     45|#ifndef SUPPRESS_WARNINGS
  633|     45|      EXV_WARNING << "Unable to find XMP metadata as announced at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|     45|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 45]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     45|  LogMsg(LogMsg::warn).os()
  ------------------
  634|     45|#endif
  635|     45|    }
  636|       |    // check embedding of XMP metadata
  637|    445|    const size_t posLineAfterXmp = readLine(line, data, xmpPos + xmpSize, posEndEps);
  638|    445|    if (!line.empty()) {
  ------------------
  |  Branch (638:9): [True: 290, False: 155]
  ------------------
  639|    290|#ifndef SUPPRESS_WARNINGS
  640|    290|      EXV_WARNING << "Unexpected " << line.size() << " bytes of data after XMP at position: " << (xmpPos + xmpSize)
  ------------------
  |  |  138|    290|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 290]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    290|  LogMsg(LogMsg::warn).os()
  ------------------
  641|      0|                  << "\n";
  642|    290|#endif
  643|    290|    } else if (!deleteXmp) {
  ------------------
  |  Branch (643:16): [True: 133, False: 22]
  ------------------
  644|    133|      readLine(line, data, posLineAfterXmp, posEndEps);
  645|    133|      if (line == "% &&end XMP packet marker&&" || line == "%  &&end XMP packet marker&&") {
  ------------------
  |  Branch (645:11): [True: 28, False: 105]
  |  Branch (645:52): [True: 10, False: 95]
  ------------------
  646|     38|        useFlexibleEmbedding = true;
  647|     38|      }
  648|    133|    }
  649|    445|  }
  650|  2.60k|  if (useFlexibleEmbedding) {
  ------------------
  |  Branch (650:7): [True: 38, False: 2.56k]
  ------------------
  651|       |#ifdef DEBUG
  652|       |    EXV_DEBUG << "readWriteEpsMetadata: Using flexible XMP embedding\n";
  653|       |#endif
  654|     38|    const size_t posBeginXmlPacket = readPrevLine(line, data, xmpPos, posEndEps);
  655|     38|    if (line.starts_with("%begin_xml_packet:")) {
  ------------------
  |  Branch (655:9): [True: 10, False: 28]
  ------------------
  656|       |#ifdef DEBUG
  657|       |      EXV_DEBUG << "readWriteEpsMetadata: XMP embedding contains %begin_xml_packet\n";
  658|       |#endif
  659|     10|      if (write) {
  ------------------
  |  Branch (659:11): [True: 0, False: 10]
  ------------------
  660|      0|        fixBeginXmlPacket = true;
  661|      0|        xmpSize += (xmpPos - posBeginXmlPacket);
  662|      0|        xmpPos = posBeginXmlPacket;
  663|      0|      }
  664|     28|    } else if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (664:16): [True: 17, False: 11]
  ------------------
  665|     17|#ifndef SUPPRESS_WARNINGS
  666|     17|      EXV_WARNING << "Missing %begin_xml_packet in Photoshop EPS at position: " << xmpPos << "\n";
  ------------------
  |  |  138|     17|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 17]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     17|  LogMsg(LogMsg::warn).os()
  ------------------
  667|     17|#endif
  668|     17|      if (write)
  ------------------
  |  Branch (668:11): [True: 0, False: 17]
  ------------------
  669|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  670|     17|    }
  671|     38|  }
  672|  2.60k|  if (!useFlexibleEmbedding) {
  ------------------
  |  Branch (672:7): [True: 2.54k, False: 60]
  ------------------
  673|       |    // check if there are irremovable XMP metadata blocks before EndPageSetup
  674|  2.54k|    size_t posOtherXmp = containsXmp ? xmpPos : posEps;
  ------------------
  |  Branch (674:26): [True: 385, False: 2.16k]
  ------------------
  675|  2.54k|    size_t sizeOtherXmp = 0;
  676|  8.45k|    for (;;) {
  677|  8.45k|      findXmp(posOtherXmp, sizeOtherXmp, data, posOtherXmp + sizeOtherXmp, posEndPageSetup, write);
  678|  8.45k|      if (posOtherXmp >= posEndPageSetup)
  ------------------
  |  Branch (678:11): [True: 2.31k, False: 6.13k]
  ------------------
  679|  2.31k|        break;
  680|  6.13k|      bool isRemovableEmbedding = false;
  681|  7.88k|      for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (681:31): [True: 7.88k, False: 230]
  ------------------
  682|  7.88k|        if (r <= posOtherXmp && posOtherXmp < s) {
  ------------------
  |  Branch (682:13): [True: 7.68k, False: 203]
  |  Branch (682:33): [True: 5.90k, False: 1.77k]
  ------------------
  683|  5.90k|          isRemovableEmbedding = true;
  684|  5.90k|          break;
  685|  5.90k|        }
  686|  7.88k|      }
  687|  6.13k|      if (!isRemovableEmbedding) {
  ------------------
  |  Branch (687:11): [True: 89, False: 6.04k]
  ------------------
  688|     89|#ifndef SUPPRESS_WARNINGS
  689|     89|        EXV_WARNING << "XMP metadata block is not removable at position: " << posOtherXmp << "\n";
  ------------------
  |  |  138|     89|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 89]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     89|  LogMsg(LogMsg::warn).os()
  ------------------
  690|     89|#endif
  691|     89|        if (write)
  ------------------
  |  Branch (691:13): [True: 0, False: 89]
  ------------------
  692|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  693|     89|        break;
  694|     89|      }
  695|  6.13k|    }
  696|  2.54k|  }
  697|       |
  698|  2.60k|  if (!write) {
  ------------------
  |  Branch (698:7): [True: 2.44k, False: 163]
  ------------------
  699|       |    // copy XMP metadata
  700|  2.44k|    xmpPacket.assign(reinterpret_cast<const char*>(data + xmpPos), xmpSize);
  701|       |
  702|       |    // native previews
  703|  2.44k|    nativePreviews.clear();
  704|  2.44k|    if (posAi7ThumbnailEndData != posEndEps) {
  ------------------
  |  Branch (704:9): [True: 421, False: 2.02k]
  ------------------
  705|    421|      NativePreview nativePreview;
  706|    421|      std::string dummy;
  707|    421|      std::string lineAi7Thumbnail;
  708|    421|      const size_t posBeginData = readLine(lineAi7Thumbnail, data, posAi7Thumbnail, posEndEps);
  709|    421|      std::istringstream lineStreamAi7Thumbnail(lineAi7Thumbnail);
  710|    421|      lineStreamAi7Thumbnail >> dummy;
  711|    421|      lineStreamAi7Thumbnail >> nativePreview.width_;
  712|    421|      lineStreamAi7Thumbnail >> nativePreview.height_;
  713|    421|      std::string depthStr;
  714|    421|      lineStreamAi7Thumbnail >> depthStr;
  715|    421|      std::string lineBeginData;
  716|    421|      const size_t posAfterBeginData = readLine(lineBeginData, data, posBeginData, posEndEps);
  717|    421|      std::istringstream lineStreamBeginData(lineBeginData);
  718|    421|      std::string beginData;
  719|    421|      lineStreamBeginData >> beginData;
  720|    421|      lineStreamBeginData >> dummy;
  721|    421|      std::string type;
  722|    421|      lineStreamBeginData >> type;
  723|    421|      nativePreview.position_ = static_cast<long>(posAfterBeginData);
  724|    421|      nativePreview.size_ = static_cast<uint32_t>(posAi7ThumbnailEndData - posAfterBeginData);
  725|    421|      nativePreview.filter_ = "hex-ai7thumbnail-pnm";
  726|    421|      nativePreview.mimeType_ = "image/x-portable-anymap";
  727|    421|      if (depthStr != "8") {
  ------------------
  |  Branch (727:11): [True: 164, False: 257]
  ------------------
  728|    164|#ifndef SUPPRESS_WARNINGS
  729|    164|        EXV_WARNING << "Unable to handle Illustrator thumbnail depth: " << depthStr << "\n";
  ------------------
  |  |  138|    164|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 164]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    164|  LogMsg(LogMsg::warn).os()
  ------------------
  730|    164|#endif
  731|    257|      } else if (beginData != "%%BeginData:") {
  ------------------
  |  Branch (731:18): [True: 46, False: 211]
  ------------------
  732|     46|#ifndef SUPPRESS_WARNINGS
  733|     46|        EXV_WARNING << "Unable to handle Illustrator thumbnail data section: " << lineBeginData << "\n";
  ------------------
  |  |  138|     46|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     46|  LogMsg(LogMsg::warn).os()
  ------------------
  734|     46|#endif
  735|    211|      } else if (type != "Hex") {
  ------------------
  |  Branch (735:18): [True: 52, False: 159]
  ------------------
  736|     52|#ifndef SUPPRESS_WARNINGS
  737|     52|        EXV_WARNING << "Unable to handle Illustrator thumbnail data type: " << type << "\n";
  ------------------
  |  |  138|     52|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 52]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     52|  LogMsg(LogMsg::warn).os()
  ------------------
  738|     52|#endif
  739|    159|      } else {
  740|    159|        nativePreviews.push_back(std::move(nativePreview));
  741|    159|      }
  742|    421|    }
  743|  2.44k|    if (posEndPhotoshop != posEndEps) {
  ------------------
  |  Branch (743:9): [True: 42, False: 2.40k]
  ------------------
  744|     42|      auto sizePhotoshop = posEndPhotoshop - posBeginPhotoshop;
  745|     42|      NativePreview nativePreview{posBeginPhotoshop, sizePhotoshop, 0, 0, "hex-irb", "image/jpeg"};
  746|     42|      nativePreviews.push_back(std::move(nativePreview));
  747|     42|    }
  748|  2.44k|    if (sizeWmf != 0) {
  ------------------
  |  Branch (748:9): [True: 4, False: 2.43k]
  ------------------
  749|      4|      NativePreview nativePreview{posWmf, sizeWmf, 0, 0, "", "image/x-wmf"};
  750|      4|      nativePreviews.push_back(std::move(nativePreview));
  751|      4|    }
  752|  2.44k|    if (sizeTiff != 0) {
  ------------------
  |  Branch (752:9): [True: 3, False: 2.43k]
  ------------------
  753|      3|      NativePreview nativePreview{posTiff, sizeTiff, 0, 0, "", "image/tiff"};
  754|      3|      nativePreviews.push_back(std::move(nativePreview));
  755|      3|    }
  756|  2.44k|  } else {
  757|       |    // check for Adobe Illustrator 8.0 or older
  758|    163|    if (illustrator8) {
  ------------------
  |  Branch (758:9): [True: 0, False: 163]
  ------------------
  759|      0|#ifndef SUPPRESS_WARNINGS
  760|      0|      EXV_WARNING << "Unable to write to EPS files created by Adobe Illustrator 8.0 or older.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  761|      0|#endif
  762|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  763|      0|    }
  764|       |
  765|       |    // create temporary output file
  766|    163|    MemIo tempIo;
  767|    163|    if (!tempIo.isopen()) {
  ------------------
  |  Branch (767:9): [True: 0, False: 163]
  ------------------
  768|      0|#ifndef SUPPRESS_WARNINGS
  769|      0|      EXV_WARNING << "Unable to create temporary file for writing.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  770|      0|#endif
  771|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  772|      0|    }
  773|       |#ifdef DEBUG
  774|       |    EXV_DEBUG << "readWriteEpsMetadata: Created temporary file " << tempIo.path() << "\n";
  775|       |#endif
  776|       |
  777|       |    // sort all positions
  778|    163|    std::vector<size_t> positions;
  779|    163|    positions.push_back(posLanguageLevel);
  780|    163|    positions.push_back(posContainsXmp);
  781|    163|    positions.push_back(posPages);
  782|    163|    positions.push_back(posExiv2Version);
  783|    163|    positions.push_back(posExiv2Website);
  784|    163|    positions.push_back(posEndComments);
  785|    163|    positions.push_back(posPage);
  786|    163|    positions.push_back(posBeginPageSetup);
  787|    163|    positions.push_back(posEndPageSetup);
  788|    163|    positions.push_back(posPageTrailer);
  789|    163|    positions.push_back(posEof);
  790|    163|    positions.push_back(posEndEps);
  791|    163|    if (useFlexibleEmbedding) {
  ------------------
  |  Branch (791:9): [True: 0, False: 163]
  ------------------
  792|      0|      positions.push_back(xmpPos);
  793|      0|    }
  794|    163|    for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (794:29): [True: 0, False: 163]
  ------------------
  795|      0|      positions.push_back(r);
  796|      0|    }
  797|    163|    std::sort(positions.begin(), positions.end());
  798|       |
  799|       |    // assemble result EPS document
  800|    163|    if (dosEps) {
  ------------------
  |  Branch (800:9): [True: 0, False: 163]
  ------------------
  801|       |      // DOS EPS header will be written afterwards
  802|      0|      writeTemp(tempIo, std::string(30, '\x00'));
  803|      0|    }
  804|    163|    const std::string containsXmpLine = deleteXmp ? "%ADO_ContainsXMP: NoMain" : "%ADO_ContainsXMP: MainFirst";
  ------------------
  |  Branch (804:41): [True: 0, False: 163]
  ------------------
  805|    163|    const uint32_t posEpsNew = posTemp(tempIo);
  806|    163|    size_t prevPos = posEps;
  807|    163|    size_t prevSkipPos = prevPos;
  808|    163|    for (const auto& pos : positions) {
  ------------------
  |  Branch (808:26): [True: 0, False: 163]
  ------------------
  809|      0|      if (pos == prevPos)
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|      0|        continue;
  811|       |#ifdef DEBUG
  812|       |      EXV_DEBUG << "readWriteEpsMetadata: Writing at " << pos << "\n";
  813|       |#endif
  814|      0|      if (pos < prevSkipPos) {
  ------------------
  |  Branch (814:11): [True: 0, False: 0]
  ------------------
  815|      0|#ifndef SUPPRESS_WARNINGS
  816|      0|        EXV_WARNING << "Internal error while assembling the result EPS document: "
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  817|      0|                       "Unable to continue at position "
  818|      0|                    << pos << " after skipping to position " << prevSkipPos << "\n";
  819|      0|#endif
  820|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  821|      0|      }
  822|      0|      writeTemp(tempIo, data + prevSkipPos, pos - prevSkipPos);
  823|      0|      const size_t posLineEnd = readLine(line, data, pos, posEndEps);
  824|      0|      size_t skipPos = pos;
  825|       |      // add last line ending if necessary
  826|      0|      if (pos == posEndEps && pos >= 1 && data[pos - 1] != '\r' && data[pos - 1] != '\n') {
  ------------------
  |  Branch (826:11): [True: 0, False: 0]
  |  Branch (826:31): [True: 0, False: 0]
  |  Branch (826:43): [True: 0, False: 0]
  |  Branch (826:68): [True: 0, False: 0]
  ------------------
  827|      0|        writeTemp(tempIo, lineEnding);
  828|       |#ifdef DEBUG
  829|       |        EXV_DEBUG << "readWriteEpsMetadata: Added missing line ending of last line\n";
  830|       |#endif
  831|      0|      }
  832|       |      // update and complement DSC comments
  833|      0|      if (pos == posLanguageLevel && posLanguageLevel != posEndEps && !deleteXmp && !useFlexibleEmbedding &&
  ------------------
  |  Branch (833:11): [True: 0, False: 0]
  |  Branch (833:38): [True: 0, False: 0]
  |  Branch (833:71): [True: 0, False: 0]
  |  Branch (833:85): [True: 0, False: 0]
  ------------------
  834|      0|          (line == "%%LanguageLevel:1" || line == "%%LanguageLevel: 1")) {
  ------------------
  |  Branch (834:12): [True: 0, False: 0]
  |  Branch (834:43): [True: 0, False: 0]
  ------------------
  835|      0|        writeTemp(tempIo, "%%LanguageLevel: 2" + lineEnding);
  836|      0|        skipPos = posLineEnd;
  837|       |#ifdef DEBUG
  838|       |        EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  839|       |#endif
  840|      0|      }
  841|      0|      if (pos == posContainsXmp && posContainsXmp != posEndEps && line != containsXmpLine) {
  ------------------
  |  Branch (841:11): [True: 0, False: 0]
  |  Branch (841:36): [True: 0, False: 0]
  |  Branch (841:67): [True: 0, False: 0]
  ------------------
  842|      0|        writeTemp(tempIo, containsXmpLine + lineEnding);
  843|      0|        skipPos = posLineEnd;
  844|       |#ifdef DEBUG
  845|       |        EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  846|       |#endif
  847|      0|      }
  848|      0|      if (pos == posExiv2Version && posExiv2Version != posEndEps) {
  ------------------
  |  Branch (848:11): [True: 0, False: 0]
  |  Branch (848:37): [True: 0, False: 0]
  ------------------
  849|      0|        writeTemp(tempIo, "%Exiv2Version: " + versionNumberHexString() + lineEnding);
  850|      0|        skipPos = posLineEnd;
  851|       |#ifdef DEBUG
  852|       |        EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  853|       |#endif
  854|      0|      }
  855|      0|      if (pos == posExiv2Website && posExiv2Website != posEndEps) {
  ------------------
  |  Branch (855:11): [True: 0, False: 0]
  |  Branch (855:37): [True: 0, False: 0]
  ------------------
  856|      0|        writeTemp(tempIo, "%Exiv2Website: http://www.exiv2.org/" + lineEnding);
  857|      0|        skipPos = posLineEnd;
  858|       |#ifdef DEBUG
  859|       |        EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  860|       |#endif
  861|      0|      }
  862|      0|      if (pos == posEndComments) {
  ------------------
  |  Branch (862:11): [True: 0, False: 0]
  ------------------
  863|      0|        if (posLanguageLevel == posEndEps && !deleteXmp && !useFlexibleEmbedding) {
  ------------------
  |  Branch (863:13): [True: 0, False: 0]
  |  Branch (863:46): [True: 0, False: 0]
  |  Branch (863:60): [True: 0, False: 0]
  ------------------
  864|      0|          writeTemp(tempIo, "%%LanguageLevel: 2" + lineEnding);
  865|      0|        }
  866|      0|        if (posContainsXmp == posEndEps) {
  ------------------
  |  Branch (866:13): [True: 0, False: 0]
  ------------------
  867|      0|          writeTemp(tempIo, containsXmpLine + lineEnding);
  868|      0|        }
  869|      0|        if (posPages == posEndEps) {
  ------------------
  |  Branch (869:13): [True: 0, False: 0]
  ------------------
  870|      0|          writeTemp(tempIo, "%%Pages: 1" + lineEnding);
  871|      0|        }
  872|      0|        if (posExiv2Version == posEndEps) {
  ------------------
  |  Branch (872:13): [True: 0, False: 0]
  ------------------
  873|      0|          writeTemp(tempIo, "%Exiv2Version: " + versionNumberHexString() + lineEnding);
  874|      0|        }
  875|      0|        if (posExiv2Website == posEndEps) {
  ------------------
  |  Branch (875:13): [True: 0, False: 0]
  ------------------
  876|      0|          writeTemp(tempIo, "%Exiv2Website: http://www.exiv2.org/" + lineEnding);
  877|      0|        }
  878|      0|        readLine(line, data, posEndComments, posEndEps);
  879|      0|        if (line != "%%EndComments") {
  ------------------
  |  Branch (879:13): [True: 0, False: 0]
  ------------------
  880|      0|          writeTemp(tempIo, "%%EndComments" + lineEnding);
  881|      0|        }
  882|      0|      }
  883|      0|      if (pos == posPage && !line.starts_with("%%Page:")) {
  ------------------
  |  Branch (883:11): [True: 0, False: 0]
  |  Branch (883:29): [True: 0, False: 0]
  ------------------
  884|      0|        writeTemp(tempIo, "%%Page: 1 1" + lineEnding);
  885|      0|        writeTemp(tempIo, "%%EndPageComments" + lineEnding);
  886|      0|      }
  887|      0|      if (pos == posBeginPageSetup && line != "%%BeginPageSetup") {
  ------------------
  |  Branch (887:11): [True: 0, False: 0]
  |  Branch (887:39): [True: 0, False: 0]
  ------------------
  888|      0|        writeTemp(tempIo, "%%BeginPageSetup" + lineEnding);
  889|      0|      }
  890|       |      // insert XMP metadata into existing flexible embedding
  891|      0|      if (useFlexibleEmbedding && pos == xmpPos) {
  ------------------
  |  Branch (891:11): [True: 0, False: 0]
  |  Branch (891:35): [True: 0, False: 0]
  ------------------
  892|      0|        if (fixBeginXmlPacket) {
  ------------------
  |  Branch (892:13): [True: 0, False: 0]
  ------------------
  893|      0|          writeTemp(tempIo, "%begin_xml_packet: " + toString(xmpPacket.size()) + lineEnding);
  894|      0|        }
  895|      0|        writeTemp(tempIo, xmpPacket);
  896|      0|        skipPos += xmpSize;
  897|       |#ifdef DEBUG
  898|       |        EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  899|       |#endif
  900|      0|      }
  901|      0|      if (!useFlexibleEmbedding) {
  ------------------
  |  Branch (901:11): [True: 0, False: 0]
  ------------------
  902|       |        // remove preceding embedding(s)
  903|      0|        for (const auto& [p, s] : removableEmbeddings) {
  ------------------
  |  Branch (903:33): [True: 0, False: 0]
  ------------------
  904|      0|          if (pos == p) {
  ------------------
  |  Branch (904:15): [True: 0, False: 0]
  ------------------
  905|      0|            skipPos = s;
  906|       |#ifdef DEBUG
  907|       |            EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__
  908|       |                      << "\n";
  909|       |#endif
  910|      0|            break;
  911|      0|          }
  912|      0|        }
  913|       |        // insert XMP metadata with new flexible embedding, if necessary
  914|      0|        if (pos == posEndPageSetup && !deleteXmp) {
  ------------------
  |  Branch (914:13): [True: 0, False: 0]
  |  Branch (914:39): [True: 0, False: 0]
  ------------------
  915|      0|          writeTemp(tempIo, "%Exiv2BeginXMP: Before %%EndPageSetup" + lineEnding);
  916|      0|          if (corelDraw) {
  ------------------
  |  Branch (916:15): [True: 0, False: 0]
  ------------------
  917|      0|            writeTemp(tempIo, "%Exiv2Notice: The following line is needed by CorelDRAW." + lineEnding);
  918|      0|            writeTemp(tempIo, "@rs" + lineEnding);
  919|      0|          }
  920|      0|          if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (920:15): [True: 0, False: 0]
  ------------------
  921|      0|            writeTemp(tempIo, "%Exiv2Notice: The following line is needed by Photoshop." + lineEnding);
  922|      0|            writeTemp(tempIo, "%begin_xml_code" + lineEnding);
  923|      0|          }
  924|      0|          writeTemp(tempIo, "/currentdistillerparams where" + lineEnding);
  925|      0|          writeTemp(tempIo, "{pop currentdistillerparams /CoreDistVersion get 5000 lt} {true} ifelse" + lineEnding);
  926|      0|          writeTemp(tempIo, "{userdict /Exiv2_pdfmark /cleartomark load put" + lineEnding);
  927|      0|          writeTemp(tempIo, "    userdict /Exiv2_metafile_pdfmark {flushfile cleartomark} bind put}" + lineEnding);
  928|      0|          writeTemp(tempIo, "{userdict /Exiv2_pdfmark /pdfmark load put" + lineEnding);
  929|      0|          writeTemp(tempIo, "    userdict /Exiv2_metafile_pdfmark {/PUT pdfmark} bind put} ifelse" + lineEnding);
  930|      0|          writeTemp(tempIo, "[/NamespacePush Exiv2_pdfmark" + lineEnding);
  931|      0|          writeTemp(tempIo, "[/_objdef {Exiv2_metadata_stream} /type /stream /OBJ Exiv2_pdfmark" + lineEnding);
  932|      0|          writeTemp(tempIo, "[{Exiv2_metadata_stream} 2 dict begin" + lineEnding);
  933|      0|          writeTemp(tempIo,
  934|      0|                    "    /Type /Metadata def /Subtype /XML def currentdict end /PUT Exiv2_pdfmark" + lineEnding);
  935|      0|          writeTemp(tempIo, "[{Exiv2_metadata_stream}" + lineEnding);
  936|      0|          writeTemp(tempIo, "    currentfile 0 (% &&end XMP packet marker&&)" + lineEnding);
  937|      0|          writeTemp(tempIo, "    /SubFileDecode filter Exiv2_metafile_pdfmark" + lineEnding);
  938|      0|          if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (938:15): [True: 0, False: 0]
  ------------------
  939|      0|            writeTemp(tempIo,
  940|      0|                      "%Exiv2Notice: The following line is needed by Photoshop. "
  941|      0|                      "Parameter must be exact size of XMP metadata." +
  942|      0|                          lineEnding);
  943|      0|            writeTemp(tempIo, "%begin_xml_packet: " + toString(xmpPacket.size()) + lineEnding);
  944|      0|          }
  945|      0|          writeTemp(tempIo, xmpPacket);
  946|      0|          writeTemp(tempIo, lineEnding);
  947|      0|          writeTemp(tempIo, "% &&end XMP packet marker&&" + lineEnding);
  948|      0|          writeTemp(tempIo, "[/Document 1 dict begin" + lineEnding);
  949|      0|          writeTemp(tempIo,
  950|      0|                    "    /Metadata {Exiv2_metadata_stream} def currentdict end /BDC Exiv2_pdfmark" + lineEnding);
  951|      0|          if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (951:15): [True: 0, False: 0]
  ------------------
  952|      0|            writeTemp(tempIo, "%Exiv2Notice: The following line is needed by Photoshop." + lineEnding);
  953|      0|            writeTemp(tempIo, "%end_xml_code" + lineEnding);
  954|      0|          }
  955|      0|          if (corelDraw) {
  ------------------
  |  Branch (955:15): [True: 0, False: 0]
  ------------------
  956|      0|            writeTemp(tempIo, "%Exiv2Notice: The following line is needed by CorelDRAW." + lineEnding);
  957|      0|            writeTemp(tempIo, "@sv" + lineEnding);
  958|      0|          }
  959|      0|          writeTemp(tempIo, "%Exiv2EndXMP" + lineEnding);
  960|      0|        }
  961|      0|      }
  962|      0|      if (pos == posEndPageSetup && line != "%%EndPageSetup") {
  ------------------
  |  Branch (962:11): [True: 0, False: 0]
  |  Branch (962:37): [True: 0, False: 0]
  ------------------
  963|      0|        writeTemp(tempIo, "%%EndPageSetup" + lineEnding);
  964|      0|      }
  965|      0|      if (!useFlexibleEmbedding && pos == posPageTrailer && !deleteXmp) {
  ------------------
  |  Branch (965:11): [True: 0, False: 0]
  |  Branch (965:36): [True: 0, False: 0]
  |  Branch (965:61): [True: 0, False: 0]
  ------------------
  966|      0|        if (!implicitPageTrailer) {
  ------------------
  |  Branch (966:13): [True: 0, False: 0]
  ------------------
  967|      0|          skipPos = posLineEnd;
  968|       |#ifdef DEBUG
  969|       |          EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
  970|       |#endif
  971|      0|        }
  972|      0|        writeTemp(tempIo, "%%PageTrailer" + lineEnding);
  973|      0|        writeTemp(tempIo, "%Exiv2BeginXMP: After %%PageTrailer" + lineEnding);
  974|      0|        writeTemp(tempIo, "[/EMC Exiv2_pdfmark" + lineEnding);
  975|      0|        writeTemp(tempIo, "[/NamespacePop Exiv2_pdfmark" + lineEnding);
  976|      0|        writeTemp(tempIo, "%Exiv2EndXMP" + lineEnding);
  977|      0|      }
  978|       |      // add EOF comment if necessary
  979|      0|      if (pos == posEndEps && posEof == posEndEps) {
  ------------------
  |  Branch (979:11): [True: 0, False: 0]
  |  Branch (979:31): [True: 0, False: 0]
  ------------------
  980|      0|        writeTemp(tempIo, "%%EOF" + lineEnding);
  981|      0|      }
  982|      0|      prevPos = pos;
  983|      0|      prevSkipPos = skipPos;
  984|      0|    }
  985|    163|    const uint32_t posEndEpsNew = posTemp(tempIo);
  986|       |#ifdef DEBUG
  987|       |    EXV_DEBUG << "readWriteEpsMetadata: New EPS size: " << (posEndEpsNew - posEpsNew) << "\n";
  988|       |#endif
  989|    163|    if (dosEps) {
  ------------------
  |  Branch (989:9): [True: 0, False: 163]
  ------------------
  990|       |      // write WMF and/or TIFF section if present
  991|      0|      writeTemp(tempIo, data + posWmf, sizeWmf);
  992|      0|      writeTemp(tempIo, data + posTiff, sizeTiff);
  993|       |#ifdef DEBUG
  994|       |      EXV_DEBUG << "readWriteEpsMetadata: New DOS EPS total size: " << posTemp(tempIo) << "\n";
  995|       |#endif
  996|       |      // write DOS EPS header
  997|      0|      if (tempIo.seek(0, BasicIo::beg) != 0) {
  ------------------
  |  Branch (997:11): [True: 0, False: 0]
  ------------------
  998|      0|#ifndef SUPPRESS_WARNINGS
  999|      0|        EXV_WARNING << "Internal error while seeking in temporary file.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1000|      0|#endif
 1001|      0|        throw Error(ErrorCode::kerImageWriteFailed);
 1002|      0|      }
 1003|      0|      byte dosEpsHeader[30];
 1004|      0|      dosEpsSignature.copy(reinterpret_cast<char*>(dosEpsHeader), dosEpsSignature.size());
 1005|      0|      ul2Data(dosEpsHeader + 4, posEpsNew, littleEndian);
 1006|      0|      ul2Data(dosEpsHeader + 8, posEndEpsNew - posEpsNew, littleEndian);
 1007|      0|      ul2Data(dosEpsHeader + 12, sizeWmf == 0 ? 0 : posEndEpsNew, littleEndian);
  ------------------
  |  Branch (1007:34): [True: 0, False: 0]
  ------------------
 1008|      0|      ul2Data(dosEpsHeader + 16, sizeWmf, littleEndian);
 1009|      0|      ul2Data(dosEpsHeader + 20, sizeTiff == 0 ? 0 : posEndEpsNew + sizeWmf, littleEndian);
  ------------------
  |  Branch (1009:34): [True: 0, False: 0]
  ------------------
 1010|      0|      ul2Data(dosEpsHeader + 24, sizeTiff, littleEndian);
 1011|      0|      us2Data(dosEpsHeader + 28, 0xFFFF, littleEndian);
 1012|      0|      writeTemp(tempIo, dosEpsHeader, sizeof(dosEpsHeader));
 1013|      0|    }
 1014|       |
 1015|       |    // copy temporary file to real output file
 1016|    163|    io.close();
 1017|    163|    io.transfer(tempIo);
 1018|    163|  }
 1019|  2.60k|}
epsimage.cpp:_ZN12_GLOBAL__N_18readLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  117|   396k|size_t readLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  118|   396k|  line.clear();
  119|   396k|  size_t pos = startPos;
  120|       |  // step through line
  121|  72.7M|  while (pos < size && data[pos] != '\r' && data[pos] != '\n') {
  ------------------
  |  Branch (121:10): [True: 72.7M, False: 4.95k]
  |  Branch (121:24): [True: 72.6M, False: 123k]
  |  Branch (121:45): [True: 72.3M, False: 267k]
  ------------------
  122|  72.3M|    line += data[pos];
  123|  72.3M|    pos++;
  124|  72.3M|  }
  125|       |  // skip line ending, if present
  126|   396k|  if (pos >= size)
  ------------------
  |  Branch (126:7): [True: 4.95k, False: 391k]
  ------------------
  127|  4.95k|    return pos;
  128|   391k|  pos++;
  129|   391k|  if (pos >= size)
  ------------------
  |  Branch (129:7): [True: 469, False: 390k]
  ------------------
  130|    469|    return pos;
  131|   390k|  if (data[pos - 1] == '\r' && data[pos] == '\n')
  ------------------
  |  Branch (131:7): [True: 123k, False: 267k]
  |  Branch (131:32): [True: 6.78k, False: 116k]
  ------------------
  132|  6.78k|    pos++;
  133|   390k|  return pos;
  134|   391k|}
epsimage.cpp:_ZN12_GLOBAL__N_115onlyWhitespacesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  110|  3.83k|bool onlyWhitespaces(const std::string& s) {
  111|       |  // According to the DSC 3.0 specification, 4.4 Parsing Rules,
  112|       |  // only spaces and tabs are considered to be white space characters.
  113|  3.83k|  return s.find_first_not_of(" \t") == std::string::npos;
  114|  3.83k|}
epsimage.cpp:_ZN12_GLOBAL__N_112readPrevLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  137|    832|size_t readPrevLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  138|    832|  line.clear();
  139|    832|  size_t pos = startPos;
  140|    832|  if (pos > size)
  ------------------
  |  Branch (140:7): [True: 0, False: 832]
  ------------------
  141|      0|    return pos;
  142|       |  // skip line ending of previous line, if present
  143|    832|  if (pos <= 0)
  ------------------
  |  Branch (143:7): [True: 0, False: 832]
  ------------------
  144|      0|    return pos;
  145|    832|  if (data[pos - 1] == '\r' || data[pos - 1] == '\n') {
  ------------------
  |  Branch (145:7): [True: 371, False: 461]
  |  Branch (145:32): [True: 168, False: 293]
  ------------------
  146|    539|    pos--;
  147|    539|    if (pos <= 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 539]
  ------------------
  148|      0|      return pos;
  149|    539|    if (data[pos - 1] == '\r' && data[pos] == '\n') {
  ------------------
  |  Branch (149:9): [True: 114, False: 425]
  |  Branch (149:34): [True: 45, False: 69]
  ------------------
  150|     45|      pos--;
  151|     45|      if (pos <= 0)
  ------------------
  |  Branch (151:11): [True: 0, False: 45]
  ------------------
  152|      0|        return pos;
  153|     45|    }
  154|    539|  }
  155|       |  // step through previous line
  156|  12.5M|  while (pos >= 1 && data[pos - 1] != '\r' && data[pos - 1] != '\n') {
  ------------------
  |  Branch (156:10): [True: 12.5M, False: 11]
  |  Branch (156:22): [True: 12.5M, False: 521]
  |  Branch (156:47): [True: 12.5M, False: 300]
  ------------------
  157|  12.5M|    pos--;
  158|  12.5M|    line += data[pos];
  159|  12.5M|  }
  160|    832|  std::reverse(line.begin(), line.end());
  161|    832|  return pos;
  162|    832|}
epsimage.cpp:_ZN12_GLOBAL__N_17findXmpERmS0_PKhmmb:
  165|  8.89k|void findXmp(size_t& xmpPos, size_t& xmpSize, const byte* data, size_t startPos, size_t size, bool write) {
  166|       |  // search for valid XMP header
  167|  8.89k|  xmpSize = 0;
  168|  16.0M|  for (xmpPos = startPos; xmpPos < size; xmpPos++) {
  ------------------
  |  Branch (168:27): [True: 16.0M, False: 2.36k]
  ------------------
  169|  16.0M|    if (data[xmpPos] != '\x00' && data[xmpPos] != '<')
  ------------------
  |  Branch (169:9): [True: 14.4M, False: 1.55M]
  |  Branch (169:35): [True: 14.4M, False: 47.3k]
  ------------------
  170|  14.4M|      continue;
  171|  12.8M|    for (auto&& header : xmpHeaders) {
  ------------------
  |  Branch (171:24): [True: 12.8M, False: 1.59M]
  ------------------
  172|  12.8M|      if (xmpPos + header.size() > size)
  ------------------
  |  Branch (172:11): [True: 52.1k, False: 12.7M]
  ------------------
  173|  52.1k|        continue;
  174|  12.7M|      if (memcmp(data + xmpPos, header.data(), header.size()) != 0)
  ------------------
  |  Branch (174:11): [True: 12.7M, False: 6.53k]
  ------------------
  175|  12.7M|        continue;
  176|       |#ifdef DEBUG
  177|       |      EXV_DEBUG << "findXmp: Found XMP header at position: " << xmpPos << "\n";
  178|       |#endif
  179|       |
  180|       |      // search for valid XMP trailer
  181|  24.5M|      for (size_t trailerPos = xmpPos + header.size(); trailerPos < size; trailerPos++) {
  ------------------
  |  Branch (181:56): [True: 24.5M, False: 109]
  ------------------
  182|  24.5M|        if (data[trailerPos] != '\x00' && data[trailerPos] != '<')
  ------------------
  |  Branch (182:13): [True: 24.3M, False: 174k]
  |  Branch (182:43): [True: 24.3M, False: 54.5k]
  ------------------
  183|  24.3M|          continue;
  184|   913k|        for (const auto& [trailer, readOnly] : xmpTrailers) {
  ------------------
  |  Branch (184:46): [True: 913k, False: 222k]
  ------------------
  185|   913k|          if (trailerPos + trailer.size() > size)
  ------------------
  |  Branch (185:15): [True: 1.09k, False: 912k]
  ------------------
  186|  1.09k|            continue;
  187|   912k|          if (memcmp(data + trailerPos, trailer.data(), trailer.size()) != 0)
  ------------------
  |  Branch (187:15): [True: 906k, False: 6.42k]
  ------------------
  188|   906k|            continue;
  189|       |#ifdef DEBUG
  190|       |          EXV_DEBUG << "findXmp: Found XMP trailer at position: " << trailerPos << "\n";
  191|       |#endif
  192|       |
  193|  6.42k|          if (readOnly) {
  ------------------
  |  Branch (193:15): [True: 21, False: 6.40k]
  ------------------
  194|     21|#ifndef SUPPRESS_WARNINGS
  195|     21|            EXV_WARNING << "Unable to handle read-only XMP metadata yet. Please provide your "
  ------------------
  |  |  138|     21|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 21]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     21|  LogMsg(LogMsg::warn).os()
  ------------------
  196|      0|                           "sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2\n";
  197|     21|#endif
  198|     21|            throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (198:25): [True: 0, False: 21]
  ------------------
  199|     21|          }
  200|       |
  201|       |          // search for end of XMP trailer
  202|   106k|          for (size_t trailerEndPos = trailerPos + trailer.size(); trailerEndPos + xmpTrailerEnd.size() <= size;
  ------------------
  |  Branch (202:68): [True: 106k, False: 33]
  ------------------
  203|   106k|               trailerEndPos++) {
  204|   106k|            if (memcmp(data + trailerEndPos, xmpTrailerEnd.data(), xmpTrailerEnd.size()) == 0) {
  ------------------
  |  Branch (204:17): [True: 6.37k, False: 99.9k]
  ------------------
  205|  6.37k|              xmpSize = (trailerEndPos + xmpTrailerEnd.size()) - xmpPos;
  206|  6.37k|              return;
  207|  6.37k|            }
  208|   106k|          }
  209|     33|#ifndef SUPPRESS_WARNINGS
  210|     33|          EXV_WARNING << "Found XMP header but incomplete XMP trailer.\n";
  ------------------
  |  |  138|     33|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 33]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     33|  LogMsg(LogMsg::warn).os()
  ------------------
  211|     33|#endif
  212|     33|          throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (212:23): [True: 0, False: 33]
  ------------------
  213|  6.40k|        }
  214|   228k|      }
  215|    109|#ifndef SUPPRESS_WARNINGS
  216|    109|      EXV_WARNING << "Found XMP header but no XMP trailer.\n";
  ------------------
  |  |  138|    109|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 109]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    109|  LogMsg(LogMsg::warn).os()
  ------------------
  217|    109|#endif
  218|    109|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (218:19): [True: 0, False: 109]
  ------------------
  219|  6.53k|    }
  220|  1.60M|  }
  221|  8.89k|}

_ZN5Exiv26LogMsg8setLevelENS0_5LevelE:
  119|  25.9k|void LogMsg::setLevel(LogMsg::Level level) {
  120|  25.9k|  level_ = level;
  121|  25.9k|}
_ZN5Exiv26LogMsg5levelEv:
  127|  1.58M|LogMsg::Level LogMsg::level() {
  128|  1.58M|  return level_;
  129|  1.58M|}
_ZN5Exiv25ErrorC2ENS_9ErrorCodeE:
  155|  14.4k|Error::Error(ErrorCode code) : code_(code) {
  156|  14.4k|  setMsg(0);
  157|  14.4k|}
_ZNK5Exiv25Error4codeEv:
  159|     69|ErrorCode Error::code() const noexcept {
  160|     69|  return code_;
  161|     69|}
_ZN5Exiv25Error6setMsgEi:
  167|  15.7k|void Error::setMsg(int count) {
  168|  15.7k|  std::string msg{_(errList.at(static_cast<size_t>(code_)))};
  ------------------
  |  |   40|  15.7k|#define _(String) (String)
  ------------------
  169|  15.7k|  auto pos = msg.find("%0");
  170|  15.7k|  if (pos != std::string::npos) {
  ------------------
  |  Branch (170:7): [True: 0, False: 15.7k]
  ------------------
  171|      0|    msg.replace(pos, 2, std::to_string(static_cast<int>(code_)));
  172|      0|  }
  173|  15.7k|  if (count > 0) {
  ------------------
  |  Branch (173:7): [True: 1.29k, False: 14.4k]
  ------------------
  174|  1.29k|    pos = msg.find("%1");
  175|  1.29k|    if (pos != std::string::npos) {
  ------------------
  |  Branch (175:9): [True: 1.29k, False: 0]
  ------------------
  176|  1.29k|      msg.replace(pos, 2, arg1_);
  177|  1.29k|    }
  178|  1.29k|  }
  179|  15.7k|  if (count > 1) {
  ------------------
  |  Branch (179:7): [True: 7, False: 15.7k]
  ------------------
  180|      7|    pos = msg.find("%2");
  181|      7|    if (pos != std::string::npos) {
  ------------------
  |  Branch (181:9): [True: 7, False: 0]
  ------------------
  182|      7|      msg.replace(pos, 2, arg2_);
  183|      7|    }
  184|      7|  }
  185|  15.7k|  if (count > 2) {
  ------------------
  |  Branch (185:7): [True: 0, False: 15.7k]
  ------------------
  186|      0|    pos = msg.find("%3");
  187|      0|    if (pos != std::string::npos) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      msg.replace(pos, 2, arg3_);
  189|      0|    }
  190|      0|  }
  191|  15.7k|  msg_ = std::move(msg);
  192|  15.7k|}

_ZN5Exiv29ExifdatumC2ERKNS_7ExifKeyEPKNS_5ValueE:
  157|  1.04M|Exifdatum::Exifdatum(const ExifKey& key, const Value* pValue) : key_(key.clone()) {
  158|  1.04M|  if (pValue)
  ------------------
  |  Branch (158:7): [True: 1.03M, False: 4.32k]
  ------------------
  159|  1.03M|    value_ = pValue->clone();
  160|  1.04M|}
_ZN5Exiv29ExifdatumC2ERKS0_:
  162|  1.18M|Exifdatum::Exifdatum(const Exifdatum& rhs) {
  163|  1.18M|  if (rhs.key_)
  ------------------
  |  Branch (163:7): [True: 1.18M, False: 0]
  ------------------
  164|  1.18M|    key_ = rhs.key_->clone();  // deep copy
  165|  1.18M|  if (rhs.value_)
  ------------------
  |  Branch (165:7): [True: 1.18M, False: 0]
  ------------------
  166|  1.18M|    value_ = rhs.value_->clone();  // deep copy
  167|  1.18M|}
_ZN5Exiv29ExifdatumD2Ev:
  169|  2.22M|Exifdatum::~Exifdatum() = default;
_ZNK5Exiv29Exifdatum5valueEv:
  203|   161k|const Value& Exifdatum::value() const {
  204|   161k|  if (!value_)
  ------------------
  |  Branch (204:7): [True: 0, False: 161k]
  ------------------
  205|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  206|   161k|  return *value_;
  207|   161k|}
_ZN5Exiv29ExifdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  224|  2.82k|Exifdatum& Exifdatum::operator=(const std::string& value) {
  225|  2.82k|  setValue(value);
  226|  2.82k|  return *this;
  227|  2.82k|}
_ZN5Exiv29ExifdatumaSERKt:
  229|     30|Exifdatum& Exifdatum::operator=(const uint16_t& value) {
  230|     30|  return Exiv2::setValue(*this, value);
  231|     30|}
_ZN5Exiv29ExifdatumaSERKj:
  233|  3.04k|Exifdatum& Exifdatum::operator=(const uint32_t& value) {
  234|  3.04k|  return Exiv2::setValue(*this, value);
  235|  3.04k|}
_ZN5Exiv29ExifdatumaSERKNS_5ValueE:
  253|  11.4k|Exifdatum& Exifdatum::operator=(const Value& value) {
  254|  11.4k|  setValue(&value);
  255|  11.4k|  return *this;
  256|  11.4k|}
_ZN5Exiv29Exifdatum8setValueEPKNS_5ValueE:
  258|  11.4k|void Exifdatum::setValue(const Value* pValue) {
  259|  11.4k|  value_.reset();
  260|  11.4k|  if (pValue)
  ------------------
  |  Branch (260:7): [True: 11.4k, False: 0]
  ------------------
  261|  11.4k|    value_ = pValue->clone();
  262|  11.4k|}
_ZN5Exiv29Exifdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  264|  3.18k|int Exifdatum::setValue(const std::string& value) {
  265|  3.18k|  if (!value_) {
  ------------------
  |  Branch (265:7): [True: 1.74k, False: 1.44k]
  ------------------
  266|  1.74k|    TypeId type = key_->defaultTypeId();
  267|  1.74k|    value_ = Value::create(type);
  268|  1.74k|  }
  269|  3.18k|  return value_->read(value);
  270|  3.18k|}
_ZNK5Exiv29Exifdatum11setDataAreaEPKhm:
  272|     28|int Exifdatum::setDataArea(const byte* buf, size_t len) const {
  273|     28|  return value_ ? value_->setDataArea(buf, len) : -1;
  ------------------
  |  Branch (273:10): [True: 28, False: 0]
  ------------------
  274|     28|}
_ZNK5Exiv29Exifdatum3keyEv:
  276|  35.1M|std::string Exifdatum::key() const {
  277|  35.1M|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (277:10): [True: 35.1M, False: 0]
  ------------------
  278|  35.1M|}
_ZNK5Exiv29Exifdatum9groupNameEv:
  284|   860k|std::string Exifdatum::groupName() const {
  285|   860k|  return key_ ? key_->groupName() : "";
  ------------------
  |  Branch (285:10): [True: 860k, False: 0]
  ------------------
  286|   860k|}
_ZNK5Exiv29Exifdatum3tagEv:
  300|   651k|uint16_t Exifdatum::tag() const {
  301|   651k|  return key_ ? key_->tag() : 0xffff;
  ------------------
  |  Branch (301:10): [True: 651k, False: 0]
  ------------------
  302|   651k|}
_ZNK5Exiv29Exifdatum5ifdIdEv:
  304|   142k|IfdId Exifdatum::ifdId() const {
  305|   142k|  return key_ ? key_->ifdId() : IfdId::ifdIdNotSet;
  ------------------
  |  Branch (305:10): [True: 142k, False: 0]
  ------------------
  306|   142k|}
_ZNK5Exiv29Exifdatum3idxEv:
  312|   142k|int Exifdatum::idx() const {
  313|   142k|  return key_ ? key_->idx() : 0;
  ------------------
  |  Branch (313:10): [True: 142k, False: 0]
  ------------------
  314|   142k|}
_ZNK5Exiv29Exifdatum4copyEPhNS_9ByteOrderE:
  316|    247|size_t Exifdatum::copy(byte* buf, ByteOrder byteOrder) const {
  317|    247|  return value_ ? value_->copy(buf, byteOrder) : 0;
  ------------------
  |  Branch (317:10): [True: 247, False: 0]
  ------------------
  318|    247|}
_ZNK5Exiv29Exifdatum6typeIdEv:
  320|  1.07k|TypeId Exifdatum::typeId() const {
  321|  1.07k|  return value_ ? value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 1.07k, False: 0]
  ------------------
  322|  1.07k|}
_ZNK5Exiv29Exifdatum8typeSizeEv:
  328|    479|size_t Exifdatum::typeSize() const {
  329|    479|  return TypeInfo::typeSize(typeId());
  330|    479|}
_ZNK5Exiv29Exifdatum5countEv:
  332|  51.6k|size_t Exifdatum::count() const {
  333|  51.6k|  return value_ ? value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 51.6k, False: 0]
  ------------------
  334|  51.6k|}
_ZNK5Exiv29Exifdatum4sizeEv:
  336|   143k|size_t Exifdatum::size() const {
  337|   143k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (337:10): [True: 143k, False: 0]
  ------------------
  338|   143k|}
_ZNK5Exiv29Exifdatum8toStringEv:
  340|  4.98k|std::string Exifdatum::toString() const {
  341|  4.98k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 4.98k, False: 0]
  ------------------
  342|  4.98k|}
_ZNK5Exiv29Exifdatum7toInt64Em:
  348|  83.1k|int64_t Exifdatum::toInt64(size_t n) const {
  349|  83.1k|  return value_ ? value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 83.1k, False: 0]
  ------------------
  350|  83.1k|}
_ZNK5Exiv29Exifdatum8getValueEv:
  360|   142k|Value::UniquePtr Exifdatum::getValue() const {
  361|   142k|  return value_ ? value_->clone() : nullptr;
  ------------------
  |  Branch (361:10): [True: 142k, False: 0]
  ------------------
  362|   142k|}
_ZNK5Exiv29Exifdatum12sizeDataAreaEv:
  364|    679|size_t Exifdatum::sizeDataArea() const {
  365|    679|  return value_ ? value_->sizeDataArea() : 0;
  ------------------
  |  Branch (365:10): [True: 679, False: 0]
  ------------------
  366|    679|}
_ZNK5Exiv29Exifdatum8dataAreaEv:
  368|    249|DataBuf Exifdatum::dataArea() const {
  369|    249|  return value_ ? value_->dataArea() : DataBuf(nullptr, 0);
  ------------------
  |  Branch (369:10): [True: 249, False: 0]
  ------------------
  370|    249|}
_ZN5Exiv210ExifThumbCC2ERKNS_8ExifDataE:
  372|     28|ExifThumbC::ExifThumbC(const ExifData& exifData) : exifData_(exifData) {
  373|     28|}
_ZN5Exiv29ExifThumbC2ERNS_8ExifDataE:
  411|     28|ExifThumb::ExifThumb(ExifData& exifData) : ExifThumbC(exifData), exifData_(exifData) {
  412|     28|}
_ZN5Exiv29ExifThumb16setJpegThumbnailEPKhm:
  435|     28|void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
  436|     28|  exifData_["Exif.Thumbnail.Compression"] = std::uint16_t{6};
  437|     28|  Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
  438|     28|  format = 0U;
  439|     28|  format.setDataArea(buf, size);
  440|     28|  exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
  441|     28|}
_ZN5Exiv28ExifDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  447|  25.6k|Exifdatum& ExifData::operator[](const std::string& key) {
  448|  25.6k|  ExifKey exifKey(key);
  449|  25.6k|  auto pos = findKey(exifKey);
  450|  25.6k|  if (pos == end()) {
  ------------------
  |  Branch (450:7): [True: 3.96k, False: 21.6k]
  ------------------
  451|  3.96k|    return exifMetadata_.emplace_back(exifKey);
  452|  3.96k|  }
  453|  21.6k|  return *pos;
  454|  25.6k|}
_ZN5Exiv28ExifData3addERKNS_7ExifKeyEPKNS_5ValueE:
  456|  1.03M|void ExifData::add(const ExifKey& key, const Value* pValue) {
  457|  1.03M|  add(Exifdatum(key, pValue));
  458|  1.03M|}
_ZN5Exiv28ExifData3addERKNS_9ExifdatumE:
  460|  1.03M|void ExifData::add(const Exifdatum& exifdatum) {
  461|       |  // allow duplicates
  462|  1.03M|  exifMetadata_.push_back(exifdatum);
  463|  1.03M|}
_ZNK5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  465|   727k|ExifData::const_iterator ExifData::findKey(const ExifKey& key) const {
  466|   727k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  467|   727k|}
_ZN5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  469|  84.8k|ExifData::iterator ExifData::findKey(const ExifKey& key) {
  470|  84.8k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  471|  84.8k|}
_ZN5Exiv28ExifData5clearEv:
  473|  30.9k|void ExifData::clear() {
  474|  30.9k|  exifMetadata_.clear();
  475|  30.9k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEES5_:
  485|  4.19k|ExifData::iterator ExifData::erase(ExifData::iterator beg, ExifData::iterator end) {
  486|  4.19k|  return exifMetadata_.erase(beg, end);
  487|  4.19k|}
_ZN5Exiv212DecodeParamsC2Em:
  493|  29.9k|DecodeParams::DecodeParams(size_t max_recursion_depth) : max_recursion_depth_(max_recursion_depth) {
  494|  29.9k|}
_ZN5Exiv210ExifParser6decodeERNS_8ExifDataEPKhmRKNS_12DecodeParamsE:
  496|    363|ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size, const DecodeParams& dp) {
  497|    363|  IptcData iptcData;
  498|    363|  XmpData xmpData;
  499|    363|  ByteOrder bo = TiffParser::decode(exifData, iptcData, xmpData, pData, size, dp);
  500|    363|#ifndef SUPPRESS_WARNINGS
  501|    363|  if (!iptcData.empty()) {
  ------------------
  |  Branch (501:7): [True: 12, False: 351]
  ------------------
  502|     12|    EXV_WARNING << "Ignoring IPTC information encoded in the Exif data.\n";
  ------------------
  |  |  138|     12|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 12]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     12|  LogMsg(LogMsg::warn).os()
  ------------------
  503|     12|  }
  504|    363|  if (!xmpData.empty()) {
  ------------------
  |  Branch (504:7): [True: 1, False: 362]
  ------------------
  505|      1|    EXV_WARNING << "Ignoring XMP information encoded in the Exif data.\n";
  ------------------
  |  |  138|      1|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      1|  LogMsg(LogMsg::warn).os()
  ------------------
  506|      1|  }
  507|    363|#endif
  508|    363|  return bo;
  509|    363|}
exif.cpp:_ZNK12_GLOBAL__N_118FindExifdatumByKeyclERKN5Exiv29ExifdatumE:
   45|  35.1M|  bool operator()(const Exiv2::Exifdatum& exifdatum) const {
   46|  35.1M|    return key_ == exifdatum.key();
   47|  35.1M|  }
exif.cpp:_ZN12_GLOBAL__N_118FindExifdatumByKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   39|   812k|  explicit FindExifdatumByKey(std::string key) : key_(std::move(key)) {
   40|   812k|  }
_ZN5Exiv28setValueItEERNS_9ExifdatumES2_RKT_:
  150|     30|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|     30|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|     30|  v->value_.push_back(value);
  153|     30|  exifDatum.value_ = std::move(v);
  154|     30|  return exifDatum;
  155|     30|}
_ZN5Exiv28setValueIjEERNS_9ExifdatumES2_RKT_:
  150|  3.04k|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|  3.04k|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|  3.04k|  v->value_.push_back(value);
  153|  3.04k|  exifDatum.value_ = std::move(v);
  154|  3.04k|  return exifDatum;
  155|  3.04k|}

_ZN5Exiv28Internal13FujiMakerNote7tagListEv:
   19|    368|  static constexpr auto tagList() {
   20|    368|    return tagInfo_;
   21|    368|  }

_ZN5Exiv28GifImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   20|     39|    Image(ImageType::gif, mdNone, std::move(io), params) {
   21|     39|}
_ZNK5Exiv28GifImage8mimeTypeEv:
   23|      6|std::string GifImage::mimeType() const {
   24|      6|  return "image/gif";
   25|      6|}
_ZN5Exiv28GifImage12readMetadataEv:
   42|     29|void GifImage::readMetadata() {
   43|       |#ifdef EXIV2_DEBUG_MESSAGES
   44|       |  std::cerr << "Exiv2::GifImage::readMetadata: Reading GIF file " << io_->path() << "\n";
   45|       |#endif
   46|     29|  if (io_->open() != 0) {
  ------------------
  |  Branch (46:7): [True: 0, False: 29]
  ------------------
   47|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   48|      0|  }
   49|     29|  IoCloser closer(*io_);
   50|       |  // Ensure that this is the correct image type
   51|     29|  if (!isGifType(*io_, true)) {
  ------------------
  |  Branch (51:7): [True: 0, False: 29]
  ------------------
   52|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (52:9): [True: 0, False: 0]
  |  Branch (52:25): [True: 0, False: 0]
  ------------------
   53|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   54|      0|    throw Error(ErrorCode::kerNotAnImage, "GIF");
   55|      0|  }
   56|     29|  clearMetadata();
   57|       |
   58|     29|  byte buf[4];
   59|     29|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (59:7): [True: 29, False: 0]
  ------------------
   60|     29|    pixelWidth_ = getShort(buf, littleEndian);
   61|     29|    pixelHeight_ = getShort(buf + 2, littleEndian);
   62|     29|  }
   63|     29|}  // GifImage::readMetadata
_ZN5Exiv214newGifInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
   72|     39|Image::UniquePtr newGifInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
   73|     39|  auto image = std::make_unique<GifImage>(std::move(io), params);
   74|     39|  if (!image->good()) {
  ------------------
  |  Branch (74:7): [True: 10, False: 29]
  ------------------
   75|     10|    return nullptr;
   76|     10|  }
   77|     29|  return image;
   78|     39|}
_ZN5Exiv29isGifTypeERNS_7BasicIoEb:
   80|  15.6k|bool isGifType(BasicIo& iIo, bool advance) {
   81|  15.6k|  const int32_t len = 6;
   82|  15.6k|  const std::array<byte, len> Gif87aId{'G', 'I', 'F', '8', '7', 'a'};
   83|  15.6k|  const std::array<byte, len> Gif89aId{'G', 'I', 'F', '8', '9', 'a'};
   84|  15.6k|  std::array<byte, len> buf;
   85|  15.6k|  iIo.read(buf.data(), len);
   86|  15.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (86:7): [True: 0, False: 15.6k]
  |  Branch (86:22): [True: 324, False: 15.3k]
  ------------------
   87|    324|    return false;
   88|    324|  }
   89|  15.3k|  bool matched = buf == Gif87aId || buf == Gif89aId;
  ------------------
  |  Branch (89:18): [True: 34, False: 15.3k]
  |  Branch (89:37): [True: 63, False: 15.2k]
  ------------------
   90|  15.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (90:7): [True: 15.3k, False: 29]
  |  Branch (90:19): [True: 0, False: 29]
  ------------------
   91|  15.3k|    iIo.seek(-len, BasicIo::cur);
   92|  15.3k|  }
   93|  15.3k|  return matched;
   94|  15.6k|}

_Z24string_from_unterminatedPKcm:
   13|  9.55k|std::string string_from_unterminated(const char* data, size_t data_length) {
   14|  9.55k|  if (data_length == 0) {
  ------------------
  |  Branch (14:7): [True: 0, False: 9.55k]
  ------------------
   15|      0|    return {};
   16|      0|  }
   17|  9.55k|  const size_t StringLength = strnlen(data, data_length);
   18|  9.55k|  return {data, StringLength};
   19|  9.55k|}
_ZN5Exiv212readQWORDTagERKNSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEE:
   22|  4.58k|uint64_t readQWORDTag(const BasicIo::UniquePtr& io) {
   23|  4.58k|  Internal::enforce(QWORD <= io->size() - io->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
   24|  4.58k|  auto FieldBuf = io->read(QWORD);
   25|  4.58k|  return FieldBuf.read_uint64(0, littleEndian);
   26|  4.58k|}
_ZN5Exiv212readDWORDTagERKNSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEE:
   28|  43.5k|uint32_t readDWORDTag(const BasicIo::UniquePtr& io) {
   29|  43.5k|  Internal::enforce(DWORD <= io->size() - io->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
   30|  43.5k|  DataBuf FieldBuf = io->read(DWORD);
   31|  43.5k|  return FieldBuf.read_uint32(0, littleEndian);
   32|  43.5k|}
_ZN5Exiv211readWORDTagERKNSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEE:
   34|  6.10k|uint16_t readWORDTag(const BasicIo::UniquePtr& io) {
   35|  6.10k|  Internal::enforce(WORD <= io->size() - io->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
   36|  6.10k|  DataBuf FieldBuf = io->read(WORD);
   37|  6.10k|  return FieldBuf.read_uint16(0, littleEndian);
   38|  6.10k|}
_ZN5Exiv218readStringWcharTagERKNSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEm:
   40|  1.51k|std::string readStringWcharTag(const BasicIo::UniquePtr& io, size_t length) {
   41|  1.51k|  Internal::enforce(length >= 2 && length <= io->size() - io->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (41:21): [True: 1.50k, False: 12]
  |  Branch (41:36): [True: 1.35k, False: 148]
  ------------------
   42|  1.51k|  DataBuf FieldBuf(length + 1);
   43|  1.51k|  io->readOrThrow(FieldBuf.data(), length, ErrorCode::kerFailedToReadImageData);
   44|  1.51k|  std::string wst(FieldBuf.begin(), FieldBuf.end() - 3);
   45|  1.51k|  if (wst.size() % 2 != 0)
  ------------------
  |  Branch (45:7): [True: 446, False: 1.07k]
  ------------------
   46|    446|    Exiv2::convertStringCharset(wst, "UCS-2LE", "UTF-8");
   47|  1.51k|  Exiv2::convertStringCharset(wst, "UCS-2LE", "UTF-8");
   48|  1.51k|  return wst;
   49|  1.51k|}
_ZN5Exiv213readStringTagERKNSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEm:
   51|  36.3k|std::string readStringTag(const BasicIo::UniquePtr& io, size_t length) {
   52|  36.3k|  Internal::enforce(length <= io->size() - io->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
   53|  36.3k|  DataBuf FieldBuf(length + 1);
   54|  36.3k|  io->readOrThrow(FieldBuf.data(), length, ErrorCode::kerFailedToReadImageData);
   55|  36.3k|  return Exiv2::toString(FieldBuf.data()).substr(0, length);
   56|  36.3k|}
_ZN5Exiv214getAspectRatioEmm:
   58|  2.97k|std::string getAspectRatio(uint64_t width, uint64_t height) {
   59|  2.97k|  if (height == 0 || width == 0)
  ------------------
  |  Branch (59:7): [True: 38, False: 2.93k]
  |  Branch (59:22): [True: 27, False: 2.91k]
  ------------------
   60|     65|    return std::to_string(width) + ":" + std::to_string(height);
   61|       |
   62|  2.91k|  auto ratioWidth = width / std::gcd(width, height);
   63|  2.91k|  auto ratioHeight = height / std::gcd(width, height);
   64|  2.91k|  return std::to_string(ratioWidth) + ":" + std::to_string(ratioHeight);
   65|  2.97k|}

_ZN5Exiv215ImageCtorParamsC2Ebm:
  141|  35.4k|    create_(create), max_recursion_depth_(max_recursion_depth) {
  142|  35.4k|}
_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsE:
  145|  35.4k|    io_(std::move(io)),
  146|  35.4k|    max_recursion_depth_(params.max_recursion_depth()),
  147|  35.4k|    imageType_(type),
  148|  35.4k|    supportedMetadata_(supportedMetadata) {
  149|  35.4k|}
_ZN5Exiv25ImageD2Ev:
  151|  35.4k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  189|    453|bool Image::isBigEndianPlatform() {
  190|    453|  return std::endian::native == std::endian::big;
  191|    453|}
_ZN5Exiv25Image8byteSwapEjb:
  213|  1.33k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  214|       |#ifdef __cpp_lib_byteswap
  215|       |  return bSwap ? std::byteswap(value) : value;
  216|       |#elif defined(_MSC_VER)
  217|       |  return bSwap ? _byteswap_ulong(value) : value;
  218|       |#else
  219|  1.33k|  uint32_t result = 0;
  220|  1.33k|  result |= (value & 0x000000FFU) << 24;
  221|  1.33k|  result |= (value & 0x0000FF00U) << 8;
  222|  1.33k|  result |= (value & 0x00FF0000U) >> 8;
  223|  1.33k|  result |= (value & 0xFF000000U) >> 24;
  224|  1.33k|  return bSwap ? result : value;
  ------------------
  |  Branch (224:10): [True: 0, False: 1.33k]
  ------------------
  225|  1.33k|#endif
  226|  1.33k|}
_ZN5Exiv25Image13clearMetadataEv:
  545|  30.5k|void Image::clearMetadata() {
  546|  30.5k|  clearExifData();
  547|  30.5k|  clearIptcData();
  548|  30.5k|  clearXmpPacket();
  549|  30.5k|  clearXmpData();
  550|  30.5k|  clearComment();
  551|  30.5k|  clearIccProfile();
  552|  30.5k|}
_ZN5Exiv25Image8exifDataEv:
  554|  5.69k|ExifData& Image::exifData() {
  555|  5.69k|  return exifData_;
  556|  5.69k|}
_ZN5Exiv25Image8iptcDataEv:
  558|  3.04k|IptcData& Image::iptcData() {
  559|  3.04k|  return iptcData_;
  560|  3.04k|}
_ZN5Exiv25Image7xmpDataEv:
  562|  14.4k|XmpData& Image::xmpData() {
  563|  14.4k|  return xmpData_;
  564|  14.4k|}
_ZN5Exiv25Image9xmpPacketEv:
  566|  3.86k|std::string& Image::xmpPacket() {
  567|       |  // Serialize the current XMP
  568|  3.86k|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (568:7): [True: 0, False: 3.86k]
  |  Branch (568:28): [True: 0, False: 0]
  ------------------
  569|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  570|      0|  }
  571|  3.86k|  return xmpPacket_;
  572|  3.86k|}
_ZN5Exiv25Image13clearExifDataEv:
  594|  30.5k|void Image::clearExifData() {
  595|  30.5k|  exifData_.clear();
  596|  30.5k|}
_ZN5Exiv25Image13clearIptcDataEv:
  602|  30.6k|void Image::clearIptcData() {
  603|  30.6k|  iptcData_.clear();
  604|  30.6k|}
_ZN5Exiv25Image14clearXmpPacketEv:
  610|  30.5k|void Image::clearXmpPacket() {
  611|  30.5k|  xmpPacket_.clear();
  612|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  613|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  614|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  615|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  616|  30.5k|  xmpData_.setPacket(std::string());
  617|  30.5k|  writeXmpFromPacket(true);
  618|  30.5k|}
_ZN5Exiv25Image12clearXmpDataEv:
  628|  30.5k|void Image::clearXmpData() {
  629|  30.5k|  xmpData_.clear();
  630|  30.5k|  writeXmpFromPacket(false);
  631|  30.5k|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  639|  61.1k|void Image::writeXmpFromPacket(bool flag) {
  640|  61.1k|  writeXmpFromPacket_ = flag;
  641|  61.1k|}
_ZN5Exiv25Image12clearCommentEv:
  647|  30.5k|void Image::clearComment() {
  648|  30.5k|  comment_.erase();
  649|  30.5k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  651|     91|void Image::setComment(const std::string& comment) {
  652|     91|  comment_ = comment;
  653|     91|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  655|    137|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  656|    137|  iccProfile_ = std::move(iccProfile);
  657|    137|  if (bTestValid) {
  ------------------
  |  Branch (657:7): [True: 137, False: 0]
  ------------------
  658|    137|    checkIccProfile();
  659|    137|  }
  660|    137|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  662|  2.05k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  663|  2.05k|  if (size == 0) {
  ------------------
  |  Branch (663:7): [True: 484, False: 1.57k]
  ------------------
  664|    484|    return;
  665|    484|  }
  666|  1.57k|  const size_t start = iccProfile_.size();
  667|  1.57k|  iccProfile_.resize(Safe::add(start, size));
  668|  1.57k|  memcpy(iccProfile_.data(start), bytes, size);
  669|  1.57k|  if (bTestValid) {
  ------------------
  |  Branch (669:7): [True: 19, False: 1.55k]
  ------------------
  670|     19|    checkIccProfile();
  671|     19|  }
  672|  1.57k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  674|    156|void Image::checkIccProfile() const {
  675|    156|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (675:7): [True: 27, False: 129]
  ------------------
  676|     27|    throw Error(ErrorCode::kerInvalidIccProfile);
  677|     27|  }
  678|    129|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  679|    129|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (679:7): [True: 94, False: 35]
  ------------------
  680|     94|    throw Error(ErrorCode::kerInvalidIccProfile);
  681|     94|  }
  682|    129|}
_ZN5Exiv25Image15clearIccProfileEv:
  684|  30.5k|void Image::clearIccProfile() {
  685|  30.5k|  iccProfile_.reset();
  686|  30.5k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  688|  11.5k|void Image::setByteOrder(ByteOrder byteOrder) {
  689|  11.5k|  byteOrder_ = byteOrder;
  690|  11.5k|}
_ZNK5Exiv25Image9byteOrderEv:
  692|     45|ByteOrder Image::byteOrder() const {
  693|     45|  return byteOrder_;
  694|     45|}
_ZNK5Exiv25Image10pixelWidthEv:
  696|  2.18k|uint32_t Image::pixelWidth() const {
  697|  2.18k|  return pixelWidth_;
  698|  2.18k|}
_ZNK5Exiv25Image11pixelHeightEv:
  700|  2.18k|uint32_t Image::pixelHeight() const {
  701|  2.18k|  return pixelHeight_;
  702|  2.18k|}
_ZNK5Exiv25Image8exifDataEv:
  704|   642k|const ExifData& Image::exifData() const {
  705|   642k|  return exifData_;
  706|   642k|}
_ZNK5Exiv25Image7xmpDataEv:
  712|  17.0k|const XmpData& Image::xmpData() const {
  713|  17.0k|  return xmpData_;
  714|  17.0k|}
_ZNK5Exiv25Image7commentEv:
  716|    265|std::string Image::comment() const {
  717|    265|  return comment_;
  718|    265|}
_ZNK5Exiv25Image2ioEv:
  724|  29.2k|BasicIo& Image::io() const {
  725|  29.2k|  return *io_;
  726|  29.2k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  732|  71.5k|const NativePreviewList& Image::nativePreviews() const {
  733|  71.5k|  return nativePreviews_;
  734|  71.5k|}
_ZNK5Exiv25Image4goodEv:
  736|  35.3k|bool Image::good() const {
  737|  35.3k|  if (io_->open() != 0)
  ------------------
  |  Branch (737:7): [True: 0, False: 35.3k]
  ------------------
  738|      0|    return false;
  739|  35.3k|  IoCloser closer(*io_);
  740|  35.3k|  return ImageFactory::checkType(imageType_, *io_, false);
  741|  35.3k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  791|  35.3k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  792|  35.3k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (792:12): [True: 35.3k, False: 0]
  ------------------
  793|  35.3k|    return r->isThisType_(io, advance);
  794|      0|  return false;
  795|  35.3k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  877|  36.1k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  878|  36.1k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  879|  36.1k|  if (!image)
  ------------------
  |  Branch (879:7): [True: 725, False: 35.4k]
  ------------------
  880|    725|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  881|  35.4k|  return image;
  882|  36.1k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  884|  36.1k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  885|  36.1k|  if (io->open() != 0) {
  ------------------
  |  Branch (885:7): [True: 0, False: 36.1k]
  ------------------
  886|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  887|      0|  }
  888|   639k|  for (const auto& r : registry) {
  ------------------
  |  Branch (888:22): [True: 639k, False: 890]
  ------------------
  889|   639k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (889:9): [True: 35.3k, False: 603k]
  ------------------
  890|  35.3k|      return r.newInstance_(std::move(io), ImageCtorParams(false, 1000));
  891|  35.3k|    }
  892|   639k|  }
  893|    890|  return nullptr;
  894|  36.1k|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  932|  16.1k|void append(Blob& blob, const byte* buf, size_t len) {
  933|  16.1k|  if (len != 0) {
  ------------------
  |  Branch (933:7): [True: 16.1k, False: 0]
  ------------------
  934|  16.1k|    Blob::size_type size = blob.size();
  935|  16.1k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (935:9): [True: 607, False: 15.5k]
  ------------------
  936|    607|      blob.reserve(size + 65536);
  937|    607|    }
  938|  16.1k|    blob.resize(size + len);
  939|  16.1k|    std::copy_n(buf, len, blob.begin() + size);
  940|  16.1k|  }
  941|  16.1k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   615k|  bool operator==(const ImageType& imageType) const {
   67|   615k|    return imageType == imageType_;
   68|   615k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  45.3k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  45.3k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 40.5k, False: 4.85k]
  ------------------
   58|  40.5k|    value_ = pValue->clone();
   59|  45.3k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|  33.0k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|  33.0k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 33.0k, False: 0]
  ------------------
   63|  33.0k|    key_ = rhs.key_->clone();  // deep copy
   64|  33.0k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 33.0k, False: 0]
  ------------------
   65|  33.0k|    value_ = rhs.value_->clone();  // deep copy
   66|  33.0k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|  78.4k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   110k|uint16_t Iptcdatum::record() const {
   87|   110k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 110k, False: 0]
  ------------------
   88|   110k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   276k|uint16_t Iptcdatum::tag() const {
  111|   276k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 276k, False: 0]
  ------------------
  112|   276k|}
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|    748|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|    748|  setValue(value);
  188|    748|  return *this;
  189|    748|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  4.97k|int Iptcdatum::setValue(const std::string& value) {
  203|  4.97k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 4.85k, False: 117]
  ------------------
  204|  4.85k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  4.85k|    value_ = Value::create(type);
  206|  4.85k|  }
  207|  4.97k|  return value_->read(value);
  208|  4.97k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|    748|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|    748|  IptcKey iptcKey(key);
  212|    748|  auto pos = findKey(iptcKey);
  213|    748|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 631, False: 117]
  ------------------
  214|    631|    return iptcMetadata_.emplace_back(iptcKey);
  215|    631|  }
  216|    117|  return *pos;
  217|    748|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  40.5k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  40.5k|  return add(Iptcdatum(key, value));
  236|  40.5k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  44.7k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  44.7k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 30.1k, False: 14.6k]
  |  Branch (239:7): [True: 28.7k, False: 15.9k]
  ------------------
  240|  30.1k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 28.7k, False: 1.35k]
  ------------------
  241|  28.7k|    return 6;
  242|  28.7k|  }
  243|       |  // allow duplicates
  244|  15.9k|  iptcMetadata_.push_back(iptcDatum);
  245|  15.9k|  return 0;
  246|  44.7k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  1.33k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  1.33k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  1.33k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  30.1k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  30.1k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  30.1k|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  1.58k|int IptcParser::decode(IptcData& iptcData, const byte* pData, size_t size) {
  363|       |#ifdef EXIV2_DEBUG_MESSAGES
  364|       |  std::cerr << "IptcParser::decode, size = " << size << "\n";
  365|       |#endif
  366|  1.58k|  auto pRead = pData;
  367|  1.58k|  const auto pEnd = pData + size;
  368|  1.58k|  iptcData.clear();
  369|       |
  370|  1.58k|  uint16_t record = 0;
  371|  1.58k|  uint16_t dataSet = 0;
  372|  1.58k|  uint32_t sizeData = 0;
  373|  1.58k|  byte extTest = 0;
  374|       |
  375|  1.81M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.81M, False: 1.04k]
  ------------------
  376|       |    // First byte should be a marker. If it isn't, scan forward and skip
  377|       |    // the chunk bytes present in some images. This deviates from the
  378|       |    // standard, which advises to treat such cases as errors.
  379|  1.81M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.77M, False: 41.0k]
  ------------------
  380|  1.77M|      continue;
  381|  41.0k|    record = *pRead++;
  382|  41.0k|    dataSet = *pRead++;
  383|       |
  384|  41.0k|    extTest = *pRead;
  385|  41.0k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 2.69k, False: 38.3k]
  ------------------
  386|       |      // extended dataset
  387|  2.69k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  2.69k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 162, False: 2.52k]
  ------------------
  389|    162|        return 5;
  390|  2.52k|      pRead += 2;
  391|  2.52k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 37, False: 2.49k]
  ------------------
  392|     37|        return 6;
  393|  2.49k|      sizeData = 0;
  394|  6.21k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 3.71k, False: 2.49k]
  ------------------
  395|  3.71k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  3.71k|      }
  397|  38.3k|    } else {
  398|       |      // standard dataset
  399|  38.3k|      sizeData = getUShort(pRead, bigEndian);
  400|  38.3k|      pRead += 2;
  401|  38.3k|    }
  402|  40.8k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 40.5k, False: 341]
  ------------------
  403|  40.5k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  40.5k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 40.5k]
  ------------------
  405|      0|#ifndef SUPPRESS_WARNINGS
  406|      0|        EXV_WARNING << "Failed to read IPTC dataset " << IptcKey(dataSet, record) << " (rc = " << rc << "); skipped.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  407|      0|#endif
  408|      0|      }
  409|  40.5k|    } else {
  410|    341|#ifndef SUPPRESS_WARNINGS
  411|    341|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    341|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 341]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    341|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    341|#endif
  413|    341|      return 7;
  414|    341|    }
  415|  40.5k|    pRead += sizeData;
  416|  40.5k|  }
  417|       |
  418|  1.04k|  return 0;
  419|  1.58k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  4.19k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  4.19k|  DataBuf buf;
  423|  4.19k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 4.19k, False: 0]
  ------------------
  424|  4.19k|    return buf;
  425|       |
  426|      0|  buf = DataBuf(iptcData.size());
  427|      0|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|      0|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|      0|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|      0|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|      0|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 0, False: 0]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|      0|    *pWrite++ = marker_;
  437|      0|    *pWrite++ = static_cast<byte>(iter.record());
  438|      0|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|      0|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 0]
  ------------------
  442|       |      // always use 4 bytes for extended length
  443|      0|      uint16_t sizeOfSize = 4 | 0x8000;
  444|      0|      us2Data(pWrite, sizeOfSize, bigEndian);
  445|      0|      pWrite += 2;
  446|      0|      ul2Data(pWrite, static_cast<uint32_t>(dataSize), bigEndian);
  447|      0|      pWrite += 4;
  448|      0|    } else {
  449|      0|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|      0|      pWrite += 2;
  451|      0|    }
  452|      0|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|      0|  }
  454|       |
  455|      0|  return buf;
  456|  4.19k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   196k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   196k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 30.9k, False: 165k]
  |  Branch (42:43): [True: 28.8k, False: 2.04k]
  ------------------
   43|   196k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  31.4k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  31.4k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  40.5k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  40.5k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  40.5k|  auto value = Exiv2::Value::create(type);
  466|  40.5k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  40.5k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 16.2k, False: 24.2k]
  ------------------
  468|  16.2k|    Exiv2::IptcKey key(dataSet, record);
  469|  16.2k|    iptcData.add(key, value.get());
  470|  24.2k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 24.2k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  24.2k|    value = Exiv2::Value::create(Exiv2::string);
  473|  24.2k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  24.2k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 24.2k, False: 0]
  ------------------
  475|  24.2k|      Exiv2::IptcKey key(dataSet, record);
  476|  24.2k|      iptcData.add(key, value.get());
  477|  24.2k|    }
  478|  24.2k|  }
  479|  40.5k|  return rc;
  480|  40.5k|}

_ZN5Exiv28Jp2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  101|  1.29k|    Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io), params) {
  102|  1.29k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1.29k]
  |  Branch (102:26): [True: 0, False: 0]
  ------------------
  103|       |#ifdef EXIV2_DEBUG_MESSAGES
  104|       |    std::cerr << "Exiv2::Jp2Image:: Creating JPEG2000 image to memory" << '\n';
  105|       |#endif
  106|      0|    IoCloser closer(*io_);
  107|      0|    if (io_->write(Jp2Blank.data(), Jp2Blank.size()) != Jp2Blank.size()) {
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  108|       |#ifdef EXIV2_DEBUG_MESSAGES
  109|       |      std::cerr << "Exiv2::Jp2Image:: Failed to create JPEG2000 image on memory" << '\n';
  110|       |#endif
  111|      0|    }
  112|      0|  }
  113|  1.29k|}
_ZNK5Exiv28Jp2Image8mimeTypeEv:
  125|    879|std::string Jp2Image::mimeType() const {
  126|    879|  if (brand_ == Internal::brandJph)
  ------------------
  |  Branch (126:7): [True: 3, False: 876]
  ------------------
  127|      3|    return "image/jph";
  128|    876|  return "image/jp2";
  129|    879|}
_ZN5Exiv28Jp2Image12readMetadataEv:
  135|  1.28k|void Jp2Image::readMetadata() {
  136|       |#ifdef EXIV2_DEBUG_MESSAGES
  137|       |  std::cerr << "Exiv2::Jp2Image::readMetadata: Reading JPEG-2000 file " << io_->path() << '\n';
  138|       |#endif
  139|  1.28k|  if (io_->open() != 0) {
  ------------------
  |  Branch (139:7): [True: 0, False: 1.28k]
  ------------------
  140|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  141|      0|  }
  142|  1.28k|  IoCloser closer(*io_);
  143|  1.28k|  if (!isJp2Type(*io_, false)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 1.28k]
  ------------------
  144|      0|    throw Error(ErrorCode::kerNotAnImage, "JPEG-2000");
  145|      0|  }
  146|       |
  147|  1.28k|  Internal::Jp2BoxHeader box = {0, 0};
  148|  1.28k|  Internal::Jp2BoxHeader subBox = {0, 0};
  149|  1.28k|  Internal::Jp2ImageHeaderBox ihdr = {0, 0, 0, 0, 0, 0, 0};
  150|  1.28k|  Internal::Jp2UuidBox uuid = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  151|  1.28k|  size_t boxesCount = 0;
  152|  1.28k|  const size_t boxem = 1000;  // boxes max
  153|  1.28k|  uint32_t lastBoxTypeRead = 0;
  154|  1.28k|  bool boxSignatureFound = false;
  155|  1.28k|  bool boxFileTypeFound = false;
  156|       |
  157|  10.1k|  while (io_->read(reinterpret_cast<byte*>(&box), boxHSize) == boxHSize) {
  ------------------
  |  Branch (157:10): [True: 9.87k, False: 291]
  ------------------
  158|  9.87k|    boxes_check(boxesCount++, boxem);
  159|  9.87k|    const size_t position = io_->tell();
  160|  9.87k|    box.length = getULong(reinterpret_cast<byte*>(&box.length), bigEndian);
  161|  9.87k|    box.type = getULong(reinterpret_cast<byte*>(&box.type), bigEndian);
  162|       |#ifdef EXIV2_DEBUG_MESSAGES
  163|       |    std::cout << "Exiv2::Jp2Image::readMetadata: Position: " << position << " box type: " << toAscii(box.type)
  164|       |              << " length: " << box.length << '\n';
  165|       |#endif
  166|  9.87k|    Internal::enforce(box.length <= boxHSize + io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  9.87k|    if (box.length == 0)
  ------------------
  |  Branch (168:9): [True: 36, False: 9.83k]
  ------------------
  169|     36|      return;
  170|       |
  171|  9.83k|    if (box.length == 1) {
  ------------------
  |  Branch (171:9): [True: 6, False: 9.83k]
  ------------------
  172|       |      /// \todo In this case, the real box size is given in XLBox (bytes 8-15)
  173|      6|    }
  174|       |
  175|  9.83k|    switch (box.type) {
  176|  1.29k|      case kJp2BoxType::Signature: {
  ------------------
  |  Branch (176:7): [True: 1.29k, False: 8.53k]
  ------------------
  177|  1.29k|        if (boxSignatureFound)  // Only one is allowed
  ------------------
  |  Branch (177:13): [True: 10, False: 1.28k]
  ------------------
  178|     10|          throw Error(ErrorCode::kerCorruptedMetadata);
  179|  1.28k|        boxSignatureFound = true;
  180|  1.28k|        break;
  181|  1.29k|      }
  182|    219|      case kJp2BoxType::FileTypeBox: {
  ------------------
  |  Branch (182:7): [True: 219, False: 9.61k]
  ------------------
  183|       |        // This box shall immediately follow the JPEG 2000 Signature box
  184|    219|        if (boxFileTypeFound || lastBoxTypeRead != kJp2BoxType::Signature) {  // Only one is allowed
  ------------------
  |  Branch (184:13): [True: 6, False: 213]
  |  Branch (184:33): [True: 12, False: 201]
  ------------------
  185|     18|          throw Error(ErrorCode::kerCorruptedMetadata);
  186|     18|        }
  187|    201|        boxFileTypeFound = true;
  188|    201|        Internal::enforce(box.length >= boxHSize, ErrorCode::kerCorruptedMetadata);
  189|    201|        Blob boxData(box.length - boxHSize);
  190|    201|        io_->readOrThrow(boxData.data(), boxData.size(), ErrorCode::kerCorruptedMetadata);
  191|    201|        if (!Internal::isValidBoxFileType(boxData))
  ------------------
  |  Branch (191:13): [True: 169, False: 32]
  ------------------
  192|    169|          throw Error(ErrorCode::kerCorruptedMetadata);
  193|     32|        brand_ = getULong(boxData.data(), bigEndian);
  194|     32|        break;
  195|    201|      }
  196|    423|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (196:7): [True: 423, False: 9.41k]
  ------------------
  197|       |#ifdef EXIV2_DEBUG_MESSAGES
  198|       |        std::cout << "Exiv2::Jp2Image::readMetadata: JP2Header box found\n";
  199|       |#endif
  200|    423|        size_t restore = io_->tell();
  201|       |
  202|  3.14k|        while (io_->read(reinterpret_cast<byte*>(&subBox), boxHSize) == boxHSize && subBox.length) {
  ------------------
  |  Branch (202:16): [True: 3.07k, False: 72]
  |  Branch (202:85): [True: 2.86k, False: 209]
  ------------------
  203|  2.86k|          boxes_check(boxesCount++, boxem);
  204|  2.86k|          subBox.length = getULong(reinterpret_cast<byte*>(&subBox.length), bigEndian);
  205|  2.86k|          subBox.type = getULong(reinterpret_cast<byte*>(&subBox.type), bigEndian);
  206|  2.86k|          if (subBox.length > io_->size()) {
  ------------------
  |  Branch (206:15): [True: 78, False: 2.78k]
  ------------------
  207|     78|            throw Error(ErrorCode::kerCorruptedMetadata);
  208|     78|          }
  209|       |#ifdef EXIV2_DEBUG_MESSAGES
  210|       |          std::cout << "Exiv2::Jp2Image::readMetadata: "
  211|       |                    << "subBox = " << toAscii(subBox.type) << " length = " << subBox.length << '\n';
  212|       |#endif
  213|  2.78k|          if (subBox.type == kJp2BoxType::ColorSpec && subBox.length != 15) {
  ------------------
  |  Branch (213:15): [True: 171, False: 2.61k]
  |  Branch (213:56): [True: 75, False: 96]
  ------------------
  214|       |#ifdef EXIV2_DEBUG_MESSAGES
  215|       |            std::cout << "Exiv2::Jp2Image::readMetadata: "
  216|       |                      << "Color data found" << '\n';
  217|       |#endif
  218|       |
  219|     75|            const size_t pad = 3;  // 3 padding bytes 2 0 0
  220|     75|            const size_t data_length = Safe::add(subBox.length, 8u);
  221|       |            // data_length makes no sense if it is larger than the rest of the file
  222|     75|            if (data_length > io_->size() - io_->tell()) {
  ------------------
  |  Branch (222:17): [True: 10, False: 65]
  ------------------
  223|     10|              throw Error(ErrorCode::kerCorruptedMetadata);
  224|     10|            }
  225|     65|            DataBuf data(data_length);
  226|     65|            io_->read(data.data(), data.size());
  227|     65|            const size_t iccLength = data.read_uint32(pad, bigEndian);
  228|       |            // subtracting pad from data.size() is safe:
  229|       |            // data.size() is at least 8 and pad = 3
  230|     65|            if (iccLength > data.size() - pad) {
  ------------------
  |  Branch (230:17): [True: 34, False: 31]
  ------------------
  231|     34|              throw Error(ErrorCode::kerCorruptedMetadata);
  232|     34|            }
  233|     31|            DataBuf icc(iccLength);
  234|     31|            std::copy_n(data.begin() + pad, icc.size(), icc.begin());
  235|       |#ifdef EXIV2_DEBUG_MESSAGES
  236|       |            const char* iccPath = "/tmp/libexiv2_jp2.icc";
  237|       |            if (auto f = std::ofstream(iccPath, std::ios::binary)) {
  238|       |              f.write(reinterpret_cast<const char*>(icc.c_data()), static_cast<std::streamsize>(icc.size()));
  239|       |              f.close();
  240|       |              std::cout << "Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size() << " bytes to " << iccPath
  241|       |                        << '\n';
  242|       |            }
  243|       |#endif
  244|     31|            setIccProfile(std::move(icc));
  245|     31|          }
  246|       |
  247|  2.74k|          if (subBox.type == kJp2BoxType::ImageHeader) {
  ------------------
  |  Branch (247:15): [True: 44, False: 2.69k]
  ------------------
  248|     44|            io_->read(reinterpret_cast<byte*>(&ihdr), sizeof(ihdr));
  249|       |#ifdef EXIV2_DEBUG_MESSAGES
  250|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Ihdr data found" << '\n';
  251|       |#endif
  252|     44|            ihdr.imageHeight = getULong(reinterpret_cast<byte*>(&ihdr.imageHeight), bigEndian);
  253|     44|            ihdr.imageWidth = getULong(reinterpret_cast<byte*>(&ihdr.imageWidth), bigEndian);
  254|     44|            ihdr.componentCount = getShort(reinterpret_cast<byte*>(&ihdr.componentCount), bigEndian);
  255|     44|            Internal::enforce(ihdr.c == 7, ErrorCode::kerCorruptedMetadata);
  256|       |
  257|     44|            pixelWidth_ = ihdr.imageWidth;
  258|     44|            pixelHeight_ = ihdr.imageHeight;
  259|     44|          }
  260|       |
  261|  2.74k|          io_->seek(restore, BasicIo::beg);
  262|  2.74k|          if (io_->seek(subBox.length, BasicIo::cur) != 0) {
  ------------------
  |  Branch (262:15): [True: 20, False: 2.72k]
  ------------------
  263|     20|            throw Error(ErrorCode::kerCorruptedMetadata);
  264|     20|          }
  265|  2.72k|          restore = io_->tell();
  266|  2.72k|        }
  267|    281|        break;
  268|    423|      }
  269|       |
  270|  3.78k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (270:7): [True: 3.78k, False: 6.05k]
  ------------------
  271|       |#ifdef EXIV2_DEBUG_MESSAGES
  272|       |        std::cout << "Exiv2::Jp2Image::readMetadata: UUID box found" << '\n';
  273|       |#endif
  274|       |
  275|  3.78k|        if (io_->read(reinterpret_cast<byte*>(&uuid), sizeof(uuid)) == sizeof(uuid)) {
  ------------------
  |  Branch (275:13): [True: 3.77k, False: 3]
  ------------------
  276|  3.77k|          DataBuf rawData;
  277|  3.77k|          size_t bufRead;
  278|  3.77k|          bool bIsExif = uuid.uuid == kJp2UuidExif;
  279|  3.77k|          bool bIsIPTC = uuid.uuid == kJp2UuidIptc;
  280|  3.77k|          bool bIsXMP = uuid.uuid == kJp2UuidXmp;
  281|       |
  282|  3.77k|          if (bIsExif) {
  ------------------
  |  Branch (282:15): [True: 1.41k, False: 2.36k]
  ------------------
  283|       |#ifdef EXIV2_DEBUG_MESSAGES
  284|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Exif data found" << '\n';
  285|       |#endif
  286|  1.41k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  287|  1.41k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  288|  1.41k|            bufRead = io_->read(rawData.data(), rawData.size());
  289|  1.41k|            if (io_->error())
  ------------------
  |  Branch (289:17): [True: 0, False: 1.41k]
  ------------------
  290|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  291|  1.41k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (291:17): [True: 0, False: 1.41k]
  ------------------
  292|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  293|       |
  294|  1.41k|            if (rawData.size() > 8)  // "II*\0long"
  ------------------
  |  Branch (294:17): [True: 1.20k, False: 207]
  ------------------
  295|  1.20k|            {
  296|       |              // Find the position of Exif header in bytes array.
  297|  1.20k|              const char a = rawData.read_uint8(0);
  298|  1.20k|              const char b = rawData.read_uint8(1);
  299|  1.20k|              const size_t notfound = std::numeric_limits<size_t>::max();
  300|  1.20k|              size_t pos = (a == b && (a == 'I' || a == 'M')) ? 0 : notfound;
  ------------------
  |  Branch (300:29): [True: 907, False: 297]
  |  Branch (300:40): [True: 38, False: 869]
  |  Branch (300:52): [True: 625, False: 244]
  ------------------
  301|       |
  302|       |              // #1242  Forgive having Exif\0\0 in rawData.pData_
  303|  1.20k|              std::array<byte, 6> exifHeader{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  304|  3.37k|              for (size_t i = 0; pos == notfound && i < (rawData.size() - exifHeader.size()); i++) {
  ------------------
  |  Branch (304:34): [True: 2.69k, False: 674]
  |  Branch (304:53): [True: 2.16k, False: 530]
  ------------------
  305|  2.16k|                if (rawData.cmpBytes(i, exifHeader.data(), exifHeader.size()) == 0) {
  ------------------
  |  Branch (305:21): [True: 11, False: 2.15k]
  ------------------
  306|     11|                  pos = i + sizeof(exifHeader);
  307|     11|#ifndef SUPPRESS_WARNINGS
  308|     11|                  EXV_WARNING << "Reading non-standard UUID-EXIF_bad box in " << io_->path() << '\n';
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  309|     11|#endif
  310|     11|                }
  311|  2.16k|              }
  312|       |
  313|       |              // If found it, store only these data at from this place.
  314|  1.20k|              if (pos != notfound) {
  ------------------
  |  Branch (314:19): [True: 674, False: 530]
  ------------------
  315|       |#ifdef EXIV2_DEBUG_MESSAGES
  316|       |                std::cout << "Exiv2::Jp2Image::readMetadata: Exif header found at position " << pos << '\n';
  317|       |#endif
  318|    674|                const DecodeParams dp(max_recursion_depth_);
  319|    674|                ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), rawData.c_data(pos),
  320|    674|                                                  rawData.size() - pos, dp);
  321|    674|                setByteOrder(bo);
  322|    674|              }
  323|  1.20k|            } else {
  324|    207|#ifndef SUPPRESS_WARNINGS
  325|    207|              EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    207|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 207]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    207|  LogMsg(LogMsg::warn).os()
  ------------------
  326|    207|#endif
  327|    207|              exifData_.clear();
  328|    207|            }
  329|  1.41k|          }
  330|       |
  331|  3.77k|          if (bIsIPTC) {
  ------------------
  |  Branch (331:15): [True: 1.03k, False: 2.73k]
  ------------------
  332|       |#ifdef EXIV2_DEBUG_MESSAGES
  333|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Iptc data found" << '\n';
  334|       |#endif
  335|  1.03k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  336|  1.03k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  337|  1.03k|            bufRead = io_->read(rawData.data(), rawData.size());
  338|  1.03k|            if (io_->error())
  ------------------
  |  Branch (338:17): [True: 0, False: 1.03k]
  ------------------
  339|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  340|  1.03k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (340:17): [True: 0, False: 1.03k]
  ------------------
  341|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  342|       |
  343|  1.03k|            if (IptcParser::decode(iptcData_, rawData.c_data(), rawData.size())) {
  ------------------
  |  Branch (343:17): [True: 348, False: 691]
  ------------------
  344|    348|#ifndef SUPPRESS_WARNINGS
  345|    348|              EXV_WARNING << "Failed to decode IPTC metadata." << '\n';
  ------------------
  |  |  138|    348|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 348]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    348|  LogMsg(LogMsg::warn).os()
  ------------------
  346|    348|#endif
  347|    348|              iptcData_.clear();
  348|    348|            }
  349|  1.03k|          }
  350|       |
  351|  3.77k|          if (bIsXMP) {
  ------------------
  |  Branch (351:15): [True: 722, False: 3.05k]
  ------------------
  352|       |#ifdef EXIV2_DEBUG_MESSAGES
  353|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Xmp data found" << '\n';
  354|       |#endif
  355|    722|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  356|    722|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  357|    722|            bufRead = io_->read(rawData.data(), rawData.size());
  358|    722|            if (io_->error())
  ------------------
  |  Branch (358:17): [True: 0, False: 722]
  ------------------
  359|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  360|    722|            if (bufRead != rawData.size())
  ------------------
  |  Branch (360:17): [True: 0, False: 722]
  ------------------
  361|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  362|    722|            xmpPacket_.assign(rawData.c_str(), rawData.size());
  363|       |
  364|    722|            if (auto idx = xmpPacket_.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (364:59): [True: 185, False: 537]
  |  Branch (364:87): [True: 151, False: 34]
  ------------------
  365|    151|#ifndef SUPPRESS_WARNINGS
  366|    151|              EXV_WARNING << "Removing " << static_cast<uint32_t>(idx)
  ------------------
  |  |  138|    151|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 151]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    151|  LogMsg(LogMsg::warn).os()
  ------------------
  367|      0|                          << " characters from the beginning of the XMP packet" << '\n';
  368|    151|#endif
  369|    151|              xmpPacket_ = xmpPacket_.substr(idx);
  370|    151|            }
  371|       |
  372|    722|            const DecodeParams dp(max_recursion_depth_);
  373|    722|            if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (373:17): [True: 334, False: 388]
  |  Branch (373:40): [True: 306, False: 28]
  ------------------
  374|    306|#ifndef SUPPRESS_WARNINGS
  375|    306|              EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|    306|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 306]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    306|  LogMsg(LogMsg::warn).os()
  ------------------
  376|    306|#endif
  377|    306|            }
  378|    722|          }
  379|  3.77k|        }
  380|  3.78k|        break;
  381|  3.78k|      }
  382|       |
  383|  3.78k|      default:
  ------------------
  |  Branch (383:7): [True: 3.57k, False: 6.26k]
  ------------------
  384|  3.57k|        break;
  385|  9.83k|    }
  386|  8.87k|    lastBoxTypeRead = box.type;
  387|       |
  388|       |    // Move to the next box.
  389|  8.87k|    io_->seek(static_cast<int64_t>(position - boxHSize + box.length), BasicIo::beg);
  390|  8.87k|    if (io_->error())
  ------------------
  |  Branch (390:9): [True: 0, False: 8.87k]
  ------------------
  391|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  392|  8.87k|  }
  393|       |
  394|  1.28k|}  // Jp2Image::readMetadata
_ZN5Exiv214newJp2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  872|  1.29k|Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  873|  1.29k|  auto image = std::make_unique<Jp2Image>(std::move(io), params);
  874|  1.29k|  if (!image->good()) {
  ------------------
  |  Branch (874:7): [True: 10, False: 1.28k]
  ------------------
  875|     10|    return nullptr;
  876|     10|  }
  877|  1.28k|  return image;
  878|  1.29k|}
_ZN5Exiv29isJp2TypeERNS_7BasicIoEb:
  880|  16.8k|bool isJp2Type(BasicIo& iIo, bool advance) {
  881|  16.8k|  std::array<byte, Jp2Signature.size()> buf;
  882|  16.8k|  const size_t bytesRead = iIo.read(buf.data(), Jp2Signature.size());
  883|  16.8k|  if (iIo.error() || iIo.eof() || bytesRead != Jp2Signature.size()) {
  ------------------
  |  Branch (883:7): [True: 0, False: 16.8k]
  |  Branch (883:22): [True: 314, False: 16.5k]
  |  Branch (883:35): [True: 0, False: 16.5k]
  ------------------
  884|    314|    return false;
  885|    314|  }
  886|  16.5k|  bool matched = buf == Jp2Signature;
  887|  16.5k|  if (!advance || !matched) {
  ------------------
  |  Branch (887:7): [True: 16.5k, False: 0]
  |  Branch (887:19): [True: 0, False: 0]
  ------------------
  888|  16.5k|    iIo.seek(-static_cast<int64_t>(Jp2Signature.size()), BasicIo::cur);  // Return to original position
  889|  16.5k|  }
  890|  16.5k|  return matched;
  891|  16.8k|}
jp2image.cpp:_ZN5Exiv212_GLOBAL__N_111boxes_checkEmm:
   89|  12.7k|void boxes_check(size_t b, size_t m) {
   90|  12.7k|  if (b > m) {
  ------------------
  |  Branch (90:7): [True: 2, False: 12.7k]
  ------------------
   91|       |#ifdef EXIV2_DEBUG_MESSAGES
   92|       |    std::cout << "Exiv2::Jp2Image::readMetadata box maximum exceeded" << '\n';
   93|       |#endif
   94|      2|    throw Error(ErrorCode::kerCorruptedMetadata);
   95|      2|  }
   96|  12.7k|}

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    191|bool isValidBoxFileType(const std::vector<uint8_t>& boxData) {
   14|       |  // BR & MinV are obligatory (4 + 4 bytes). Afterwards we have N compatibility lists (of size 4)
   15|    191|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 10, False: 181]
  |  Branch (15:29): [True: 10, False: 171]
  ------------------
   16|     20|    return false;
   17|     20|  }
   18|       |
   19|    171|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    171|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    171|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    171|  bool clWithRightBrand = false;
   24|  1.76k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.63k, False: 127]
  ------------------
   25|  1.63k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.63k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 555, False: 1.08k]
  |  Branch (26:31): [True: 17, False: 538]
  |  Branch (26:66): [True: 401, False: 1.21k]
  |  Branch (26:87): [True: 27, False: 374]
  ------------------
   27|     44|      clWithRightBrand = true;
   28|     44|      break;
   29|     44|    }
   30|  1.63k|  }
   31|    171|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 45, False: 126]
  |  Branch (31:32): [True: 22, False: 23]
  ------------------
   32|    191|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  1.37k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  1.37k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 1.37k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  1.37k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  46.0k|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  46.0k|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|   716k|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 670k, False: 45.3k]
  ------------------
  138|   670k|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 668, False: 670k]
  ------------------
  139|    668|      throw Error(err);
  140|   670k|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  51.0k|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 5.65k, False: 45.3k]
  ------------------
  144|  5.65k|  }
  145|  45.3k|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 72, False: 45.3k]
  ------------------
  146|     72|    throw Error(err);
  147|       |
  148|  45.3k|  return static_cast<byte>(c);
  149|  45.3k|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  1.37k|void JpegBase::readMetadata() {
  152|  1.37k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  1.37k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 1.37k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  1.37k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  1.37k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 96, False: 1.27k]
  ------------------
  159|     96|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 96]
  |  Branch (159:25): [True: 0, False: 96]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|     96|    throw Error(ErrorCode::kerNotAJpeg);
  162|     96|  }
  163|  1.27k|  clearMetadata();
  164|  1.27k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  1.27k|  Blob psBlob;
  166|  1.27k|  bool foundCompletePsData = false;
  167|  1.27k|  bool foundExifData = false;
  168|  1.27k|  bool foundXmpData = false;
  169|  1.27k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  1.27k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|  45.3k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 45.2k, False: 110]
  |  Branch (174:28): [True: 45.2k, False: 25]
  |  Branch (174:46): [True: 45.2k, False: 6]
  ------------------
  175|  45.2k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|  45.2k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|  45.2k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 36.1k, False: 9.10k]
  ------------------
  181|  36.1k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  36.1k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  36.1k|    }
  184|       |
  185|  45.2k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 11.1k, False: 34.1k]
  ------------------
  186|  11.1k|      sof_encoding_process_ = itSofMarker->label_;
  187|  11.1k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 7.65k, False: 3.46k]
  |  Branch (187:24): [True: 7.31k, False: 340]
  ------------------
  188|  7.31k|        num_color_components_ = *buf.c_data(7);
  189|  7.31k|      }
  190|  11.1k|    }
  191|       |
  192|  45.2k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 44.5k, False: 655]
  |  Branch (192:27): [True: 3.38k, False: 41.1k]
  |  Branch (192:46): [True: 512, False: 2.87k]
  ------------------
  193|    512|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 61, False: 451]
  ------------------
  194|     61|      const DecodeParams dp(max_recursion_depth_);
  195|     61|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8, dp);
  196|     61|      setByteOrder(bo);
  197|     61|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (197:11): [True: 27, False: 34]
  |  Branch (197:23): [True: 0, False: 27]
  ------------------
  198|      0|#ifndef SUPPRESS_WARNINGS
  199|      0|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  200|      0|#endif
  201|      0|        exifData_.clear();
  202|      0|      }
  203|     61|      --search;
  204|     61|      foundExifData = true;
  205|  45.1k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (205:16): [True: 44.5k, False: 589]
  |  Branch (205:33): [True: 3.35k, False: 41.2k]
  |  Branch (205:52): [True: 313, False: 3.03k]
  ------------------
  206|    313|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (206:19): [True: 30, False: 283]
  ------------------
  207|     30|      xmpPacket_.assign(buf.c_str(31), size - 31);
  208|     30|      const DecodeParams dp(max_recursion_depth_);
  209|     30|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (209:11): [True: 20, False: 10]
  |  Branch (209:34): [True: 18, False: 2]
  ------------------
  210|     18|#ifndef SUPPRESS_WARNINGS
  211|     18|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     18|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     18|  LogMsg(LogMsg::warn).os()
  ------------------
  212|     18|#endif
  213|     18|      }
  214|     30|      --search;
  215|     30|      foundXmpData = true;
  216|  45.1k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (216:16): [True: 44.6k, False: 532]
  |  Branch (216:40): [True: 21.8k, False: 22.7k]
  ------------------
  217|  21.8k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (217:16): [True: 21.7k, False: 111]
  ------------------
  218|  21.7k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (218:19): [True: 19.2k, False: 2.58k]
  ------------------
  219|       |#ifdef EXIV2_DEBUG_MESSAGES
  220|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  221|       |#endif
  222|  19.2k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (222:11): [True: 16.0k, False: 3.13k]
  ------------------
  223|  16.0k|        append(psBlob, buf.c_data(16), size - 16);
  224|  16.0k|      }
  225|       |      // Check whether psBlob is complete
  226|  19.2k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (226:11): [True: 18.9k, False: 234]
  |  Branch (226:30): [True: 99, False: 18.8k]
  ------------------
  227|     99|        --search;
  228|     99|        foundCompletePsData = true;
  229|     99|      }
  230|  25.9k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (230:16): [True: 490, False: 25.4k]
  |  Branch (230:34): [True: 200, False: 290]
  ------------------
  231|       |      // JPEGs can have multiple comments, but for now only read
  232|       |      // the first one (most jpegs only have one anyway). Comments
  233|       |      // are simple single byte ISO-8859-1 strings.
  234|    200|      comment_.assign(buf.c_str(2), size - 2);
  235|  1.29k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (235:14): [True: 1.16k, False: 124]
  |  Branch (235:35): [True: 1.09k, False: 76]
  ------------------
  236|  1.09k|        comment_.pop_back();
  237|  1.09k|      }
  238|    200|      --search;
  239|  25.7k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (239:16): [True: 3.37k, False: 22.3k]
  |  Branch (239:35): [True: 2.90k, False: 468]
  ------------------
  240|  2.90k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (240:19): [True: 2.09k, False: 818]
  ------------------
  241|  2.09k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (241:11): [True: 13, False: 2.07k]
  ------------------
  242|     13|        rc = 8;
  243|     13|        break;
  244|     13|      }
  245|       |      // ICC profile
  246|  2.07k|      if (!foundIccData) {
  ------------------
  |  Branch (246:11): [True: 78, False: 1.99k]
  ------------------
  247|     78|        foundIccData = true;
  248|     78|        --search;
  249|     78|      }
  250|  2.07k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  251|  2.07k|      auto chunks = static_cast<int>(buf.read_uint8(2 + 13));
  252|       |      // ICC1v43_2010-12.pdf header is 14 bytes
  253|       |      // header = "ICC_PROFILE\0" (12 bytes)
  254|       |      // chunk/chunks are a single byte
  255|       |      // Spec 7.2 Profile bytes 0-3 size
  256|  2.07k|      uint32_t s = buf.read_uint32(2 + 14, bigEndian);
  257|       |#ifdef EXIV2_DEBUG_MESSAGES
  258|       |      std::cerr << "Found ICC Profile chunk " << chunk << " of " << chunks << (chunk == 1 ? " size: " : "")
  259|       |                << (chunk == 1 ? s : 0) << '\n';
  260|       |#endif
  261|       |      // #1286 profile can be padded
  262|  2.07k|      size_t icc_size = size - 2 - 14;
  263|  2.07k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (263:11): [True: 590, False: 1.48k]
  |  Branch (263:25): [True: 504, False: 86]
  ------------------
  264|    504|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  265|    504|        icc_size = s;
  266|    504|      }
  267|       |
  268|  2.07k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  269|  23.6k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (269:16): [True: 12.4k, False: 11.2k]
  |  Branch (269:37): [True: 1.09k, False: 11.3k]
  ------------------
  270|       |      // We hit a SOFn (start-of-frame) marker
  271|  1.09k|      if (size < 8) {
  ------------------
  |  Branch (271:11): [True: 49, False: 1.04k]
  ------------------
  272|     49|        rc = 7;
  273|     49|        break;
  274|     49|      }
  275|  1.04k|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  276|  1.04k|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  277|  1.04k|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (277:11): [True: 161, False: 881]
  ------------------
  278|    161|        --search;
  279|  1.04k|    }
  280|       |
  281|       |    // Read the beginning of the next segment
  282|  45.1k|    try {
  283|  45.1k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  284|  45.1k|    } catch (const Error&) {
  285|    688|      rc = 5;
  286|    688|      break;
  287|    688|    }
  288|  45.1k|  }  // while there are segments to process
  289|       |
  290|    891|  if (!psBlob.empty()) {
  ------------------
  |  Branch (290:7): [True: 294, False: 597]
  ------------------
  291|       |    // Find actual IPTC data within the psBlob
  292|    294|    Blob iptcBlob;
  293|    294|    const byte* record = nullptr;
  294|    294|    uint32_t sizeIptc = 0;
  295|    294|    uint32_t sizeHdr = 0;
  296|    294|    const byte* pCur = psBlob.data();
  297|    294|    const byte* pEnd = pCur + psBlob.size();
  298|    416|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (298:12): [True: 406, False: 10]
  |  Branch (298:27): [True: 122, False: 284]
  ------------------
  299|       |#ifdef EXIV2_DEBUG_MESSAGES
  300|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  301|       |#endif
  302|    122|      if (sizeIptc) {
  ------------------
  |  Branch (302:11): [True: 83, False: 39]
  ------------------
  303|     83|        append(iptcBlob, record + sizeHdr, sizeIptc);
  304|     83|      }
  305|    122|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  306|    122|    }
  307|    294|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (307:9): [True: 83, False: 211]
  |  Branch (307:30): [True: 37, False: 46]
  ------------------
  308|     37|#ifndef SUPPRESS_WARNINGS
  309|     37|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     37|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 37]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     37|  LogMsg(LogMsg::warn).os()
  ------------------
  310|     37|#endif
  311|     37|      iptcData_.clear();
  312|     37|    }
  313|    294|  }
  314|       |
  315|    891|  if (rc != 0) {
  ------------------
  |  Branch (315:7): [True: 750, False: 141]
  ------------------
  316|    750|#ifndef SUPPRESS_WARNINGS
  317|    750|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    750|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 750]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    750|  LogMsg(LogMsg::warn).os()
  ------------------
  318|    750|#endif
  319|    750|  }
  320|    891|}  // JpegBase::readMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  971|  1.32k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  972|  1.32k|}
_ZNK5Exiv29JpegImage8mimeTypeEv:
  974|  1.56k|std::string JpegImage::mimeType() const {
  975|  1.56k|  return "image/jpeg";
  976|  1.56k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  990|  1.32k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  991|  1.32k|  return isJpegType(iIo, advance);
  992|  1.32k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  994|  1.22k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  995|  1.22k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  996|  1.22k|  if (!image->good()) {
  ------------------
  |  Branch (996:7): [True: 0, False: 1.22k]
  ------------------
  997|      0|    return nullptr;
  998|      0|  }
  999|  1.22k|  return image;
 1000|  1.22k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1002|  38.7k|bool isJpegType(BasicIo& iIo, bool advance) {
 1003|  38.7k|  bool result = true;
 1004|  38.7k|  byte tmpBuf[2];
 1005|  38.7k|  iIo.read(tmpBuf, 2);
 1006|  38.7k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1006:7): [True: 0, False: 38.7k]
  |  Branch (1006:22): [True: 20, False: 38.7k]
  ------------------
 1007|     20|    return false;
 1008|       |
 1009|  38.7k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1009:7): [True: 34.8k, False: 3.89k]
  |  Branch (1009:28): [True: 212, False: 3.68k]
  ------------------
 1010|  35.0k|    result = false;
 1011|  35.0k|  }
 1012|  38.7k|  if (!advance || !result)
  ------------------
  |  Branch (1012:7): [True: 37.4k, False: 1.32k]
  |  Branch (1012:19): [True: 96, False: 1.23k]
  ------------------
 1013|  37.4k|    iIo.seek(-2, BasicIo::cur);
 1014|  38.7k|  return result;
 1015|  38.7k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1018|     43|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1019|     43|}
_ZNK5Exiv28ExvImage8mimeTypeEv:
 1021|     21|std::string ExvImage::mimeType() const {
 1022|     21|  return "image/x-exv";
 1023|     21|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1036|     43|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1037|     43|  return isExvType(iIo, advance);
 1038|     43|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1040|     43|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1041|     43|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1042|     43|  if (!image->good())
  ------------------
  |  Branch (1042:7): [True: 0, False: 43]
  ------------------
 1043|      0|    return nullptr;
 1044|     43|  return image;
 1045|     43|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1047|  35.0k|bool isExvType(BasicIo& iIo, bool advance) {
 1048|  35.0k|  bool result = true;
 1049|  35.0k|  byte tmpBuf[7];
 1050|  35.0k|  iIo.read(tmpBuf, 7);
 1051|  35.0k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1051:7): [True: 0, False: 35.0k]
  |  Branch (1051:22): [True: 73, False: 34.9k]
  ------------------
 1052|     73|    return false;
 1053|       |
 1054|  34.9k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1054:7): [True: 34.7k, False: 256]
  |  Branch (1054:28): [True: 98, False: 158]
  |  Branch (1054:49): [True: 29, False: 129]
  ------------------
 1055|  34.8k|    result = false;
 1056|  34.8k|  }
 1057|  34.9k|  if (!advance || !result)
  ------------------
  |  Branch (1057:7): [True: 34.9k, False: 43]
  |  Branch (1057:19): [True: 0, False: 43]
  ------------------
 1058|  34.9k|    iIo.seek(-7, BasicIo::cur);
 1059|  34.9k|  return result;
 1060|  35.0k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  45.2k|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  45.2k|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  45.2k|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  45.2k|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 41.9k, False: 3.25k]
  ------------------
  107|  41.9k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|  41.9k|    size = getUShort(buf.data(), bigEndian);
  109|  41.9k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|  41.9k|  }
  111|  45.2k|  return {buf, size};
  112|  45.2k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  12.4k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  12.4k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 383, False: 12.0k]
  |  Branch (92:38): [True: 708, False: 11.3k]
  ------------------
   93|  12.4k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  24.4k|constexpr bool inRange(int lo, int value, int hi) {
   88|  24.4k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 22.7k, False: 1.69k]
  |  Branch (88:25): [True: 1.09k, False: 21.7k]
  ------------------
   89|  24.4k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  45.2k|bool markerHasLength(byte m) {
   99|  45.2k|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 32.7k, False: 12.4k]
  |  Branch (99:44): [True: 3.25k, False: 29.5k]
  ------------------
  100|  45.2k|  return !markerWithoutLength;
  101|  45.2k|}

_ZNK5Exiv28Internal14TiffMnRegistryeqENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  133|   176k|bool TiffMnRegistry::operator==(std::string_view key) const {
  134|   176k|  if (!key.empty() && key.front() == '-')
  ------------------
  |  Branch (134:7): [True: 122k, False: 53.2k]
  |  Branch (134:23): [True: 6.60k, False: 116k]
  ------------------
  135|  6.60k|    return false;
  136|   169k|  return key.starts_with(make_);
  137|   176k|}
_ZN5Exiv28Internal13TiffMnCreator6createEtNS_5IfdIdENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPKhmNS_9ByteOrderE:
  144|  11.2k|                                                        const byte* pData, size_t size, ByteOrder byteOrder) {
  145|  11.2k|  if (auto tmr = Exiv2::find(registry_, make))
  ------------------
  |  Branch (145:12): [True: 6.48k, False: 4.76k]
  ------------------
  146|  6.48k|    return tmr->newMnFct_(tag, group, tmr->mnGroup_, pData, size, byteOrder);
  147|  4.76k|  return nullptr;
  148|  11.2k|}  // TiffMnCreator::create
_ZNK5Exiv28Internal8MnHeader9ifdOffsetEv:
  163|     98|size_t MnHeader::ifdOffset() const {
  164|     98|  return 0;
  165|     98|}
_ZNK5Exiv28Internal8MnHeader9byteOrderEv:
  167|  2.95k|ByteOrder MnHeader::byteOrder() const {
  168|  2.95k|  return invalidByteOrder;
  169|  2.95k|}
_ZNK5Exiv28Internal8MnHeader10baseOffsetEm:
  171|    931|size_t MnHeader::baseOffset(size_t /*mnOffset*/) const {
  172|    931|  return 0;
  173|    931|}
_ZN5Exiv28Internal15OlympusMnHeader15sizeOfSignatureEv:
  177|  1.71k|size_t OlympusMnHeader::sizeOfSignature() {
  178|  1.71k|  return sizeof(signature_);
  179|  1.71k|}
_ZN5Exiv28Internal15OlympusMnHeaderC2Ev:
  181|    146|OlympusMnHeader::OlympusMnHeader() {
  182|    146|  read(signature_, sizeOfSignature(), invalidByteOrder);
  183|    146|}
_ZNK5Exiv28Internal15OlympusMnHeader9ifdOffsetEv:
  189|     74|size_t OlympusMnHeader::ifdOffset() const {
  190|     74|  return sizeOfSignature();
  191|     74|}
_ZN5Exiv28Internal15OlympusMnHeader4readEPKhmNS_9ByteOrderE:
  193|    292|bool OlympusMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  194|    292|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (194:7): [True: 0, False: 292]
  |  Branch (194:17): [True: 0, False: 292]
  ------------------
  195|      0|    return false;
  196|    292|  header_.alloc(sizeOfSignature());
  197|    292|  std::copy_n(pData, header_.size(), header_.begin());
  198|    292|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 6);
  ------------------
  |  Branch (198:10): [True: 292, False: 0]
  |  Branch (198:49): [True: 220, False: 72]
  ------------------
  199|    292|}
_ZN5Exiv28Internal16Olympus2MnHeader15sizeOfSignatureEv:
  208|  2.88k|size_t Olympus2MnHeader::sizeOfSignature() {
  209|  2.88k|  return sizeof(signature_);
  210|  2.88k|}
_ZN5Exiv28Internal16Olympus2MnHeaderC2Ev:
  212|    313|Olympus2MnHeader::Olympus2MnHeader() {
  213|    313|  read(signature_, sizeOfSignature(), invalidByteOrder);
  214|    313|}
_ZNK5Exiv28Internal16Olympus2MnHeader9ifdOffsetEv:
  220|    313|size_t Olympus2MnHeader::ifdOffset() const {
  221|    313|  return sizeOfSignature();
  222|    313|}
_ZNK5Exiv28Internal16Olympus2MnHeader10baseOffsetEm:
  224|    313|size_t Olympus2MnHeader::baseOffset(size_t mnOffset) const {
  225|    313|  return mnOffset;
  226|    313|}
_ZN5Exiv28Internal16Olympus2MnHeader4readEPKhmNS_9ByteOrderE:
  228|    626|bool Olympus2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  229|    626|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (229:7): [True: 0, False: 626]
  |  Branch (229:17): [True: 0, False: 626]
  ------------------
  230|      0|    return false;
  231|    626|  header_.alloc(sizeOfSignature());
  232|    626|  std::copy_n(pData, header_.size(), header_.begin());
  233|    626|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 10);
  ------------------
  |  Branch (233:10): [True: 626, False: 0]
  |  Branch (233:49): [True: 626, False: 0]
  ------------------
  234|    626|}
_ZN5Exiv28Internal16OMSystemMnHeader15sizeOfSignatureEv:
  244|  1.94k|size_t OMSystemMnHeader::sizeOfSignature() {
  245|  1.94k|  return sizeof(signature_);
  246|  1.94k|}
_ZN5Exiv28Internal16OMSystemMnHeaderC2Ev:
  248|    171|OMSystemMnHeader::OMSystemMnHeader() {
  249|    171|  read(signature_, sizeOfSignature(), invalidByteOrder);
  250|    171|}
_ZNK5Exiv28Internal16OMSystemMnHeader9ifdOffsetEv:
  256|    143|size_t OMSystemMnHeader::ifdOffset() const {
  257|    143|  return sizeOfSignature();
  258|    143|}
_ZNK5Exiv28Internal16OMSystemMnHeader10baseOffsetEm:
  260|    143|size_t OMSystemMnHeader::baseOffset(size_t mnOffset) const {
  261|    143|  return mnOffset;
  262|    143|}
_ZN5Exiv28Internal16OMSystemMnHeader4readEPKhmNS_9ByteOrderE:
  264|    342|bool OMSystemMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  265|    342|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (265:7): [True: 0, False: 342]
  |  Branch (265:17): [True: 0, False: 342]
  ------------------
  266|      0|    return false;
  267|    342|  header_.alloc(sizeOfSignature());
  268|    342|  std::copy_n(pData, header_.size(), header_.begin());
  269|    342|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, sizeOfSignature() - 2);
  ------------------
  |  Branch (269:10): [True: 342, False: 0]
  |  Branch (269:49): [True: 314, False: 28]
  ------------------
  270|    342|}
_ZN5Exiv28Internal12FujiMnHeader15sizeOfSignatureEv:
  280|  1.37k|size_t FujiMnHeader::sizeOfSignature() {
  281|  1.37k|  return sizeof(signature_);
  282|  1.37k|}
_ZN5Exiv28Internal12FujiMnHeaderC2Ev:
  284|    131|FujiMnHeader::FujiMnHeader() {
  285|    131|  read(signature_, sizeOfSignature(), byteOrder_);
  286|    131|}
_ZNK5Exiv28Internal12FujiMnHeader9ifdOffsetEv:
  292|     45|size_t FujiMnHeader::ifdOffset() const {
  293|     45|  return start_;
  294|     45|}
_ZNK5Exiv28Internal12FujiMnHeader9byteOrderEv:
  296|    138|ByteOrder FujiMnHeader::byteOrder() const {
  297|    138|  return byteOrder_;
  298|    138|}
_ZNK5Exiv28Internal12FujiMnHeader10baseOffsetEm:
  300|     38|size_t FujiMnHeader::baseOffset(size_t mnOffset) const {
  301|     38|  return mnOffset;
  302|     38|}
_ZN5Exiv28Internal12FujiMnHeader4readEPKhmNS_9ByteOrderE:
  304|    262|bool FujiMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  305|    262|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (305:7): [True: 0, False: 262]
  |  Branch (305:17): [True: 0, False: 262]
  ------------------
  306|      0|    return false;
  307|    262|  header_.alloc(sizeOfSignature());
  308|    262|  std::copy_n(pData, header_.size(), header_.begin());
  309|       |  // Read offset to the IFD relative to the start of the makernote
  310|       |  // from the header. Note that we ignore the byteOrder argument
  311|    262|  start_ = header_.read_uint32(8, byteOrder_);
  312|    262|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 8);
  ------------------
  |  Branch (312:10): [True: 262, False: 0]
  |  Branch (312:49): [True: 176, False: 86]
  ------------------
  313|    262|}
_ZN5Exiv28Internal14Nikon2MnHeader15sizeOfSignatureEv:
  322|  1.12k|size_t Nikon2MnHeader::sizeOfSignature() {
  323|  1.12k|  return sizeof(signature_);
  324|  1.12k|}
_ZN5Exiv28Internal14Nikon2MnHeaderC2Ev:
  326|    123|Nikon2MnHeader::Nikon2MnHeader() {
  327|    123|  read(signature_, sizeOfSignature(), invalidByteOrder);
  328|    123|}
_ZNK5Exiv28Internal14Nikon2MnHeader9ifdOffsetEv:
  334|    123|size_t Nikon2MnHeader::ifdOffset() const {
  335|    123|  return start_;
  336|    123|}
_ZN5Exiv28Internal14Nikon2MnHeader4readEPKhmNS_9ByteOrderE:
  338|    246|bool Nikon2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  339|    246|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (339:7): [True: 0, False: 246]
  |  Branch (339:17): [True: 0, False: 246]
  ------------------
  340|      0|    return false;
  341|    246|  if (0 != memcmp(pData, signature_, 6))
  ------------------
  |  Branch (341:7): [True: 0, False: 246]
  ------------------
  342|      0|    return false;
  343|    246|  buf_.alloc(sizeOfSignature());
  344|    246|  std::copy_n(pData, buf_.size(), buf_.begin());
  345|    246|  start_ = sizeOfSignature();
  346|    246|  return true;
  347|    246|}  // Nikon2MnHeader::read
_ZN5Exiv28Internal14Nikon3MnHeader15sizeOfSignatureEv:
  357|  2.41k|size_t Nikon3MnHeader::sizeOfSignature() {
  358|  2.41k|  return sizeof(signature_);
  359|  2.41k|}
_ZN5Exiv28Internal14Nikon3MnHeaderC2Ev:
  361|    475|Nikon3MnHeader::Nikon3MnHeader() : start_(sizeOfSignature()) {
  362|    475|  buf_.alloc(sizeOfSignature());
  363|    475|  std::copy_n(signature_, buf_.size(), buf_.begin());
  364|    475|}
_ZNK5Exiv28Internal14Nikon3MnHeader9ifdOffsetEv:
  370|    475|size_t Nikon3MnHeader::ifdOffset() const {
  371|    475|  return start_;
  372|    475|}
_ZNK5Exiv28Internal14Nikon3MnHeader9byteOrderEv:
  374|  1.89k|ByteOrder Nikon3MnHeader::byteOrder() const {
  375|  1.89k|  return byteOrder_;
  376|  1.89k|}
_ZNK5Exiv28Internal14Nikon3MnHeader10baseOffsetEm:
  378|    473|size_t Nikon3MnHeader::baseOffset(size_t mnOffset) const {
  379|    473|  return Safe::add<size_t>(mnOffset, 10);
  380|    473|}
_ZN5Exiv28Internal14Nikon3MnHeader4readEPKhmNS_9ByteOrderE:
  382|    475|bool Nikon3MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  383|    475|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (383:7): [True: 0, False: 475]
  |  Branch (383:17): [True: 0, False: 475]
  ------------------
  384|      0|    return false;
  385|    475|  if (0 != memcmp(pData, signature_, 6))
  ------------------
  |  Branch (385:7): [True: 0, False: 475]
  ------------------
  386|      0|    return false;
  387|    475|  buf_.alloc(sizeOfSignature());
  388|    475|  std::copy_n(pData, buf_.size(), buf_.begin());
  389|    475|  TiffHeader th;
  390|    475|  if (!th.read(buf_.data(10), 8))
  ------------------
  |  Branch (390:7): [True: 0, False: 475]
  ------------------
  391|      0|    return false;
  392|    475|  byteOrder_ = th.byteOrder();
  393|    475|  start_ = 10 + th.offset();
  394|    475|  return true;
  395|    475|}  // Nikon3MnHeader::read
_ZN5Exiv28Internal17PanasonicMnHeader15sizeOfSignatureEv:
  412|  1.72k|size_t PanasonicMnHeader::sizeOfSignature() {
  413|  1.72k|  return sizeof(signature_);
  414|  1.72k|}
_ZN5Exiv28Internal17PanasonicMnHeaderC2Ev:
  416|    198|PanasonicMnHeader::PanasonicMnHeader() {
  417|    198|  read(signature_, sizeOfSignature(), invalidByteOrder);
  418|    198|}
_ZNK5Exiv28Internal17PanasonicMnHeader9ifdOffsetEv:
  424|    162|size_t PanasonicMnHeader::ifdOffset() const {
  425|    162|  return start_;
  426|    162|}
_ZN5Exiv28Internal17PanasonicMnHeader4readEPKhmNS_9ByteOrderE:
  428|    396|bool PanasonicMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  429|    396|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (429:7): [True: 0, False: 396]
  |  Branch (429:17): [True: 0, False: 396]
  ------------------
  430|      0|    return false;
  431|    396|  if (0 != memcmp(pData, signature_, 9))
  ------------------
  |  Branch (431:7): [True: 36, False: 360]
  ------------------
  432|     36|    return false;
  433|    360|  buf_.alloc(sizeOfSignature());
  434|    360|  std::copy_n(pData, buf_.size(), buf_.begin());
  435|    360|  start_ = sizeOfSignature();
  436|    360|  return true;
  437|    396|}  // PanasonicMnHeader::read
_ZN5Exiv28Internal17PentaxDngMnHeader15sizeOfSignatureEv:
  446|    898|size_t PentaxDngMnHeader::sizeOfSignature() {
  447|    898|  return sizeof(signature_);
  448|    898|}
_ZN5Exiv28Internal17PentaxDngMnHeaderC2Ev:
  450|     92|PentaxDngMnHeader::PentaxDngMnHeader() {
  451|     92|  read(signature_, sizeOfSignature(), invalidByteOrder);
  452|     92|}
_ZNK5Exiv28Internal17PentaxDngMnHeader10baseOffsetEm:
  458|     92|size_t PentaxDngMnHeader::baseOffset(size_t mnOffset) const {
  459|     92|  return mnOffset;
  460|     92|}
_ZNK5Exiv28Internal17PentaxDngMnHeader9ifdOffsetEv:
  462|     92|size_t PentaxDngMnHeader::ifdOffset() const {
  463|     92|  return sizeOfSignature();
  464|     92|}
_ZN5Exiv28Internal17PentaxDngMnHeader4readEPKhmNS_9ByteOrderE:
  466|    184|bool PentaxDngMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  467|    184|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (467:7): [True: 0, False: 184]
  |  Branch (467:17): [True: 0, False: 184]
  ------------------
  468|      0|    return false;
  469|    184|  header_.alloc(sizeOfSignature());
  470|    184|  std::copy_n(pData, header_.size(), header_.begin());
  471|    184|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 7);
  ------------------
  |  Branch (471:10): [True: 184, False: 0]
  |  Branch (471:49): [True: 184, False: 0]
  ------------------
  472|    184|}
_ZN5Exiv28Internal14PentaxMnHeader15sizeOfSignatureEv:
  481|    908|size_t PentaxMnHeader::sizeOfSignature() {
  482|    908|  return sizeof(signature_);
  483|    908|}
_ZN5Exiv28Internal14PentaxMnHeaderC2Ev:
  485|     93|PentaxMnHeader::PentaxMnHeader() {
  486|     93|  read(signature_, sizeOfSignature(), invalidByteOrder);
  487|     93|}
_ZNK5Exiv28Internal14PentaxMnHeader9ifdOffsetEv:
  493|     93|size_t PentaxMnHeader::ifdOffset() const {
  494|     93|  return sizeOfSignature();
  495|     93|}
_ZN5Exiv28Internal14PentaxMnHeader4readEPKhmNS_9ByteOrderE:
  497|    186|bool PentaxMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  498|    186|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (498:7): [True: 0, False: 186]
  |  Branch (498:17): [True: 0, False: 186]
  ------------------
  499|      0|    return false;
  500|    186|  header_.alloc(sizeOfSignature());
  501|    186|  std::copy_n(pData, header_.size(), header_.begin());
  502|    186|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 3);
  ------------------
  |  Branch (502:10): [True: 186, False: 0]
  |  Branch (502:49): [True: 186, False: 0]
  ------------------
  503|    186|}
_ZN5Exiv28Internal15SamsungMnHeaderC2Ev:
  510|     98|SamsungMnHeader::SamsungMnHeader() {
  511|     98|  read(nullptr, 0, invalidByteOrder);
  512|     98|}
_ZNK5Exiv28Internal15SamsungMnHeader10baseOffsetEm:
  518|     98|size_t SamsungMnHeader::baseOffset(size_t mnOffset) const {
  519|     98|  return mnOffset;
  520|     98|}
_ZN5Exiv28Internal15SamsungMnHeader4readEPKhmNS_9ByteOrderE:
  522|    196|bool SamsungMnHeader::read(const byte* /*pData*/, size_t /*size*/, ByteOrder) {
  523|    196|  return true;
  524|    196|}  // SamsungMnHeader::read
_ZN5Exiv28Internal13SigmaMnHeader15sizeOfSignatureEv:
  533|  1.92k|size_t SigmaMnHeader::sizeOfSignature() {
  534|  1.92k|  return sizeof(signature1_);
  535|  1.92k|}
_ZN5Exiv28Internal13SigmaMnHeaderC2Ev:
  537|    226|SigmaMnHeader::SigmaMnHeader() {
  538|    226|  read(signature1_, sizeOfSignature(), invalidByteOrder);
  539|    226|}
_ZNK5Exiv28Internal13SigmaMnHeader9ifdOffsetEv:
  545|    152|size_t SigmaMnHeader::ifdOffset() const {
  546|    152|  return start_;
  547|    152|}
_ZN5Exiv28Internal13SigmaMnHeader4readEPKhmNS_9ByteOrderE:
  549|    452|bool SigmaMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  550|    452|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (550:7): [True: 0, False: 452]
  |  Branch (550:17): [True: 0, False: 452]
  ------------------
  551|      0|    return false;
  552|    452|  if (0 != memcmp(pData, signature1_, 8) && 0 != memcmp(pData, signature2_, 8))
  ------------------
  |  Branch (552:7): [True: 156, False: 296]
  |  Branch (552:45): [True: 74, False: 82]
  ------------------
  553|     74|    return false;
  554|    378|  buf_.alloc(sizeOfSignature());
  555|    378|  std::copy_n(pData, buf_.size(), buf_.begin());
  556|    378|  start_ = sizeOfSignature();
  557|    378|  return true;
  558|    452|}  // SigmaMnHeader::read
_ZN5Exiv28Internal12SonyMnHeader15sizeOfSignatureEv:
  567|  2.55k|size_t SonyMnHeader::sizeOfSignature() {
  568|  2.55k|  return sizeof(signature_);
  569|  2.55k|}
_ZN5Exiv28Internal12SonyMnHeaderC2Ev:
  571|    252|SonyMnHeader::SonyMnHeader() {
  572|    252|  read(signature_, sizeOfSignature(), invalidByteOrder);
  573|    252|}
_ZNK5Exiv28Internal12SonyMnHeader9ifdOffsetEv:
  579|    252|size_t SonyMnHeader::ifdOffset() const {
  580|    252|  return start_;
  581|    252|}
_ZN5Exiv28Internal12SonyMnHeader4readEPKhmNS_9ByteOrderE:
  583|    504|bool SonyMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  584|    504|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (584:7): [True: 0, False: 504]
  |  Branch (584:17): [True: 0, False: 504]
  ------------------
  585|      0|    return false;
  586|    504|  if (0 != memcmp(pData, signature_, sizeOfSignature()))
  ------------------
  |  Branch (586:7): [True: 0, False: 504]
  ------------------
  587|      0|    return false;
  588|    504|  buf_.alloc(sizeOfSignature());
  589|    504|  std::copy_n(pData, buf_.size(), buf_.begin());
  590|    504|  start_ = sizeOfSignature();
  591|    504|  return true;
  592|    504|}  // SonyMnHeader::read
_ZN5Exiv28Internal14Casio2MnHeader15sizeOfSignatureEv:
  602|    675|size_t Casio2MnHeader::sizeOfSignature() {
  603|    675|  return sizeof(signature_);
  604|    675|}
_ZN5Exiv28Internal14Casio2MnHeaderC2Ev:
  606|     75|Casio2MnHeader::Casio2MnHeader() {
  607|     75|  read(signature_, sizeOfSignature(), invalidByteOrder);
  608|     75|}
_ZNK5Exiv28Internal14Casio2MnHeader9ifdOffsetEv:
  614|     75|size_t Casio2MnHeader::ifdOffset() const {
  615|     75|  return start_;
  616|     75|}
_ZNK5Exiv28Internal14Casio2MnHeader9byteOrderEv:
  618|    300|ByteOrder Casio2MnHeader::byteOrder() const {
  619|    300|  return byteOrder_;
  620|    300|}
_ZN5Exiv28Internal14Casio2MnHeader4readEPKhmNS_9ByteOrderE:
  622|    150|bool Casio2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  623|    150|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (623:7): [True: 0, False: 150]
  |  Branch (623:17): [True: 0, False: 150]
  ------------------
  624|      0|    return false;
  625|    150|  if (0 != memcmp(pData, signature_, sizeOfSignature()))
  ------------------
  |  Branch (625:7): [True: 0, False: 150]
  ------------------
  626|      0|    return false;
  627|    150|  buf_.alloc(sizeOfSignature());
  628|    150|  std::copy_n(pData, buf_.size(), buf_.begin());
  629|    150|  start_ = sizeOfSignature();
  630|    150|  return true;
  631|    150|}  // Casio2MnHeader::read
_ZN5Exiv28Internal8newIfdMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  642|    323|                                           ByteOrder) {
  643|       |  // Require at least an IFD with 1 entry, but not necessarily a next pointer
  644|    323|  if (size < 14)
  ------------------
  |  Branch (644:7): [True: 199, False: 124]
  ------------------
  645|    199|    return nullptr;
  646|    124|  return newIfdMn2(tag, group, mnGroup);
  647|    323|}
_ZN5Exiv28Internal9newIfdMn2EtNS_5IfdIdES1_:
  649|    361|std::unique_ptr<TiffIfdMakernote> newIfdMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  650|    361|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, nullptr);
  651|    361|}
_ZN5Exiv28Internal12newOlympusMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  654|  1.10k|                                               ByteOrder) {
  655|       |  // FIXME: workaround for overwritten OM System header in Olympus files (https://github.com/Exiv2/exiv2/issues/2542)
  656|  1.10k|  if (size >= 14 && std::string(reinterpret_cast<const char*>(pData), 14) == std::string("OM SYSTEM\0\0\0II", 14)) {
  ------------------
  |  Branch (656:7): [True: 562, False: 543]
  |  Branch (656:7): [True: 101, False: 1.00k]
  |  Branch (656:21): [True: 101, False: 461]
  ------------------
  657|       |    // Require at least the header and an IFD with 1 entry
  658|    101|    if (size < OMSystemMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (658:9): [True: 20, False: 81]
  ------------------
  659|     20|      return nullptr;
  660|     81|    return newOMSystemMn2(tag, group, IfdId::olympus2Id);
  661|    101|  }
  662|  1.00k|  if (size < 10 || std::string(reinterpret_cast<const char*>(pData), 10) != std::string("OLYMPUS\0II", 10)) {
  ------------------
  |  Branch (662:7): [True: 400, False: 604]
  |  Branch (662:7): [True: 623, False: 381]
  |  Branch (662:20): [True: 223, False: 381]
  ------------------
  663|       |    // Require at least the header and an IFD with 1 entry
  664|    623|    if (size < OlympusMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (664:9): [True: 477, False: 146]
  ------------------
  665|    477|      return nullptr;
  666|    146|    return newOlympusMn2(tag, group, IfdId::olympusId);
  667|    623|  }
  668|       |  // Require at least the header and an IFD with 1 entry
  669|    381|  if (size < Olympus2MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (669:7): [True: 68, False: 313]
  ------------------
  670|     68|    return nullptr;
  671|    313|  return newOlympus2Mn2(tag, group, IfdId::olympus2Id);
  672|    381|}
_ZN5Exiv28Internal13newOlympusMn2EtNS_5IfdIdES1_:
  674|    146|std::unique_ptr<TiffIfdMakernote> newOlympusMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  675|    146|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<OlympusMnHeader>());
  676|    146|}
_ZN5Exiv28Internal14newOlympus2Mn2EtNS_5IfdIdES1_:
  678|    313|std::unique_ptr<TiffIfdMakernote> newOlympus2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  679|    313|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Olympus2MnHeader>());
  680|    313|}
_ZN5Exiv28Internal13newOMSystemMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  683|    161|                                                ByteOrder) {
  684|       |  // Require at least the header and an IFD with 1 entry
  685|    161|  if (size < OMSystemMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (685:7): [True: 71, False: 90]
  ------------------
  686|     71|    return nullptr;
  687|     90|  return newOMSystemMn2(tag, group, mnGroup);
  688|    161|}
_ZN5Exiv28Internal14newOMSystemMn2EtNS_5IfdIdES1_:
  690|    171|std::unique_ptr<TiffIfdMakernote> newOMSystemMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  691|    171|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<OMSystemMnHeader>());
  692|    171|}
_ZN5Exiv28Internal9newFujiMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  695|    461|                                            ByteOrder) {
  696|       |  // Require at least the header and an IFD with 1 entry
  697|    461|  if (size < FujiMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (697:7): [True: 330, False: 131]
  ------------------
  698|    330|    return nullptr;
  699|    131|  return newFujiMn2(tag, group, mnGroup);
  700|    461|}
_ZN5Exiv28Internal10newFujiMn2EtNS_5IfdIdES1_:
  702|    131|std::unique_ptr<TiffIfdMakernote> newFujiMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  703|    131|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<FujiMnHeader>());
  704|    131|}
_ZN5Exiv28Internal10newNikonMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  707|  1.44k|                                             ByteOrder) {
  708|       |  // If there is no "Nikon" string it must be Nikon1 format
  709|  1.44k|  if (size < 6 || std::string(reinterpret_cast<const char*>(pData), 6) != std::string("Nikon\0", 6)) {
  ------------------
  |  Branch (709:7): [True: 446, False: 1.00k]
  |  Branch (709:7): [True: 673, False: 776]
  |  Branch (709:19): [True: 227, False: 776]
  ------------------
  710|       |    // Require at least an IFD with 1 entry
  711|    673|    if (size < 18)
  ------------------
  |  Branch (711:9): [True: 514, False: 159]
  ------------------
  712|    514|      return nullptr;
  713|    159|    return newIfdMn2(tag, group, IfdId::nikon1Id);
  714|    673|  }
  715|       |  // If the "Nikon" string is not followed by a TIFF header, we assume
  716|       |  // Nikon2 format
  717|    776|  TiffHeader tiffHeader;
  718|    776|  if (size < 18 || !tiffHeader.read(pData + 10, size - 10) || tiffHeader.tag() != 0x002a) {
  ------------------
  |  Branch (718:7): [True: 70, False: 706]
  |  Branch (718:20): [True: 158, False: 548]
  |  Branch (718:63): [True: 38, False: 510]
  ------------------
  719|       |    // Require at least the header and an IFD with 1 entry
  720|    266|    if (size < Nikon2MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (720:9): [True: 143, False: 123]
  ------------------
  721|    143|      return nullptr;
  722|    123|    return newNikon2Mn2(tag, group, IfdId::nikon2Id);
  723|    266|  }
  724|       |  // Else we have a Nikon3 makernote
  725|       |  // Require at least the header and an IFD with 1 entry
  726|    510|  if (size < Nikon3MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (726:7): [True: 35, False: 475]
  ------------------
  727|     35|    return nullptr;
  728|    475|  return newNikon3Mn2(tag, group, IfdId::nikon3Id);
  729|    510|}
_ZN5Exiv28Internal12newNikon2Mn2EtNS_5IfdIdES1_:
  731|    123|std::unique_ptr<TiffIfdMakernote> newNikon2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  732|    123|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Nikon2MnHeader>());
  733|    123|}
_ZN5Exiv28Internal12newNikon3Mn2EtNS_5IfdIdES1_:
  735|    475|std::unique_ptr<TiffIfdMakernote> newNikon3Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  736|    475|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Nikon3MnHeader>());
  737|    475|}
_ZN5Exiv28Internal14newPanasonicMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  740|    412|                                                 ByteOrder) {
  741|       |  // Require at least the header and an IFD with 1 entry, but without a next pointer
  742|    412|  if (size < PanasonicMnHeader::sizeOfSignature() + 14)
  ------------------
  |  Branch (742:7): [True: 214, False: 198]
  ------------------
  743|    214|    return nullptr;
  744|    198|  return newPanasonicMn2(tag, group, mnGroup);
  745|    412|}
_ZN5Exiv28Internal15newPanasonicMn2EtNS_5IfdIdES1_:
  747|    198|std::unique_ptr<TiffIfdMakernote> newPanasonicMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  748|    198|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PanasonicMnHeader>(), false);
  749|    198|}
_ZN5Exiv28Internal11newPentaxMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  752|    455|                                              ByteOrder) {
  753|    455|  if (size > 8 && std::string(reinterpret_cast<const char*>(pData), 8) == std::string("PENTAX \0", 8)) {
  ------------------
  |  Branch (753:7): [True: 303, False: 152]
  |  Branch (753:7): [True: 162, False: 293]
  |  Branch (753:19): [True: 162, False: 141]
  ------------------
  754|       |    // Require at least the header and an IFD with 1 entry
  755|    162|    if (size < PentaxDngMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (755:9): [True: 70, False: 92]
  ------------------
  756|     70|      return nullptr;
  757|     92|    return newPentaxDngMn2(tag, group, (tag == 0xc634 ? IfdId::pentaxDngId : IfdId::pentaxId));
  ------------------
  |  Branch (757:41): [True: 92, False: 0]
  ------------------
  758|    162|  }
  759|    293|  if (size > 4 && std::string(reinterpret_cast<const char*>(pData), 4) == std::string("AOC\0", 4)) {
  ------------------
  |  Branch (759:7): [True: 175, False: 118]
  |  Branch (759:7): [True: 93, False: 200]
  |  Branch (759:19): [True: 93, False: 82]
  ------------------
  760|       |    // Require at least the header and an IFD with 1 entry
  761|     93|    if (size < PentaxMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (761:9): [True: 37, False: 56]
  ------------------
  762|     37|      return nullptr;
  763|     56|    return newPentaxMn2(tag, group, IfdId::pentaxId);
  764|     93|  }
  765|    200|  return nullptr;
  766|    293|}
_ZN5Exiv28Internal12newPentaxMn2EtNS_5IfdIdES1_:
  768|     93|std::unique_ptr<TiffIfdMakernote> newPentaxMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  769|     93|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PentaxMnHeader>());
  770|     93|}
_ZN5Exiv28Internal15newPentaxDngMn2EtNS_5IfdIdES1_:
  772|     92|std::unique_ptr<TiffIfdMakernote> newPentaxDngMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  773|     92|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PentaxDngMnHeader>());
  774|     92|}
_ZN5Exiv28Internal12newSamsungMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  777|    298|                                               ByteOrder) {
  778|    298|  if (size > 4 && std::string(reinterpret_cast<const char*>(pData), 4) == std::string("AOC\0", 4)) {
  ------------------
  |  Branch (778:7): [True: 204, False: 94]
  |  Branch (778:7): [True: 71, False: 227]
  |  Branch (778:19): [True: 71, False: 133]
  ------------------
  779|       |    // Samsung branded Pentax camera:
  780|       |    // Require at least the header and an IFD with 1 entry
  781|     71|    if (size < PentaxMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (781:9): [True: 34, False: 37]
  ------------------
  782|     34|      return nullptr;
  783|     37|    return newPentaxMn2(tag, group, IfdId::pentaxId);
  784|     71|  }
  785|       |  // Genuine Samsung camera:
  786|       |  // Require at least an IFD with 1 entry
  787|    227|  if (size < 18)
  ------------------
  |  Branch (787:7): [True: 129, False: 98]
  ------------------
  788|    129|    return nullptr;
  789|     98|  return newSamsungMn2(tag, group, mnGroup);
  790|    227|}
_ZN5Exiv28Internal13newSamsungMn2EtNS_5IfdIdES1_:
  792|     98|std::unique_ptr<TiffIfdMakernote> newSamsungMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  793|     98|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SamsungMnHeader>());
  794|     98|}
_ZN5Exiv28Internal10newSigmaMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  797|    487|                                             ByteOrder) {
  798|       |  // Require at least the header and an IFD with 1 entry
  799|    487|  if (size < SigmaMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (799:7): [True: 261, False: 226]
  ------------------
  800|    261|    return nullptr;
  801|    226|  return newSigmaMn2(tag, group, mnGroup);
  802|    487|}
_ZN5Exiv28Internal11newSigmaMn2EtNS_5IfdIdES1_:
  804|    226|std::unique_ptr<TiffIfdMakernote> newSigmaMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  805|    226|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SigmaMnHeader>());
  806|    226|}
_ZN5Exiv28Internal9newSonyMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  809|    944|                                            ByteOrder) {
  810|       |  // If there is no "SONY DSC " string we assume it's a simple IFD Makernote
  811|    944|  if (size < 12 || std::string(reinterpret_cast<const char*>(pData), 12) != std::string("SONY DSC \0\0\0", 12)) {
  ------------------
  |  Branch (811:7): [True: 251, False: 693]
  |  Branch (811:7): [True: 658, False: 286]
  |  Branch (811:20): [True: 407, False: 286]
  ------------------
  812|       |    // Require at least an IFD with 1 entry
  813|    658|    if (size < 18)
  ------------------
  |  Branch (813:9): [True: 285, False: 373]
  ------------------
  814|    285|      return nullptr;
  815|    373|    return newSony2Mn2(tag, group, IfdId::sony2Id);
  816|    658|  }
  817|       |  // Require at least the header and an IFD with 1 entry, but without a next pointer
  818|    286|  if (size < SonyMnHeader::sizeOfSignature() + 14)
  ------------------
  |  Branch (818:7): [True: 34, False: 252]
  ------------------
  819|     34|    return nullptr;
  820|    252|  return newSony1Mn2(tag, group, IfdId::sony1Id);
  821|    286|}
_ZN5Exiv28Internal11newSony1Mn2EtNS_5IfdIdES1_:
  823|    252|std::unique_ptr<TiffIfdMakernote> newSony1Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  824|    252|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SonyMnHeader>(), false);
  825|    252|}
_ZN5Exiv28Internal11newSony2Mn2EtNS_5IfdIdES1_:
  827|    373|std::unique_ptr<TiffIfdMakernote> newSony2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  828|    373|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, nullptr, true);
  829|    373|}
_ZN5Exiv28Internal10newCasioMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  832|    392|                                             ByteOrder) {
  833|    392|  if (size > 6 && std::string(reinterpret_cast<const char*>(pData), 6) == std::string("QVC\0\0\0", 6))
  ------------------
  |  Branch (833:7): [True: 171, False: 221]
  |  Branch (833:7): [True: 75, False: 317]
  |  Branch (833:19): [True: 75, False: 96]
  ------------------
  834|     75|    return newCasio2Mn2(tag, group, IfdId::casio2Id);
  835|       |  // Require at least an IFD with 1 entry, but not necessarily a next pointer
  836|    317|  if (size < 14)
  ------------------
  |  Branch (836:7): [True: 239, False: 78]
  ------------------
  837|    239|    return nullptr;
  838|     78|  return newIfdMn2(tag, group, IfdId::casioId);
  839|    317|}
_ZN5Exiv28Internal12newCasio2Mn2EtNS_5IfdIdES1_:
  841|     75|std::unique_ptr<TiffIfdMakernote> newCasio2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  842|     75|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Casio2MnHeader>());
  843|     75|}
_ZN5Exiv28Internal13nikonSelectorEtPKhmPNS0_13TiffComponentE:
  910|    338|int nikonSelector(uint16_t tag, const byte* pData, size_t size, TiffComponent* /*pRoot*/) {
  911|    338|  if (size < 4)
  ------------------
  |  Branch (911:7): [True: 14, False: 324]
  ------------------
  912|     14|    return -1;
  913|       |
  914|    324|  auto ix = NikonArrayIdx::Key{tag, reinterpret_cast<const char*>(pData), size};
  915|    324|  if (auto it = Exiv2::find(nikonArrayIdx, ix))
  ------------------
  |  Branch (915:12): [True: 158, False: 166]
  ------------------
  916|    158|    return it->idx_;
  917|    166|  return -1;
  918|    324|}
_ZN5Exiv28Internal10nikonCryptEtPKhmPNS0_13TiffComponentE:
  920|    115|DataBuf nikonCrypt(uint16_t tag, const byte* pData, size_t size, TiffComponent* pRoot) {
  921|    115|  DataBuf buf;
  922|       |
  923|    115|  if (size < 4)
  ------------------
  |  Branch (923:7): [True: 0, False: 115]
  ------------------
  924|      0|    return buf;
  925|    115|  auto nci = Exiv2::find(nikonArrayIdx, NikonArrayIdx::Key{tag, reinterpret_cast<const char*>(pData), size});
  926|    115|  if (!nci || nci->start_ == NA || size <= nci->start_)
  ------------------
  |  |  865|    230|#define NA std::numeric_limits<uint32_t>::max()
  ------------------
  |  Branch (926:7): [True: 0, False: 115]
  |  Branch (926:15): [True: 16, False: 99]
  |  Branch (926:36): [True: 8, False: 91]
  ------------------
  927|     24|    return buf;
  928|       |
  929|       |  // Find Exif.Nikon3.ShutterCount
  930|     91|  TiffFinder finder(0x00a7, IfdId::nikon3Id);
  931|     91|  pRoot->accept(finder);
  932|     91|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  933|     91|  if (!te || !te->pValue() || te->pValue()->count() == 0)
  ------------------
  |  Branch (933:7): [True: 45, False: 46]
  |  Branch (933:14): [True: 3, False: 43]
  |  Branch (933:31): [True: 5, False: 38]
  ------------------
  934|     53|    return buf;
  935|     38|  auto count = te->pValue()->toUint32();
  936|       |
  937|       |  // Find Exif.Nikon3.SerialNumber
  938|     38|  finder.init(0x001d, IfdId::nikon3Id);
  939|     38|  pRoot->accept(finder);
  940|     38|  te = dynamic_cast<const TiffEntryBase*>(finder.result());
  941|     38|  if (!te || !te->pValue() || te->pValue()->count() == 0)
  ------------------
  |  Branch (941:7): [True: 4, False: 34]
  |  Branch (941:14): [True: 3, False: 31]
  |  Branch (941:31): [True: 5, False: 26]
  ------------------
  942|     12|    return buf;
  943|     26|  bool ok(false);
  944|     26|  auto serial = stringTo<uint32_t>(te->pValue()->toString(), ok);
  945|     26|  if (!ok) {
  ------------------
  |  Branch (945:7): [True: 22, False: 4]
  ------------------
  946|     22|    std::string model = getExifModel(pRoot);
  947|     22|    if (model.empty())
  ------------------
  |  Branch (947:9): [True: 12, False: 10]
  ------------------
  948|     12|      return buf;
  949|     10|    if (Internal::contains(model, "D50")) {
  ------------------
  |  Branch (949:9): [True: 0, False: 10]
  ------------------
  950|      0|      serial = 0x22;
  951|     10|    } else {
  952|     10|      serial = 0x60;
  953|     10|    }
  954|     10|  }
  955|     14|  buf.alloc(size);
  956|     14|  std::copy_n(pData, buf.size(), buf.begin());
  957|     14|  ncrypt(buf.data(nci->start_), static_cast<uint32_t>(buf.size()) - nci->start_, count, serial);
  958|     14|  return buf;
  959|     26|}
_ZN5Exiv28Internal14sonyCsSelectorEtPKhmPNS0_13TiffComponentE:
  961|     50|int sonyCsSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  962|     50|  std::string model = getExifModel(pRoot);
  963|     50|  if (model.empty())
  ------------------
  |  Branch (963:7): [True: 16, False: 34]
  ------------------
  964|     16|    return -1;
  965|     34|  int idx = 0;
  966|     34|  if (Internal::contains(model, "DSLR-A330") || Internal::contains(model, "DSLR-A380")) {
  ------------------
  |  Branch (966:7): [True: 8, False: 26]
  |  Branch (966:49): [True: 6, False: 20]
  ------------------
  967|     14|    idx = 1;
  968|     14|  }
  969|     34|  return idx;
  970|     50|}
_ZN5Exiv28Internal17sony2010eSelectorEtPKhmPNS0_13TiffComponentE:
  971|     54|int sony2010eSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  972|     54|  static constexpr const char* models[] = {
  973|     54|      "SLT-A58",   "SLT-A99",  "ILCE-3000", "ILCE-3500", "NEX-3N",    "NEX-5R",   "NEX-5T",
  974|     54|      "NEX-6",     "VG30E",    "VG900",     "DSC-RX100", "DSC-RX1",   "DSC-RX1R", "DSC-HX300",
  975|     54|      "DSC-HX50V", "DSC-TX30", "DSC-WX60",  "DSC-WX200", "DSC-WX300",
  976|     54|  };
  977|     54|  return Exiv2::find(models, getExifModel(pRoot)) ? 0 : -1;
  ------------------
  |  Branch (977:10): [True: 0, False: 54]
  ------------------
  978|     54|}
_ZN5Exiv28Internal15sony2FpSelectorEtPKhmPNS0_13TiffComponentE:
  980|    127|int sony2FpSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  981|       |  // Not valid for models beginning
  982|    127|  std::string model = getExifModel(pRoot);
  983|    127|  for (auto str : {"SLT-", "HV", "ILCA-"})
  ------------------
  |  Branch (983:17): [True: 375, False: 123]
  ------------------
  984|    375|    if (model.starts_with(str))
  ------------------
  |  Branch (984:9): [True: 4, False: 371]
  ------------------
  985|      4|      return -1;
  986|    123|  return 0;
  987|    127|}
_ZN5Exiv28Internal18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentE:
  989|     89|int sonyMisc2bSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  990|       |  // From Exiftool: https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/Sony.pm
  991|       |  // >  First byte must be 9 or 12 or 13 or 15 or 16 and 4th byte must be 2 (deciphered)
  992|       |
  993|       |  // Get the value from the image format that is being used
  994|     89|  auto value = getExifValue(pRoot, 0x9404, Exiv2::IfdId::sony1Id);
  995|     89|  if (!value) {
  ------------------
  |  Branch (995:7): [True: 70, False: 19]
  ------------------
  996|     70|    value = getExifValue(pRoot, 0x9404, Exiv2::IfdId::sony2Id);
  997|     70|    if (!value)
  ------------------
  |  Branch (997:9): [True: 0, False: 70]
  ------------------
  998|      0|      return -1;
  999|     70|  }
 1000|       |
 1001|     89|  if (value->count() < 4)
  ------------------
  |  Branch (1001:7): [True: 19, False: 70]
  ------------------
 1002|     19|    return -1;
 1003|       |
 1004|     70|  switch (value->toInt64(0)) {                 // Using encrypted values
 1005|     12|    case 231:                                  // 231 == 9
  ------------------
  |  Branch (1005:5): [True: 12, False: 58]
  ------------------
 1006|     22|    case 234:                                  // 234 == 12
  ------------------
  |  Branch (1006:5): [True: 10, False: 60]
  ------------------
 1007|     32|    case 205:                                  // 205 == 13
  ------------------
  |  Branch (1007:5): [True: 10, False: 60]
  ------------------
 1008|     42|    case 138:                                  // 138 == 15
  ------------------
  |  Branch (1008:5): [True: 10, False: 60]
  ------------------
 1009|     52|    case 112:                                  // 112 == 16
  ------------------
  |  Branch (1009:5): [True: 10, False: 60]
  ------------------
 1010|     52|      return value->toInt64(3) == 8 ? 0 : -1;  // 8   == 2
  ------------------
  |  Branch (1010:14): [True: 16, False: 36]
  ------------------
 1011|     18|    default:
  ------------------
  |  Branch (1011:5): [True: 18, False: 52]
  ------------------
 1012|     18|      break;
 1013|     70|  }
 1014|     18|  return -1;
 1015|     70|}
_ZN5Exiv28Internal18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentE:
 1016|    153|int sonyMisc3cSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
 1017|       |  // For condition, see Exiftool (Tag 9400c):
 1018|       |  // https://github.com/exiftool/exiftool/blob/2200871d9cef988051d2a99d67df3bda6cbb30a8/lib/Image/ExifTool/Sony.pm#L1826
 1019|       |
 1020|       |  // Get the value from the image format that is being used
 1021|    153|  auto value = getExifValue(pRoot, 0x9400, Exiv2::IfdId::sony1Id);
 1022|    153|  if (!value) {
  ------------------
  |  Branch (1022:7): [True: 99, False: 54]
  ------------------
 1023|     99|    value = getExifValue(pRoot, 0x9400, Exiv2::IfdId::sony2Id);
 1024|     99|    if (!value)
  ------------------
  |  Branch (1024:9): [True: 0, False: 99]
  ------------------
 1025|      0|      return -1;
 1026|     99|  }
 1027|       |
 1028|    153|  if (value->count() < 1)
  ------------------
  |  Branch (1028:7): [True: 4, False: 149]
  ------------------
 1029|      4|    return -1;
 1030|       |
 1031|    149|  switch (value->toInt64()) {
 1032|     11|    case 35:  // 0x23 for DSC-RX10/HX60V/HX350/HX400V/WX220/WX350, ILCE-7/7R/5000/6000, ILCA-68/77M2
  ------------------
  |  Branch (1032:5): [True: 11, False: 138]
  ------------------
 1033|     21|    case 36:  // 0x24 for ILCA-99M2,ILCE-5100/6300/6500/7M2/7RM2/7S/7SM2/QX1,
  ------------------
  |  Branch (1033:5): [True: 10, False: 139]
  ------------------
 1034|       |              // DSC-HX80/HX90V/QX30/RX0/RX100M3/RX100M4/RX100M5/RX10M2/RX10M3/RX1RM2/WX500
 1035|     44|    case 38:  // 0x26 for ILCE-6100/6400/6600/7M3/7RM3/9, DSC-RX0M2/RX10M4/RX100M5A/RX100M6/HX95/HX99
  ------------------
  |  Branch (1035:5): [True: 23, False: 126]
  ------------------
 1036|     54|    case 40:  // 0x28 for ILCE-7RM4/9M2, DSC-RX100M7, ZV-1/1F/1M2/E10
  ------------------
  |  Branch (1036:5): [True: 10, False: 139]
  ------------------
 1037|     67|    case 49:  // 0x31 for ILCE-1/7M4/7SM3, ILME-FX3
  ------------------
  |  Branch (1037:5): [True: 13, False: 136]
  ------------------
 1038|     77|    case 50:  // 0x32 for ILCE-7RM5, ILME-FX30
  ------------------
  |  Branch (1038:5): [True: 10, False: 139]
  ------------------
 1039|     98|    case 51:  // 0x33 for ILCE-6700/7CM2/7CR/9M3, ZV-E1
  ------------------
  |  Branch (1039:5): [True: 21, False: 128]
  ------------------
 1040|    109|    case 52:  // 0x34 for DSC-RX10M5
  ------------------
  |  Branch (1040:5): [True: 11, False: 138]
  ------------------
 1041|    119|    case 65:  // 0x41 for ILCE-7M5
  ------------------
  |  Branch (1041:5): [True: 10, False: 139]
  ------------------
 1042|    129|    case 67:  // 0x43 for ILCE-7RM6
  ------------------
  |  Branch (1042:5): [True: 10, False: 139]
  ------------------
 1043|    129|      return 0;
 1044|     20|    default:
  ------------------
  |  Branch (1044:5): [True: 20, False: 129]
  ------------------
 1045|     20|      break;
 1046|    149|  }
 1047|     20|  return -1;
 1048|    149|}
makernote_int.cpp:_ZN12_GLOBAL__N_112getExifValueEPN5Exiv28Internal13TiffComponentEtNS0_5IfdIdE:
 1054|    664|const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, uint16_t tag, Exiv2::IfdId group) {
 1055|    664|  Exiv2::Internal::TiffFinder finder(tag, group);
 1056|    664|  if (!pRoot)
  ------------------
  |  Branch (1056:7): [True: 0, False: 664]
  ------------------
 1057|      0|    return nullptr;
 1058|    664|  pRoot->accept(finder);
 1059|    664|  auto te = dynamic_cast<const Exiv2::Internal::TiffEntryBase*>(finder.result());
 1060|    664|  return (!te || !te->pValue()) ? nullptr : te->pValue();
  ------------------
  |  Branch (1060:11): [True: 220, False: 444]
  |  Branch (1060:18): [True: 33, False: 411]
  ------------------
 1061|    664|}
makernote_int.cpp:_ZN12_GLOBAL__N_112getExifModelEPN5Exiv28Internal13TiffComponentE:
 1063|    253|std::string getExifModel(Exiv2::Internal::TiffComponent* pRoot) {
 1064|       |  // Lookup the Exif.Image.Model tag
 1065|    253|  const auto value = getExifValue(pRoot, 0x0110, Exiv2::IfdId::ifd0Id);
 1066|    253|  return (!value || value->count() == 0) ? std::string() : value->toString();
  ------------------
  |  Branch (1066:11): [True: 84, False: 169]
  |  Branch (1066:21): [True: 31, False: 138]
  ------------------
 1067|    253|}
makernote_int.cpp:_ZN12_GLOBAL__N_16ncryptEPhjjj:
 1069|     14|void ncrypt(Exiv2::byte* pData, uint32_t size, uint32_t count, uint32_t serial) {
 1070|     14|  static const Exiv2::byte xlat[2][256] = {
 1071|     14|      {0xc1, 0xbf, 0x6d, 0x0d, 0x59, 0xc5, 0x13, 0x9d, 0x83, 0x61, 0x6b, 0x4f, 0xc7, 0x7f, 0x3d, 0x3d, 0x53, 0x59, 0xe3,
 1072|     14|       0xc7, 0xe9, 0x2f, 0x95, 0xa7, 0x95, 0x1f, 0xdf, 0x7f, 0x2b, 0x29, 0xc7, 0x0d, 0xdf, 0x07, 0xef, 0x71, 0x89, 0x3d,
 1073|     14|       0x13, 0x3d, 0x3b, 0x13, 0xfb, 0x0d, 0x89, 0xc1, 0x65, 0x1f, 0xb3, 0x0d, 0x6b, 0x29, 0xe3, 0xfb, 0xef, 0xa3, 0x6b,
 1074|     14|       0x47, 0x7f, 0x95, 0x35, 0xa7, 0x47, 0x4f, 0xc7, 0xf1, 0x59, 0x95, 0x35, 0x11, 0x29, 0x61, 0xf1, 0x3d, 0xb3, 0x2b,
 1075|     14|       0x0d, 0x43, 0x89, 0xc1, 0x9d, 0x9d, 0x89, 0x65, 0xf1, 0xe9, 0xdf, 0xbf, 0x3d, 0x7f, 0x53, 0x97, 0xe5, 0xe9, 0x95,
 1076|     14|       0x17, 0x1d, 0x3d, 0x8b, 0xfb, 0xc7, 0xe3, 0x67, 0xa7, 0x07, 0xf1, 0x71, 0xa7, 0x53, 0xb5, 0x29, 0x89, 0xe5, 0x2b,
 1077|     14|       0xa7, 0x17, 0x29, 0xe9, 0x4f, 0xc5, 0x65, 0x6d, 0x6b, 0xef, 0x0d, 0x89, 0x49, 0x2f, 0xb3, 0x43, 0x53, 0x65, 0x1d,
 1078|     14|       0x49, 0xa3, 0x13, 0x89, 0x59, 0xef, 0x6b, 0xef, 0x65, 0x1d, 0x0b, 0x59, 0x13, 0xe3, 0x4f, 0x9d, 0xb3, 0x29, 0x43,
 1079|     14|       0x2b, 0x07, 0x1d, 0x95, 0x59, 0x59, 0x47, 0xfb, 0xe5, 0xe9, 0x61, 0x47, 0x2f, 0x35, 0x7f, 0x17, 0x7f, 0xef, 0x7f,
 1080|     14|       0x95, 0x95, 0x71, 0xd3, 0xa3, 0x0b, 0x71, 0xa3, 0xad, 0x0b, 0x3b, 0xb5, 0xfb, 0xa3, 0xbf, 0x4f, 0x83, 0x1d, 0xad,
 1081|     14|       0xe9, 0x2f, 0x71, 0x65, 0xa3, 0xe5, 0x07, 0x35, 0x3d, 0x0d, 0xb5, 0xe9, 0xe5, 0x47, 0x3b, 0x9d, 0xef, 0x35, 0xa3,
 1082|     14|       0xbf, 0xb3, 0xdf, 0x53, 0xd3, 0x97, 0x53, 0x49, 0x71, 0x07, 0x35, 0x61, 0x71, 0x2f, 0x43, 0x2f, 0x11, 0xdf, 0x17,
 1083|     14|       0x97, 0xfb, 0x95, 0x3b, 0x7f, 0x6b, 0xd3, 0x25, 0xbf, 0xad, 0xc7, 0xc5, 0xc5, 0xb5, 0x8b, 0xef, 0x2f, 0xd3, 0x07,
 1084|     14|       0x6b, 0x25, 0x49, 0x95, 0x25, 0x49, 0x6d, 0x71, 0xc7},
 1085|     14|      {0xa7, 0xbc, 0xc9, 0xad, 0x91, 0xdf, 0x85, 0xe5, 0xd4, 0x78, 0xd5, 0x17, 0x46, 0x7c, 0x29, 0x4c, 0x4d, 0x03, 0xe9,
 1086|     14|       0x25, 0x68, 0x11, 0x86, 0xb3, 0xbd, 0xf7, 0x6f, 0x61, 0x22, 0xa2, 0x26, 0x34, 0x2a, 0xbe, 0x1e, 0x46, 0x14, 0x68,
 1087|     14|       0x9d, 0x44, 0x18, 0xc2, 0x40, 0xf4, 0x7e, 0x5f, 0x1b, 0xad, 0x0b, 0x94, 0xb6, 0x67, 0xb4, 0x0b, 0xe1, 0xea, 0x95,
 1088|     14|       0x9c, 0x66, 0xdc, 0xe7, 0x5d, 0x6c, 0x05, 0xda, 0xd5, 0xdf, 0x7a, 0xef, 0xf6, 0xdb, 0x1f, 0x82, 0x4c, 0xc0, 0x68,
 1089|     14|       0x47, 0xa1, 0xbd, 0xee, 0x39, 0x50, 0x56, 0x4a, 0xdd, 0xdf, 0xa5, 0xf8, 0xc6, 0xda, 0xca, 0x90, 0xca, 0x01, 0x42,
 1090|     14|       0x9d, 0x8b, 0x0c, 0x73, 0x43, 0x75, 0x05, 0x94, 0xde, 0x24, 0xb3, 0x80, 0x34, 0xe5, 0x2c, 0xdc, 0x9b, 0x3f, 0xca,
 1091|     14|       0x33, 0x45, 0xd0, 0xdb, 0x5f, 0xf5, 0x52, 0xc3, 0x21, 0xda, 0xe2, 0x22, 0x72, 0x6b, 0x3e, 0xd0, 0x5b, 0xa8, 0x87,
 1092|     14|       0x8c, 0x06, 0x5d, 0x0f, 0xdd, 0x09, 0x19, 0x93, 0xd0, 0xb9, 0xfc, 0x8b, 0x0f, 0x84, 0x60, 0x33, 0x1c, 0x9b, 0x45,
 1093|     14|       0xf1, 0xf0, 0xa3, 0x94, 0x3a, 0x12, 0x77, 0x33, 0x4d, 0x44, 0x78, 0x28, 0x3c, 0x9e, 0xfd, 0x65, 0x57, 0x16, 0x94,
 1094|     14|       0x6b, 0xfb, 0x59, 0xd0, 0xc8, 0x22, 0x36, 0xdb, 0xd2, 0x63, 0x98, 0x43, 0xa1, 0x04, 0x87, 0x86, 0xf7, 0xa6, 0x26,
 1095|     14|       0xbb, 0xd6, 0x59, 0x4d, 0xbf, 0x6a, 0x2e, 0xaa, 0x2b, 0xef, 0xe6, 0x78, 0xb6, 0x4e, 0xe0, 0x2f, 0xdc, 0x7c, 0xbe,
 1096|     14|       0x57, 0x19, 0x32, 0x7e, 0x2a, 0xd0, 0xb8, 0xba, 0x29, 0x00, 0x3c, 0x52, 0x7d, 0xa8, 0x49, 0x3b, 0x2d, 0xeb, 0x25,
 1097|     14|       0x49, 0xfa, 0xa3, 0xaa, 0x39, 0xa7, 0xc5, 0xa7, 0x50, 0x11, 0x36, 0xfb, 0xc6, 0x67, 0x4a, 0xf5, 0xa5, 0x12, 0x65,
 1098|     14|       0x7e, 0xb0, 0xdf, 0xaf, 0x4e, 0xb3, 0x61, 0x7f, 0x2f},
 1099|     14|  };
 1100|     14|  Exiv2::byte key = 0;
 1101|     70|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1101:19): [True: 56, False: 14]
  ------------------
 1102|     56|    key ^= static_cast<Exiv2::byte>(count >> (i * 8));
 1103|     56|  }
 1104|     14|  Exiv2::byte ci = xlat[0][serial & 0xff];
 1105|     14|  Exiv2::byte cj = xlat[1][key];
 1106|     14|  Exiv2::byte ck = 0x60;
 1107|  8.65k|  for (uint32_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (1107:24): [True: 8.64k, False: 14]
  ------------------
 1108|  8.64k|    cj += ci * ck++;
 1109|  8.64k|    pData[i] ^= cj;
 1110|  8.64k|  }
 1111|     14|}
_ZNK5Exiv28Internal13NikonArrayIdxeqERKNS1_3KeyE:
  854|  9.08k|  bool operator==(const Key& key) const {
  855|  9.08k|    return key.tag_ == tag_ && 0 == strncmp(key.ver_, ver_, strlen(ver_)) && (size_ == 0 || key.size_ == size_);
  ------------------
  |  Branch (855:12): [True: 2.60k, False: 6.48k]
  |  Branch (855:32): [True: 290, False: 2.31k]
  |  Branch (855:79): [True: 272, False: 18]
  |  Branch (855:93): [True: 1, False: 17]
  ------------------
  856|  9.08k|  }

_ZN5Exiv28Internal8MnHeaderC2Ev:
   99|  2.39k|  MnHeader() = default;
_ZN5Exiv28Internal8MnHeaderD2Ev:
  101|  2.39k|  virtual ~MnHeader() = default;

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.26k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.26k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  8.93k|std::string MatroskaVideo::mimeType() const {
  604|  8.93k|  return "video/matroska";
  605|  8.93k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.26k|void MatroskaVideo::readMetadata() {
  611|  3.26k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.26k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.26k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.26k]
  ------------------
  616|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  618|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  619|      0|  }
  620|       |
  621|  3.26k|  IoCloser closer(*io_);
  622|  3.26k|  clearMetadata();
  623|  3.26k|  continueTraversing_ = true;
  624|  3.26k|  height_ = width_ = 1;
  625|       |
  626|  3.26k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.26k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|  83.7k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 80.4k, False: 3.26k]
  ------------------
  630|  80.4k|    decodeBlock();
  631|       |
  632|  3.26k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.26k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|  80.4k|void MatroskaVideo::decodeBlock() {
  636|  80.4k|  byte buf[8];
  637|  80.4k|  io_->read(buf, 1);
  638|       |
  639|  80.4k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 340, False: 80.1k]
  ------------------
  640|    340|    continueTraversing_ = false;
  641|    340|    return;
  642|    340|  }
  643|       |
  644|  80.1k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|  80.1k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 79.6k, False: 484]
  ------------------
  646|  79.6k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|  80.1k|  auto tag_id = returnTagValue(buf, block_size);
  649|  80.1k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|  80.1k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.66k, False: 78.4k]
  ------------------
  652|  1.66k|    continueTraversing_ = false;
  653|  1.66k|    return;
  654|  1.66k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|  78.4k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 552, False: 77.8k]
  |  Branch (658:27): [True: 10, False: 77.8k]
  ------------------
  659|     20|    continueTraversing_ = false;
  660|     20|    return;
  661|     20|  }
  662|       |
  663|  78.4k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|  78.4k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|  78.4k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 77.7k, False: 679]
  ------------------
  667|  77.7k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|  78.4k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|  78.4k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 43.2k, False: 35.1k]
  |  Branch (670:29): [True: 43.2k, False: 0]
  ------------------
  671|  43.2k|    return;
  672|       |
  673|  35.1k|  const size_t bufMaxSize = 200;
  674|       |
  675|  35.1k|#ifndef SUPPRESS_WARNINGS
  676|  35.1k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 32.4k, False: 2.73k]
  |  Branch (676:28): [True: 177, False: 32.2k]
  ------------------
  677|    177|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    177|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 177]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    177|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    177|  }
  680|  35.1k|#endif
  681|  35.1k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.73k, False: 32.4k]
  |  Branch (681:27): [True: 177, False: 32.2k]
  ------------------
  682|  2.21k|    io_->seek(size, BasicIo::cur);
  683|  2.21k|    return;
  684|  2.21k|  }
  685|       |
  686|  32.9k|  DataBuf buf2(bufMaxSize + 1);
  687|  32.9k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  32.9k|  switch (tag->_type) {
  689|  10.0k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 10.0k, False: 22.9k]
  ------------------
  690|  10.0k|      decodeInternalTags(tag, buf2.data());
  691|  10.0k|      break;
  692|  2.28k|    case String:
  ------------------
  |  Branch (692:5): [True: 2.28k, False: 30.6k]
  ------------------
  693|  2.28k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 32.9k]
  ------------------
  694|  2.28k|      decodeStringTags(tag, buf2.data());
  695|  2.28k|      break;
  696|  2.28k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 2.28k, False: 30.6k]
  ------------------
  697|  3.00k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 719, False: 32.2k]
  ------------------
  698|  3.00k|      decodeIntegerTags(tag, buf2.data());
  699|  3.00k|      break;
  700|  13.3k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 13.3k, False: 19.6k]
  ------------------
  701|  13.3k|      decodeBooleanTags(tag, buf2.data());
  702|  13.3k|      break;
  703|  2.22k|    case Date:
  ------------------
  |  Branch (703:5): [True: 2.22k, False: 30.7k]
  ------------------
  704|  2.22k|      decodeDateTags(tag, buf2.data(), size);
  705|  2.22k|      break;
  706|  1.18k|    case Float:
  ------------------
  |  Branch (706:5): [True: 1.18k, False: 31.7k]
  ------------------
  707|  1.18k|      decodeFloatTags(tag, buf2.data());
  708|  1.18k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 32.9k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 32.9k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 32.9k]
  ------------------
  714|      0|      break;
  715|  32.9k|  }
  716|  32.9k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  10.0k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  10.0k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  10.0k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 406, False: 9.64k]
  ------------------
  721|    406|    return;
  722|       |
  723|  9.64k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  9.64k|    switch (tag->_id) {
  725|  9.64k|      case Xmp_video_VideoScanTpye:
  726|  9.64k|        return Exiv2::find(videoScanType, key);
  727|  9.64k|      case Xmp_audio_ChannelType:
  728|  9.64k|        return Exiv2::find(audioChannels, key);
  729|  9.64k|      case Xmp_video_ContentCompressAlgo:
  730|  9.64k|        return Exiv2::find(compressionAlgorithm, key);
  731|  9.64k|      case Xmp_video_ContentEncryptAlgo:
  732|  9.64k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  9.64k|      case Xmp_video_ContentSignAlgo_1:
  734|  9.64k|      case Xmp_video_ContentSignAlgo_2:
  735|  9.64k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  9.64k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  9.64k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  9.64k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  9.64k|      case Xmp_video_ContentEncodingType:
  740|  9.64k|        return Exiv2::find(encodingType, key);
  741|  9.64k|      case Xmp_video_DisplayUnit:
  742|  9.64k|        return Exiv2::find(displayUnit, key);
  743|  9.64k|      case Xmp_video_AspectRatioType:
  744|  9.64k|        return Exiv2::find(aspectRatioType, key);
  745|  9.64k|      case Xmp_video_PhysicalEquivalent:
  746|  9.64k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  9.64k|      case Xmp_video_TranslateCodec:
  748|  9.64k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  9.64k|      case Video_Audio_CodecID:
  750|  9.64k|        return Exiv2::find(trackCodec, key);
  751|  9.64k|      case Video_Audio_CodecName:
  752|  9.64k|        return Exiv2::find(codecInfo, key);
  753|  9.64k|      case CodecDownloadURL:
  754|  9.64k|      case CodecInfoURL:
  755|  9.64k|        return Exiv2::find(codecDownloadUrl, key);
  756|  9.64k|    }
  757|  9.64k|    return nullptr;
  758|  9.64k|  }();
  759|  9.64k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 4.19k, False: 5.45k]
  ------------------
  760|  4.19k|    xmpData_[tag->_label] = internalMt->_label;
  761|  5.45k|  } else {
  762|  5.45k|    xmpData_[tag->_label] = key;
  763|  5.45k|  }
  764|  9.64k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  2.28k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  2.28k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 195, False: 2.09k]
  ------------------
  768|    195|    track_count_++;
  769|    195|    xmpData_[tag->_label] = track_count_;
  770|  2.09k|  } else {
  771|  2.09k|    xmpData_[tag->_label] = buf;
  772|  2.09k|  }
  773|  2.28k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  3.00k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  3.00k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  3.00k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 381, False: 2.62k]
  ------------------
  778|    381|    return;
  779|       |
  780|  2.62k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 360, False: 2.26k]
  |  Branch (780:40): [True: 107, False: 2.15k]
  ------------------
  781|    467|    width_ = value;
  782|  2.62k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 756, False: 1.86k]
  |  Branch (782:41): [True: 666, False: 1.20k]
  ------------------
  783|  1.42k|    height_ = value;
  784|  2.62k|  xmpData_[tag->_label] = value;
  785|  2.62k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  13.3k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  13.3k|  const MatroskaTag* internalMt = nullptr;
  789|  13.3k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  13.3k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 369, False: 12.9k]
  ------------------
  791|    369|    return;
  792|       |
  793|  12.9k|  switch (tag->_id) {
  794|  3.25k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 3.25k, False: 9.71k]
  ------------------
  795|  3.25k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 741, False: 2.50k]
  ------------------
  796|    741|        stream_ = f->_id;
  797|    741|      }
  798|  3.25k|      break;
  799|    700|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 700, False: 12.2k]
  ------------------
  800|    700|      internalMt = Exiv2::find(trackEnable, key);
  801|    700|      break;
  802|  5.55k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 5.55k, False: 7.41k]
  ------------------
  803|  5.55k|      internalMt = Exiv2::find(defaultOn, key);
  804|  5.55k|      break;
  805|    629|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 629, False: 12.3k]
  ------------------
  806|    629|      internalMt = Exiv2::find(trackForced, key);
  807|    629|      break;
  808|  1.00k|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 1.00k, False: 11.9k]
  ------------------
  809|  1.00k|      internalMt = Exiv2::find(trackLacing, key);
  810|  1.00k|      break;
  811|  1.38k|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 1.38k, False: 11.5k]
  ------------------
  812|  1.38k|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|  1.38k|      break;
  814|    379|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 379, False: 12.5k]
  ------------------
  815|    379|      internalMt = Exiv2::find(codecSettings, key);
  816|    379|      break;
  817|     67|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 67, False: 12.8k]
  ------------------
  818|     67|      internalMt = tag;
  819|     67|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 12.9k]
  ------------------
  821|      0|      break;
  822|  12.9k|  }
  823|       |
  824|  12.9k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 2.13k, False: 10.8k]
  ------------------
  825|  2.13k|    xmpData_[internalMt->_label] = "Yes";
  826|  2.13k|  }
  827|  12.9k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  2.22k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  2.22k|  int64_t duration_in_ms = 0;
  831|  2.22k|  uint64_t value;
  832|  2.22k|  switch (tag->_id) {
  833|    990|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 990, False: 1.23k]
  ------------------
  834|    990|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 518, False: 472]
  ------------------
  835|    518|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    518|      } else {
  837|    472|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    472|      }
  839|    990|      xmpData_[tag->_label] = duration_in_ms;
  840|    990|      break;
  841|    574|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 574, False: 1.65k]
  ------------------
  842|    574|      value = getULongLong(buf, bigEndian);
  843|    574|      if (!value)
  ------------------
  |  Branch (843:11): [True: 225, False: 349]
  ------------------
  844|    225|        return;
  845|    349|      duration_in_ms = value / 1000000000;
  846|    349|      xmpData_[tag->_label] = duration_in_ms;
  847|    349|      break;
  848|       |
  849|    665|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 665, False: 1.56k]
  ------------------
  850|    665|      value = getULongLong(buf, bigEndian);
  851|    665|      if (!value)
  ------------------
  |  Branch (851:11): [True: 470, False: 195]
  ------------------
  852|    470|        return;
  853|    195|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    195|      xmpData_[tag->_label] = time_code_scale_;
  855|    195|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 2.22k]
  ------------------
  857|      0|      break;
  858|  2.22k|  }
  859|  2.22k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  1.18k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  1.18k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  1.18k|  switch (tag->_id) {
  865|    280|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 280, False: 903]
  ------------------
  866|    494|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 214, False: 969]
  ------------------
  867|    494|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|    494|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 1.18k]
  ------------------
  870|    689|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 689, False: 494]
  ------------------
  871|    689|      uint64_t key = getULongLong(buf, bigEndian);
  872|    689|      if (!key)
  ------------------
  |  Branch (872:11): [True: 143, False: 546]
  ------------------
  873|    143|        return;
  874|    546|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 293, False: 253]
  ------------------
  875|    293|        double frame_rate = 0;
  876|    293|        switch (stream_) {
  877|     67|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 67, False: 226]
  ------------------
  878|     67|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|     67|            break;
  880|    139|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 139, False: 154]
  ------------------
  881|    139|            frame_rate = static_cast<double>(key) / 1000;
  882|    139|            break;
  883|     87|          default:
  ------------------
  |  Branch (883:11): [True: 87, False: 206]
  ------------------
  884|     87|            break;
  885|    293|        }
  886|    293|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 206, False: 87]
  ------------------
  887|    206|          xmpData_[internalMt->_label] = frame_rate;
  888|    293|      } else
  889|    253|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|    546|    } break;
  891|    546|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 1.18k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  1.18k|  }
  895|  1.18k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   157k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   157k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 129k, False: 28.4k]
  ------------------
  899|   129k|    return 1;
  900|  28.4k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 16.4k, False: 12.0k]
  ------------------
  901|  16.4k|    return 2;
  902|  12.0k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 1.60k, False: 10.4k]
  ------------------
  903|  1.60k|    return 3;
  904|  10.4k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 6.09k, False: 4.34k]
  ------------------
  905|  6.09k|    return 4;
  906|  4.34k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 459, False: 3.88k]
  ------------------
  907|    459|    return 5;
  908|  3.88k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 422, False: 3.46k]
  ------------------
  909|    422|    return 6;
  910|  3.46k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 817, False: 2.64k]
  ------------------
  911|    817|    return 7;
  912|  2.64k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.07k, False: 574]
  ------------------
  913|  2.07k|    return 8;
  914|    574|  return 0;
  915|  2.64k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.26k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.26k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.26k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.26k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.26k|  return image;
  923|  3.26k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  13.6k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  13.6k|  bool result = true;
  927|  13.6k|  byte tmpBuf[4];
  928|  13.6k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  13.6k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 13.6k]
  |  Branch (930:22): [True: 314, False: 13.3k]
  ------------------
  931|    314|    return false;
  932|       |
  933|  13.3k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 3.53k, False: 9.81k]
  |  Branch (933:28): [True: 11, False: 9.80k]
  |  Branch (933:49): [True: 11, False: 9.79k]
  |  Branch (933:70): [True: 11, False: 9.78k]
  ------------------
  934|  3.57k|    result = false;
  935|  3.57k|  }
  936|       |
  937|  13.3k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 13.3k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  13.3k|    iIo.seek(0, BasicIo::beg);
  939|  13.3k|  return result;
  940|  13.6k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   157k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   157k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 157k, False: 574]
  |  Branch (583:23): [True: 157k, False: 0]
  ------------------
  584|       |
  585|   157k|  size_t b0 = buf[0] & (0xff >> size);
  586|   157k|  size_t tag = b0 << ((size - 1) * 8);
  587|   218k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 61.0k, False: 157k]
  ------------------
  588|  61.0k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  61.0k|  }
  590|       |
  591|   157k|  return tag;
  592|   157k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  9.64k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  9.64k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 9.64k, False: 0]
  ------------------
  725|    412|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 412, False: 9.23k]
  ------------------
  726|    412|        return Exiv2::find(videoScanType, key);
  727|    896|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 896, False: 8.75k]
  ------------------
  728|    896|        return Exiv2::find(audioChannels, key);
  729|    545|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 545, False: 9.10k]
  ------------------
  730|    545|        return Exiv2::find(compressionAlgorithm, key);
  731|  2.03k|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 2.03k, False: 7.61k]
  ------------------
  732|  2.03k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  1.65k|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 1.65k, False: 7.99k]
  ------------------
  734|  1.73k|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 78, False: 9.56k]
  ------------------
  735|  1.73k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    434|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 434, False: 9.21k]
  ------------------
  737|    955|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 521, False: 9.12k]
  ------------------
  738|    955|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    371|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 371, False: 9.27k]
  ------------------
  740|    371|        return Exiv2::find(encodingType, key);
  741|    343|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 343, False: 9.30k]
  ------------------
  742|    343|        return Exiv2::find(displayUnit, key);
  743|    943|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 943, False: 8.70k]
  ------------------
  744|    943|        return Exiv2::find(aspectRatioType, key);
  745|    507|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 507, False: 9.14k]
  ------------------
  746|    507|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    645|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 645, False: 9.00k]
  ------------------
  748|    645|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 9.64k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    131|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 131, False: 9.51k]
  ------------------
  752|    131|        return Exiv2::find(codecInfo, key);
  753|      5|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 5, False: 9.64k]
  ------------------
  754|    133|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 128, False: 9.51k]
  ------------------
  755|    133|        return Exiv2::find(codecDownloadUrl, key);
  756|  9.64k|    }
  757|      0|    return nullptr;
  758|  9.64k|  }();

_ZN5Exiv23KeyD2Ev:
   11|  5.56M|Key::~Key() = default;
_ZN5Exiv29MetadatumD2Ev:
   17|  2.71M|Metadatum::~Metadatum() = default;
_ZNK5Exiv29Metadatum8toUint32Em:
   25|  79.0k|uint32_t Metadatum::toUint32(size_t n) const {
   26|  79.0k|  auto i = toInt64(n);
   27|  79.0k|  Internal::enforce(std::numeric_limits<uint32_t>::min() <= i, ErrorCode::kerCorruptedMetadata);
   28|  79.0k|  Internal::enforce(i <= std::numeric_limits<uint32_t>::max(), ErrorCode::kerCorruptedMetadata);
   29|  79.0k|  return static_cast<uint32_t>(i);
   30|  79.0k|}

_ZN5Exiv28Internal16MinoltaMakerNote7tagListEv:
   25|   105k|  static constexpr auto tagList() {
   26|   105k|    return tagInfo_;
   27|   105k|  }
_ZN5Exiv28Internal16MinoltaMakerNote11tagListCs5DEv:
   37|    237|  static constexpr auto tagListCs5D() {
   38|    237|    return tagInfoCs5D_;
   39|    237|  }
_ZN5Exiv28Internal16MinoltaMakerNote11tagListCs7DEv:
   33|    264|  static constexpr auto tagListCs7D() {
   34|    264|    return tagInfoCs7D_;
   35|    264|  }
_ZN5Exiv28Internal16MinoltaMakerNote12tagListCsStdEv:
   29|    601|  static constexpr auto tagListCsStd() {
   30|    601|    return tagInfoCsStd_;
   31|    601|  }

_ZN5Exiv28MrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   24|    239|    Image(ImageType::mrw, mdExif | mdIptc | mdXmp, std::move(io), params) {
   25|    239|}
_ZNK5Exiv28MrwImage8mimeTypeEv:
   27|      6|std::string MrwImage::mimeType() const {
   28|      6|  return "image/x-minolta-mrw";
   29|      6|}
_ZNK5Exiv28MrwImage10pixelWidthEv:
   31|     10|uint32_t MrwImage::pixelWidth() const {
   32|     10|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   33|     10|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (33:7): [True: 0, False: 10]
  |  Branch (33:7): [True: 0, False: 10]
  |  Branch (33:40): [True: 0, False: 0]
  ------------------
   34|      0|    return imageWidth->toUint32();
   35|      0|  }
   36|     10|  return 0;
   37|     10|}
_ZNK5Exiv28MrwImage11pixelHeightEv:
   39|     10|uint32_t MrwImage::pixelHeight() const {
   40|     10|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   41|     10|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 10]
  |  Branch (41:7): [True: 0, False: 10]
  |  Branch (41:41): [True: 0, False: 0]
  ------------------
   42|      0|    return imageHeight->toUint32();
   43|      0|  }
   44|     10|  return 0;
   45|     10|}
_ZN5Exiv28MrwImage12readMetadataEv:
   62|    239|void MrwImage::readMetadata() {
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |  std::cerr << "Reading MRW file " << io_->path() << "\n";
   65|       |#endif
   66|    239|  if (io_->open() != 0) {
  ------------------
  |  Branch (66:7): [True: 0, False: 239]
  ------------------
   67|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   68|      0|  }
   69|    239|  IoCloser closer(*io_);
   70|       |  // Ensure that this is the correct image type
   71|    239|  if (!isMrwType(*io_, false)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 239]
  ------------------
   72|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  |  Branch (72:25): [True: 0, False: 0]
  ------------------
   73|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   74|      0|    throw Error(ErrorCode::kerNotAnImage, "MRW");
   75|      0|  }
   76|    239|  clearMetadata();
   77|       |
   78|       |  // Find the TTW block and read it into a buffer
   79|    239|  uint32_t const len = 8;
   80|    239|  byte tmp[len];
   81|    239|  io_->read(tmp, len);
   82|    239|  uint32_t pos = len;
   83|    239|  uint32_t const end = getULong(tmp + 4, bigEndian);
   84|       |
   85|    239|  pos += len;
   86|    239|  Internal::enforce(pos <= end, ErrorCode::kerFailedToReadImageData);
   87|    239|  io_->read(tmp, len);
   88|    239|  if (io_->error() || io_->eof())
  ------------------
  |  Branch (88:7): [True: 13, False: 226]
  |  Branch (88:23): [True: 0, False: 226]
  ------------------
   89|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   90|       |
   91|    679|  while (memcmp(tmp + 1, "TTW", 3) != 0) {
  ------------------
  |  Branch (91:10): [True: 440, False: 239]
  ------------------
   92|    440|    uint32_t const siz = getULong(tmp + 4, bigEndian);
   93|    440|    Internal::enforce(siz <= end - pos, ErrorCode::kerFailedToReadImageData);
   94|    440|    pos += siz;
   95|    440|    io_->seek(siz, BasicIo::cur);
   96|    440|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (96:23): [True: 417, False: 23]
  |  Branch (96:40): [True: 323, False: 94]
  ------------------
   97|       |
   98|    440|    Internal::enforce(len <= end - pos, ErrorCode::kerFailedToReadImageData);
   99|    440|    pos += len;
  100|    440|    io_->read(tmp, len);
  101|    440|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (101:23): [True: 312, False: 128]
  |  Branch (101:40): [True: 267, False: 45]
  ------------------
  102|    440|  }
  103|       |
  104|    239|  const uint32_t siz = getULong(tmp + 4, bigEndian);
  105|       |  // First do an approximate bounds check of siz, so that we don't
  106|       |  // get DOS-ed by a 4GB allocation on the next line. If siz is
  107|       |  // greater than io_->size() then it is definitely invalid. But the
  108|       |  // exact bounds checking is done by the call to io_->read, which
  109|       |  // will fail if there are fewer than siz bytes left to read.
  110|    239|  Internal::enforce(siz <= io_->size(), ErrorCode::kerFailedToReadImageData);
  111|    239|  DataBuf buf(siz);
  112|    239|  io_->read(buf.data(), buf.size());
  113|    239|  Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (113:21): [True: 32, False: 207]
  |  Branch (113:38): [True: 22, False: 10]
  ------------------
  114|       |
  115|    239|  const DecodeParams dp(max_recursion_depth_);
  116|    239|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.c_data(), buf.size(), dp);
  117|    239|  setByteOrder(bo);
  118|    239|}  // MrwImage::readMetadata
_ZN5Exiv214newMrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  127|    239|Image::UniquePtr newMrwInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  128|    239|  auto image = std::make_unique<MrwImage>(std::move(io), params);
  129|    239|  if (!image->good()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 239]
  ------------------
  130|      0|    return nullptr;
  131|      0|  }
  132|    239|  return image;
  133|    239|}
_ZN5Exiv29isMrwTypeERNS_7BasicIoEb:
  135|  34.7k|bool isMrwType(BasicIo& iIo, bool advance) {
  136|  34.7k|  const int32_t len = 4;
  137|  34.7k|  const std::array<byte, len> MrwId{0x0, 0x4d, 0x52, 0x4d};
  138|  34.7k|  std::array<byte, len> buf;
  139|  34.7k|  iIo.read(buf.data(), len);
  140|  34.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (140:7): [True: 0, False: 34.7k]
  |  Branch (140:22): [True: 143, False: 34.6k]
  ------------------
  141|    143|    return false;
  142|    143|  }
  143|  34.6k|  bool rc = buf == MrwId;
  144|  34.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (144:7): [True: 34.6k, False: 0]
  |  Branch (144:19): [True: 0, False: 0]
  ------------------
  145|  34.6k|    iIo.seek(-len, BasicIo::cur);
  146|  34.6k|  }
  147|  34.6k|  return rc;
  148|  34.7k|}

_ZN5Exiv28Internal15Nikon1MakerNote7tagListEv:
   38|    202|  static constexpr auto tagList() {
   39|    202|    return tagInfo_;
   40|    202|  }
_ZN5Exiv28Internal15Nikon2MakerNote7tagListEv:
   71|    492|  static constexpr auto tagList() {
   72|    492|    return tagInfo_;
   73|    492|  }
_ZN5Exiv28Internal15Nikon3MakerNote7tagListEv:
   91|  8.61k|  static constexpr auto tagList() {
   92|  8.61k|    return tagInfo_;
   93|  8.61k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListVrEv:
   95|  2.82k|  static constexpr auto tagListVr() {
   96|  2.82k|    return tagInfoVr_;
   97|  2.82k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListPcEv:
   99|    317|  static constexpr auto tagListPc() {
  100|    317|    return tagInfoPc_;
  101|    317|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListWtEv:
  103|    492|  static constexpr auto tagListWt() {
  104|    492|    return tagInfoWt_;
  105|    492|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListIiEv:
  107|    429|  static constexpr auto tagListIi() {
  108|    429|    return tagInfoIi_;
  109|    429|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListAfEv:
  111|    449|  static constexpr auto tagListAf() {
  112|    449|    return tagInfoAf_;
  113|    449|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf21Ev:
  115|    696|  static constexpr auto tagListAf21() {
  116|    696|    return tagInfoAf21_;
  117|    696|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf22Ev:
  119|    272|  static constexpr auto tagListAf22() {
  120|    272|    return tagInfoAf22_;
  121|    272|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListAFTEv:
  123|    309|  static constexpr auto tagListAFT() {
  124|    309|    return tagInfoAFT_;
  125|    309|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListFiEv:
  127|     13|  static constexpr auto tagListFi() {
  128|     13|    return tagInfoFi_;
  129|     13|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListMeEv:
  131|     15|  static constexpr auto tagListMe() {
  132|     15|    return tagInfoMe_;
  133|     15|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl1Ev:
  135|     26|  static constexpr auto tagListFl1() {
  136|     26|    return tagInfoFl1_;
  137|     26|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl2Ev:
  139|     22|  static constexpr auto tagListFl2() {
  140|     22|    return tagInfoFl2_;
  141|     22|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl3Ev:
  143|     21|  static constexpr auto tagListFl3() {
  144|     21|    return tagInfoFl3_;
  145|     21|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl6Ev:
  147|     66|  static constexpr auto tagListFl6() {
  148|     66|    return tagInfoFl6_;
  149|     66|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl7Ev:
  151|     67|  static constexpr auto tagListFl7() {
  152|     67|    return tagInfoFl7_;
  153|     67|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi1Ev:
  155|      9|  static constexpr auto tagListSi1() {
  156|      9|    return tagInfoSi1_;
  157|      9|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi2Ev:
  159|     39|  static constexpr auto tagListSi2() {
  160|     39|    return tagInfoSi2_;
  161|     39|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi5Ev:
  171|    394|  static constexpr auto tagListSi5() {
  172|    394|    return tagInfoSi5_;
  173|    394|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb1Ev:
  175|      6|  static constexpr auto tagListCb1() {
  176|      6|    return tagInfoCb1_;
  177|      6|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb2Ev:
  179|      9|  static constexpr auto tagListCb2() {
  180|      9|    return tagInfoCb2_;
  181|      9|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2aEv:
  183|     63|  static constexpr auto tagListCb2a() {
  184|     63|    return tagInfoCb2a_;
  185|     63|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2bEv:
  187|    118|  static constexpr auto tagListCb2b() {
  188|    118|    return tagInfoCb2b_;
  189|    118|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb3Ev:
  191|     17|  static constexpr auto tagListCb3() {
  192|     17|    return tagInfoCb3_;
  193|     17|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb4Ev:
  195|     14|  static constexpr auto tagListCb4() {
  196|     14|    return tagInfoCb4_;
  197|     14|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd1Ev:
  199|     76|  static constexpr auto tagListLd1() {
  200|     76|    return tagInfoLd1_;
  201|     76|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd2Ev:
  203|  50.3k|  static constexpr auto tagListLd2() {
  204|  50.3k|    return tagInfoLd2_;
  205|  50.3k|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd3Ev:
  207|    337|  static constexpr auto tagListLd3() {
  208|    337|    return tagInfoLd3_;
  209|    337|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd4Ev:
  211|    290|  static constexpr auto tagListLd4() {
  212|    290|    return tagInfoLd4_;
  213|    290|  }

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|  74.1k|  static constexpr auto tagList() {
   34|  74.1k|    return tagInfo_;
   35|  74.1k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  70.1k|  static constexpr auto tagListCs() {
   38|  70.1k|    return tagInfoCs_;
   39|  70.1k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    202|  static constexpr auto tagListEq() {
   42|    202|    return tagInfoEq_;
   43|    202|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|    255|  static constexpr auto tagListRd() {
   46|    255|    return tagInfoRd_;
   47|    255|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    323|  static constexpr auto tagListRd2() {
   50|    323|    return tagInfoRd2_;
   51|    323|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    196|  static constexpr auto tagListIp() {
   54|    196|    return tagInfoIp_;
   55|    196|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    216|  static constexpr auto tagListFi() {
   58|    216|    return tagInfoFi_;
   59|    216|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|    470|  static constexpr auto tagListFe() {
   62|    470|    return tagInfoFe_;
   63|    470|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    126|  static constexpr auto tagListRi() {
   66|    126|    return tagInfoRi_;
   67|    126|  }

_ZN5Exiv28OrfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   25|     75|    TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ std::move(io), params) {
   26|     75|  setTypeSupported(ImageType::orf, mdExif | mdIptc | mdXmp);
   27|     75|}  // OrfImage::OrfImage
_ZNK5Exiv28OrfImage8mimeTypeEv:
   29|     12|std::string OrfImage::mimeType() const {
   30|     12|  return "image/x-olympus-orf";
   31|     12|}
_ZNK5Exiv28OrfImage10pixelWidthEv:
   33|     54|uint32_t OrfImage::pixelWidth() const {
   34|     54|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   35|     54|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (35:7): [True: 23, False: 31]
  |  Branch (35:7): [True: 10, False: 44]
  |  Branch (35:40): [True: 10, False: 13]
  ------------------
   36|     10|    return imageWidth->toUint32();
   37|     10|  }
   38|     44|  return 0;
   39|     54|}
_ZNK5Exiv28OrfImage11pixelHeightEv:
   41|     54|uint32_t OrfImage::pixelHeight() const {
   42|     54|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   43|     54|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (43:7): [True: 26, False: 28]
  |  Branch (43:7): [True: 14, False: 40]
  |  Branch (43:41): [True: 14, False: 12]
  ------------------
   44|     14|    return imageHeight->toUint32();
   45|     14|  }
   46|     40|  return 0;
   47|     54|}
_ZN5Exiv28OrfImage12readMetadataEv:
   70|     75|void OrfImage::readMetadata() {
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |  std::cerr << "Reading ORF file " << io_->path() << "\n";
   73|       |#endif
   74|     75|  if (io_->open() != 0) {
  ------------------
  |  Branch (74:7): [True: 0, False: 75]
  ------------------
   75|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   76|      0|  }
   77|     75|  IoCloser closer(*io_);
   78|       |  // Ensure that this is the correct image type
   79|     75|  if (!isOrfType(*io_, false)) {
  ------------------
  |  Branch (79:7): [True: 0, False: 75]
  ------------------
   80|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  |  Branch (80:25): [True: 0, False: 0]
  ------------------
   81|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   82|      0|    throw Error(ErrorCode::kerNotAnImage, "ORF");
   83|      0|  }
   84|     75|  clearMetadata();
   85|     75|  const DecodeParams dp(max_recursion_depth_);
   86|     75|  ByteOrder bo = OrfParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size(), dp);
   87|     75|  setByteOrder(bo);
   88|     75|}
_ZN5Exiv29OrfParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmRKNS_12DecodeParamsE:
  115|     75|                            const DecodeParams& dp) {
  116|     75|  OrfHeader orfHeader;
  117|     75|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::root, TiffMapping::findDecoder, dp,
  118|     75|                                  &orfHeader);
  119|     75|}
_ZN5Exiv214newOrfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  141|     75|Image::UniquePtr newOrfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  142|     75|  auto image = std::make_unique<OrfImage>(std::move(io), params);
  143|     75|  if (!image->good()) {
  ------------------
  |  Branch (143:7): [True: 0, False: 75]
  ------------------
  144|      0|    return nullptr;
  145|      0|  }
  146|     75|  return image;
  147|     75|}
_ZN5Exiv29isOrfTypeERNS_7BasicIoEb:
  149|  23.2k|bool isOrfType(BasicIo& iIo, bool advance) {
  150|  23.2k|  const int32_t len = 8;
  151|  23.2k|  byte buf[len];
  152|  23.2k|  iIo.read(buf, len);
  153|  23.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (153:7): [True: 0, False: 23.2k]
  |  Branch (153:22): [True: 221, False: 23.0k]
  ------------------
  154|    221|    return false;
  155|    221|  }
  156|  23.0k|  OrfHeader orfHeader;
  157|  23.0k|  bool rc = orfHeader.read(buf, len);
  158|  23.0k|  if (!advance || !rc) {
  ------------------
  |  Branch (158:7): [True: 23.0k, False: 0]
  |  Branch (158:19): [True: 0, False: 0]
  ------------------
  159|  23.0k|    iIo.seek(-len, BasicIo::cur);
  160|  23.0k|  }
  161|  23.0k|  return rc;
  162|  23.2k|}

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  23.1k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  23.1k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  23.1k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  23.1k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 23.1k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  23.1k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 128, False: 22.9k]
  |  Branch (13:26): [True: 103, False: 25]
  ------------------
   14|    103|    setByteOrder(littleEndian);
   15|  23.0k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 282, False: 22.7k]
  |  Branch (15:33): [True: 249, False: 33]
  ------------------
   16|    249|    setByteOrder(bigEndian);
   17|  22.7k|  } else {
   18|  22.7k|    return false;
   19|  22.7k|  }
   20|       |
   21|    352|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    352|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 268, False: 84]
  |  Branch (22:23): [True: 52, False: 216]
  ------------------
   23|     52|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    300|  sig_ = sig;
   25|    300|  setOffset(getULong(pData + 4, byteOrder()));
   26|    300|  return true;
   27|    352|}

_ZN5Exiv28Internal18PanasonicMakerNote10tagListRawEv:
   29|  1.31k|  static constexpr auto tagListRaw() {
   30|  1.31k|    return tagInfoRaw_;
   31|  1.31k|  }
_ZN5Exiv28Internal18PanasonicMakerNote7tagListEv:
   25|  1.17k|  static constexpr auto tagList() {
   26|  1.17k|    return tagInfo_;
   27|  1.17k|  }

_ZN5Exiv28Internal15PentaxMakerNote7tagListEv:
   23|  70.2k|  static constexpr auto tagList() {
   24|  70.2k|    return tagInfo_;
   25|  70.2k|  }

_ZN5Exiv28PgfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   53|    453|    Image(ImageType::pgf, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params), bSwap_(isBigEndianPlatform()) {
   54|    453|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (54:7): [True: 0, False: 453]
  |  Branch (54:26): [True: 0, False: 0]
  ------------------
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |    std::cerr << "Exiv2::PgfImage:: Creating PGF image to memory\n";
   57|       |#endif
   58|      0|    IoCloser closer(*io_);
   59|      0|    if (io_->write(pgfBlank, sizeof(pgfBlank)) != sizeof(pgfBlank)) {
  ------------------
  |  Branch (59:9): [True: 0, False: 0]
  ------------------
   60|       |#ifdef EXIV2_DEBUG_MESSAGES
   61|       |      std::cerr << "Exiv2::PgfImage:: Failed to create PGF image on memory\n";
   62|       |#endif
   63|      0|    }
   64|      0|  }
   65|    453|}  // PgfImage::PgfImage
_ZN5Exiv28PgfImage12readMetadataEv:
   67|    453|void PgfImage::readMetadata() {
   68|       |#ifdef EXIV2_DEBUG_MESSAGES
   69|       |  std::cerr << "Exiv2::PgfImage::readMetadata: Reading PGF file " << io_->path() << "\n";
   70|       |#endif
   71|    453|  if (io_->open() != 0) {
  ------------------
  |  Branch (71:7): [True: 0, False: 453]
  ------------------
   72|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   73|      0|  }
   74|    453|  IoCloser closer(*io_);
   75|       |  // Ensure that this is the correct image type
   76|    453|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (76:7): [True: 0, False: 453]
  ------------------
   77|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (77:9): [True: 0, False: 0]
  |  Branch (77:25): [True: 0, False: 0]
  ------------------
   78|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   79|      0|    throw Error(ErrorCode::kerNotAnImage, "PGF");
   80|      0|  }
   81|    453|  clearMetadata();
   82|       |
   83|    453|  readPgfMagicNumber(*io_);
   84|       |
   85|    453|  size_t headerSize = readPgfHeaderSize(*io_);
   86|    453|  readPgfHeaderStructure(*io_, pixelWidth_, pixelHeight_);
   87|       |
   88|       |  // And now, the most interesting, the user data byte array where metadata are stored as small image.
   89|       |
   90|    453|  Internal::enforce(headerSize <= std::numeric_limits<size_t>::max() - 8, ErrorCode::kerCorruptedMetadata);
   91|    453|  size_t size = headerSize + 8 - io_->tell();
   92|       |
   93|       |#ifdef EXIV2_DEBUG_MESSAGES
   94|       |  std::cout << "Exiv2::PgfImage::readMetadata: Found Image data (" << size << " bytes)\n";
   95|       |#endif
   96|       |
   97|    453|  const size_t offset = io_->tell();
   98|    453|  assert(offset <= io_->size());
   99|    453|  if (size > io_->size() - offset)
  ------------------
  |  Branch (99:7): [True: 102, False: 351]
  ------------------
  100|    102|    throw Error(ErrorCode::kerInputDataReadFailed);
  101|    351|  if (size == 0)
  ------------------
  |  Branch (101:7): [True: 11, False: 340]
  ------------------
  102|     11|    return;
  103|       |
  104|    340|  const Exiv2::byte* base = io_->mmap();
  105|    340|  if (io_->error())
  ------------------
  |  Branch (105:7): [True: 0, False: 340]
  ------------------
  106|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  107|       |
  108|    340|  auto image = Exiv2::ImageFactory::open(base + offset, size);
  109|    340|  image->readMetadata();
  110|    340|  exifData() = image->exifData();
  111|    340|  iptcData() = image->iptcData();
  112|    340|  xmpData() = image->xmpData();
  113|    340|}
_ZN5Exiv28PgfImage18readPgfMagicNumberERNS_7BasicIoE:
  217|    453|byte PgfImage::readPgfMagicNumber(BasicIo& iIo) {
  218|    453|  auto b = static_cast<byte>(iIo.getb());
  219|    453|  if (iIo.error())
  ------------------
  |  Branch (219:7): [True: 0, False: 453]
  ------------------
  220|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  221|       |
  222|    453|  if (b < 0x36)  // 0x36 = '6'.
  ------------------
  |  Branch (222:7): [True: 176, False: 277]
  ------------------
  223|    176|  {
  224|       |    // Not right Magick version.
  225|       |#ifdef EXIV2_DEBUG_MESSAGES
  226|       |    std::cout << "Exiv2::PgfImage::readMetadata: wrong Magick number\n";
  227|       |#endif
  228|    176|  }
  229|       |
  230|    453|  return b;
  231|    453|}  // PgfImage::readPgfMagicNumber
_ZNK5Exiv28PgfImage17readPgfHeaderSizeERNS_7BasicIoE:
  233|    453|size_t PgfImage::readPgfHeaderSize(BasicIo& iIo) const {
  234|    453|  DataBuf buffer(4);
  235|    453|  const size_t bufRead = iIo.read(buffer.data(), buffer.size());
  236|    453|  if (iIo.error())
  ------------------
  |  Branch (236:7): [True: 0, False: 453]
  ------------------
  237|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  238|    453|  if (bufRead != buffer.size())
  ------------------
  |  Branch (238:7): [True: 0, False: 453]
  ------------------
  239|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  240|       |
  241|    453|  auto headerSize = static_cast<size_t>(byteSwap_(buffer, 0, bSwap_));
  242|    453|  if (headerSize == 0)
  ------------------
  |  Branch (242:7): [True: 10, False: 443]
  ------------------
  243|     10|    throw Error(ErrorCode::kerNoImageInInputData);
  244|       |
  245|       |#ifdef EXIV2_DEBUG_MESSAGES
  246|       |  std::cout << "Exiv2::PgfImage: PGF header size : " << headerSize << " bytes\n";
  247|       |#endif
  248|       |
  249|    443|  return headerSize;
  250|    453|}
_ZNK5Exiv28PgfImage22readPgfHeaderStructureERNS_7BasicIoERjS3_:
  252|    443|DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const {
  253|    443|  DataBuf header(16);
  254|    443|  size_t bufRead = iIo.read(header.data(), header.size());
  255|    443|  if (iIo.error())
  ------------------
  |  Branch (255:7): [True: 0, False: 443]
  ------------------
  256|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  257|    443|  if (bufRead != header.size())
  ------------------
  |  Branch (257:7): [True: 0, False: 443]
  ------------------
  258|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  259|       |
  260|    443|  DataBuf work(header.data(), 8);  // don't disturb the binary data - doWriteMetadata reuses it
  261|    443|  width = byteSwap_(work, 0, bSwap_);
  262|    443|  height = byteSwap_(work, 4, bSwap_);
  263|       |
  264|       |  /* NOTE: properties not yet used
  265|       |  byte nLevels  = buffer.pData_[8];
  266|       |  byte quality  = buffer.pData_[9];
  267|       |  byte bpp      = buffer.pData_[10];
  268|       |  byte channels = buffer.pData_[11];
  269|       |  */
  270|       |
  271|    443|  if (header.read_uint8(12) == 2)  // Indexed color image. We pass color table (256 * 3 bytes).
  ------------------
  |  Branch (271:7): [True: 17, False: 426]
  ------------------
  272|     17|  {
  273|     17|    header.alloc(16 + (256 * 3));
  274|       |
  275|     17|    bufRead = iIo.read(header.data(16), 256 * 3);
  276|     17|    if (iIo.error())
  ------------------
  |  Branch (276:9): [True: 0, False: 17]
  ------------------
  277|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  278|     17|    if (bufRead != 256 * 3)
  ------------------
  |  Branch (278:9): [True: 14, False: 3]
  ------------------
  279|     14|      throw Error(ErrorCode::kerInputDataReadFailed);
  280|     17|  }
  281|       |
  282|    429|  return header;
  283|    443|}  // PgfImage::readPgfHeaderStructure
_ZN5Exiv214newPgfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  287|    453|Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  288|    453|  auto image = std::make_unique<PgfImage>(std::move(io), params);
  289|    453|  if (!image->good()) {
  ------------------
  |  Branch (289:7): [True: 0, False: 453]
  ------------------
  290|      0|    return nullptr;
  291|      0|  }
  292|    453|  return image;
  293|    453|}
_ZN5Exiv29isPgfTypeERNS_7BasicIoEb:
  295|  22.5k|bool isPgfType(BasicIo& iIo, bool advance) {
  296|  22.5k|  const int32_t len = 3;
  297|  22.5k|  std::array<byte, len> buf;
  298|  22.5k|  iIo.read(buf.data(), len);
  299|  22.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (299:7): [True: 0, False: 22.5k]
  |  Branch (299:22): [True: 0, False: 22.5k]
  ------------------
  300|      0|    return false;
  301|      0|  }
  302|  22.5k|  bool rc = buf == pgfSignature;
  303|  22.5k|  if (!advance || !rc) {
  ------------------
  |  Branch (303:7): [True: 22.0k, False: 453]
  |  Branch (303:19): [True: 0, False: 453]
  ------------------
  304|  22.0k|    iIo.seek(-len, BasicIo::cur);
  305|  22.0k|  }
  306|       |
  307|  22.5k|  return rc;
  308|  22.5k|}
pgfimage.cpp:_ZN5Exiv2L9byteSwap_ERNS_7DataBufEmb:
   39|  1.33k|static uint32_t byteSwap_(Exiv2::DataBuf& buf, size_t offset, bool bSwap) {
   40|  1.33k|  uint32_t v = 0;
   41|  1.33k|  auto p = reinterpret_cast<byte*>(&v);
   42|  1.33k|  int i;
   43|  6.69k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (43:15): [True: 5.35k, False: 1.33k]
  ------------------
   44|  5.35k|    p[i] = buf.read_uint8(offset + i);
   45|  1.33k|  uint32_t result = Image::byteSwap(v, bSwap);
   46|  1.33k|  p = reinterpret_cast<byte*>(&result);
   47|  6.69k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (47:15): [True: 5.35k, False: 1.33k]
  ------------------
   48|  5.35k|    buf.write_uint8(offset + i, p[i]);
   49|  1.33k|  return result;
   50|  1.33k|}

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  35.9k|bool Photoshop::isIrb(const byte* pPsData) {
   28|  35.9k|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 35.9k]
  ------------------
   29|      0|    return false;
   30|       |
   31|  35.9k|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 111k, False: 18.5k]
  ------------------
   32|   111k|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 17.3k, False: 94.2k]
  ------------------
   33|  17.3k|      return true;
   34|       |
   35|  18.5k|  return false;
   36|  35.9k|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  18.9k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  18.9k|  const byte* record = nullptr;
   40|  18.9k|  uint32_t sizeIptc = 0;
   41|  18.9k|  uint32_t sizeHdr = 0;
   42|  18.9k|  const byte* pCur = pPsData;
   43|  18.9k|  const byte* pEnd = pPsData + sizePsData;
   44|  18.9k|  int ret = 0;
   45|  19.9k|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 19.9k, False: 10]
  |  Branch (45:25): [True: 962, False: 18.9k]
  ------------------
   46|    962|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|    962|  }
   48|  18.9k|  return ret >= 0;
   49|  18.9k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  20.5k|                         uint32_t& sizeData) {
   56|  20.5k|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 354, False: 20.2k]
  ------------------
   57|    354|    return 3;
   58|    354|  }
   59|       |
   60|       |  // Used for error checking
   61|  20.2k|  size_t position = 0;
   62|       |#ifdef EXIV2_DEBUG_MESSAGES
   63|       |  std::cerr << "Photoshop::locateIrb: ";
   64|       |#endif
   65|       |  // Data should follow Photoshop format, if not exit
   66|  34.4k|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 34.2k, False: 245]
  |  Branch (66:43): [True: 16.0k, False: 18.2k]
  ------------------
   67|  16.0k|    const byte* hrd = pPsData + position;
   68|  16.0k|    position += 4;
   69|  16.0k|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  16.0k|    position += 2;
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |    std::cerr << "0x" << std::hex << type << std::dec << " ";
   73|       |#endif
   74|       |    // Pascal string is padded to have an even size (including size byte)
   75|  16.0k|    byte psSize = pPsData[position] + 1;
   76|  16.0k|    psSize += (psSize & 1);
   77|  16.0k|    position += psSize;
   78|  16.0k|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 259, False: 15.7k]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|    259|      return -2;
   84|    259|    }
   85|  15.7k|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  15.7k|    position += 4;
   87|  15.7k|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 394, False: 15.3k]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|    394|      return -2;
   93|    394|    }
   94|       |#ifdef EXIV2_DEBUG_MESSAGES
   95|       |    if ((dataSize & 1) && position + dataSize == sizePsData) {
   96|       |      std::cerr << "Warning: "
   97|       |                << "Photoshop IRB data is not padded to even size\n";
   98|       |    }
   99|       |#endif
  100|  15.3k|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 1.08k, False: 14.2k]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  1.08k|      sizeData = dataSize;
  105|  1.08k|      sizeHdr = psSize + 10;
  106|  1.08k|      *record = hrd;
  107|  1.08k|      return 0;
  108|  1.08k|    }
  109|       |    // Data size is also padded to be even
  110|  14.2k|    position += dataSize + (dataSize & 1);
  111|  14.2k|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  18.4k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 18.4k, False: 28]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  18.4k|    return -2;
  121|  18.4k|  }
  122|     28|  return 3;
  123|  18.4k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  20.4k|                             uint32_t& sizeData) {
  127|  20.4k|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  20.4k|}
_ZN5Exiv29Photoshop16locatePreviewIrbEPKhmPS2_RjS4_:
  131|     66|                                uint32_t& sizeData) {
  132|     66|  return locateIrb(pPsData, sizePsData, preview_, record, sizeHdr, sizeData);
  133|     66|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|     94|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|     94|  *outWidth = data.read_uint32(0, bigEndian);
   48|     94|  *outHeight = data.read_uint32(4, bigEndian);
   49|     94|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeERKNS_12DecodeParamsE:
   51|  7.81k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type, const DecodeParams& dp) {
   52|  7.81k|  DataBuf key = keyTXTChunk(data);
   53|  7.81k|  DataBuf arr = parseTXTChunk(data, key.size(), type);
   54|       |
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |  std::cout << "Exiv2::PngChunk::decodeTXTChunk: TXT chunk data: " << std::string(arr.c_str(), arr.size()) << '\n';
   57|       |#endif
   58|  7.81k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 7.44k, False: 367]
  ------------------
   59|  7.44k|    parseChunkContent(pImage, key.c_data(), key.size(), arr, dp);
   60|  7.81k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  7.81k|DataBuf PngChunk::keyTXTChunk(const DataBuf& data, bool stripHeader) {
   72|       |  // From a tEXt, zTXt, or iTXt chunk, we get the keyword which is null terminated.
   73|  7.81k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 0, False: 7.81k]
  ------------------
   74|  7.81k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 11, False: 7.80k]
  ------------------
   75|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  7.80k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  7.80k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 12, False: 7.79k]
  ------------------
   79|     12|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  7.79k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  7.80k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.79k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.79k|  DataBuf arr;
   86|       |
   87|  7.79k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 182, False: 7.60k]
  ------------------
   88|    182|    enforce(data.size() >= Safe::add(keysize, nullSeparators), ErrorCode::kerCorruptedMetadata);
   89|       |
   90|       |    // Extract a deflate compressed Latin-1 text chunk
   91|       |
   92|       |    // we get the compression method after the key
   93|    182|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 14, False: 168]
  ------------------
   94|       |      // then it isn't zlib compressed and we are sunk
   95|       |#ifdef EXIV2_DEBUG_MESSAGES
   96|       |      std::cerr << "Exiv2::PngChunk::parseTXTChunk: Non-standard zTXt compression method.\n";
   97|       |#endif
   98|     14|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     14|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    168|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    168|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 83, False: 85]
  ------------------
  104|     83|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     83|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     83|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     83|    }
  109|  7.60k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 2.75k, False: 4.85k]
  ------------------
  110|  2.75k|    enforce(data.size() >= Safe::add(keysize, std::size_t{1}), ErrorCode::kerCorruptedMetadata);
  111|       |    // Extract a non-compressed Latin-1 text chunk
  112|       |
  113|       |    // the text comes after the key, but isn't null terminated
  114|  2.75k|    size_t textsize = data.size() - keysize - 1;
  115|  2.75k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 2.58k, False: 177]
  ------------------
  116|  2.58k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  2.58k|      arr = DataBuf(text, textsize);
  119|  2.58k|    }
  120|  4.85k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 4.85k, False: 0]
  ------------------
  121|  4.85k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  4.85k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  4.85k|    enforce(nullCount >= nullSeparators, ErrorCode::kerCorruptedMetadata);
  124|       |
  125|       |    // Extract a deflate compressed or uncompressed UTF-8 text chunk
  126|       |
  127|       |    // we get the compression flag after the key
  128|  4.85k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  4.85k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  4.85k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 4.73k, False: 120]
  |  Branch (132:40): [True: 96, False: 24]
  ------------------
  133|  4.85k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 96, False: 4.75k]
  ------------------
  134|     96|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  4.85k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  4.85k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  4.85k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  4.85k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  4.85k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  4.85k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  4.85k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  4.85k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  4.85k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  4.85k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  4.85k|    const auto textsize =
  152|  4.85k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  4.85k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 4.77k, False: 75]
  ------------------
  154|  4.77k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  4.77k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 4.69k, False: 85]
  ------------------
  157|       |        // then it's an uncompressed iTXt chunk
  158|       |#ifdef EXIV2_DEBUG_MESSAGES
  159|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
  160|       |#endif
  161|  4.69k|        arr = DataBuf(text, textsize);
  162|  4.69k|      } else {
  163|       |        // then it's a zlib compressed iTXt chunk
  164|       |#ifdef EXIV2_DEBUG_MESSAGES
  165|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found a zlib compressed iTXt field\n";
  166|       |#endif
  167|       |
  168|       |        // the compressed text comes after the translated keyword, but isn't null terminated
  169|     85|        zlibUncompress(text, textsize, arr);
  170|     85|      }
  171|  4.77k|    }
  172|  4.85k|  } else {
  173|       |#ifdef DEBUG
  174|       |    std::cerr << "Exiv2::PngChunk::parseTXTChunk: We found a field, not expected though\n";
  175|       |#endif
  176|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  177|      0|  }
  178|       |
  179|  7.77k|  return arr;
  180|  7.79k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufERKNS_12DecodeParamsE:
  183|  7.44k|                                 const DecodeParams& dp) {
  184|       |  // We look if an ImageMagick EXIF raw profile exist.
  185|       |
  186|  7.44k|  if (keySize >= 21 &&
  ------------------
  |  Branch (186:7): [True: 4.73k, False: 2.70k]
  ------------------
  187|  4.73k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (187:8): [True: 27, False: 4.71k]
  |  Branch (187:57): [True: 1.86k, False: 2.84k]
  ------------------
  188|  1.89k|      pImage->exifData().empty()) {
  ------------------
  |  Branch (188:7): [True: 1.82k, False: 70]
  ------------------
  189|  1.82k|    DataBuf exifData = readRawProfile(arr, false);
  190|  1.82k|    size_t length = exifData.size();
  191|       |
  192|  1.82k|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (192:9): [True: 56, False: 1.77k]
  ------------------
  193|       |      // Find the position of TIFF header in bytes array.
  194|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  195|     56|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  196|     56|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  197|     56|      size_t pos = std::numeric_limits<size_t>::max();
  198|       |
  199|       |      /// \todo Find substring inside an string
  200|    470|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (200:26): [True: 414, False: 56]
  ------------------
  201|    414|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (201:13): [True: 0, False: 414]
  ------------------
  202|    414|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (202:13): [True: 0, False: 414]
  ------------------
  203|      0|          pos = i;
  204|      0|          break;
  205|      0|        }
  206|    414|      }
  207|       |
  208|       |      // If found it, store only these data at from this place.
  209|       |
  210|     56|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (210:11): [True: 0, False: 56]
  ------------------
  211|       |#ifdef EXIV2_DEBUG_MESSAGES
  212|       |        std::cout << "Exiv2::PngChunk::parseChunkContent: TIFF header found at position " << pos << "\n";
  213|       |#endif
  214|      0|        ByteOrder bo = TiffParser::decode(pImage->exifData(), pImage->iptcData(), pImage->xmpData(),
  215|      0|                                          exifData.c_data(pos), length - pos, dp);
  216|      0|        pImage->setByteOrder(bo);
  217|     56|      } else {
  218|     56|#ifndef SUPPRESS_WARNINGS
  219|     56|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|     56|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 56]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     56|  LogMsg(LogMsg::warn).os()
  ------------------
  220|     56|#endif
  221|     56|        pImage->exifData().clear();
  222|     56|      }
  223|     56|    }
  224|  1.82k|  }
  225|       |
  226|       |  // We look if an ImageMagick IPTC raw profile exist.
  227|       |
  228|  7.44k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (228:7): [True: 4.72k, False: 2.71k]
  |  Branch (228:24): [True: 178, False: 4.55k]
  |  Branch (228:73): [True: 168, False: 10]
  ------------------
  229|    168|    DataBuf psData = readRawProfile(arr, false);
  230|    168|    if (!psData.empty()) {
  ------------------
  |  Branch (230:9): [True: 134, False: 34]
  ------------------
  231|    134|      Blob iptcBlob;
  232|    134|      const byte* record = nullptr;
  233|    134|      uint32_t sizeIptc = 0;
  234|    134|      uint32_t sizeHdr = 0;
  235|       |
  236|    134|      const byte* pEnd = psData.c_data(psData.size() - 1);
  237|    134|      const byte* pCur = psData.c_data();
  238|    134|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (238:14): [True: 115, False: 19]
  |  Branch (238:29): [True: 0, False: 115]
  ------------------
  239|      0|        if (sizeIptc) {
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|       |#ifdef EXIV2_DEBUG_MESSAGES
  241|       |          std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  242|       |#endif
  243|      0|          append(iptcBlob, record + sizeHdr, sizeIptc);
  244|      0|        }
  245|      0|        pCur = record + sizeHdr + sizeIptc;
  246|      0|        pCur += (sizeIptc & 1);
  247|      0|      }
  248|    134|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (248:11): [True: 0, False: 134]
  |  Branch (248:32): [True: 0, False: 0]
  ------------------
  249|      0|#ifndef SUPPRESS_WARNINGS
  250|      0|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  251|      0|#endif
  252|      0|        pImage->clearIptcData();
  253|      0|      }
  254|       |      // If there is no IRB, try to decode the complete chunk data
  255|    134|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (255:11): [True: 134, False: 0]
  |  Branch (255:31): [True: 28, False: 106]
  ------------------
  256|     28|#ifndef SUPPRESS_WARNINGS
  257|     28|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     28|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 28]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     28|  LogMsg(LogMsg::warn).os()
  ------------------
  258|     28|#endif
  259|     28|        pImage->clearIptcData();
  260|     28|      }
  261|    134|    }  // if (psData.size() > 0)
  262|    168|  }
  263|       |
  264|       |  // We look if an ImageMagick XMP raw profile exist.
  265|       |
  266|  7.44k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (266:7): [True: 5.35k, False: 2.09k]
  |  Branch (266:24): [True: 2.69k, False: 2.66k]
  |  Branch (266:72): [True: 2.69k, False: 0]
  ------------------
  267|  2.69k|    DataBuf xmpBuf = readRawProfile(arr, false);
  268|  2.69k|    size_t length = xmpBuf.size();
  269|       |
  270|  2.69k|    if (length > 0) {
  ------------------
  |  Branch (270:9): [True: 2.34k, False: 354]
  ------------------
  271|  2.34k|      std::string& xmpPacket = pImage->xmpPacket();
  272|  2.34k|      xmpPacket.assign(xmpBuf.c_str(), length);
  273|  2.34k|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (273:52): [True: 562, False: 1.78k]
  |  Branch (273:80): [True: 43, False: 519]
  ------------------
  274|     43|#ifndef SUPPRESS_WARNINGS
  275|     43|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     43|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 43]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     43|  LogMsg(LogMsg::warn).os()
  ------------------
  276|     43|#endif
  277|     43|        xmpPacket = xmpPacket.substr(idx);
  278|     43|      }
  279|  2.34k|      if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (279:11): [True: 2.34k, False: 0]
  ------------------
  280|  2.34k|#ifndef SUPPRESS_WARNINGS
  281|  2.34k|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  2.34k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.34k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.34k|  LogMsg(LogMsg::warn).os()
  ------------------
  282|  2.34k|#endif
  283|  2.34k|      }
  284|  2.34k|    }
  285|  2.69k|  }
  286|       |
  287|       |  // We look if an Adobe XMP string exist.
  288|       |
  289|  7.44k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (289:7): [True: 6.62k, False: 820]
  |  Branch (289:24): [True: 1.53k, False: 5.09k]
  |  Branch (289:69): [True: 1.53k, False: 0]
  |  Branch (289:98): [True: 1.52k, False: 10]
  ------------------
  290|  1.52k|    std::string& xmpPacket = pImage->xmpPacket();
  291|  1.52k|    xmpPacket.assign(arr.c_str(), arr.size());
  292|  1.52k|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (292:50): [True: 1.29k, False: 228]
  |  Branch (292:78): [True: 588, False: 706]
  ------------------
  293|    588|#ifndef SUPPRESS_WARNINGS
  294|    588|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    588|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 588]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    588|  LogMsg(LogMsg::warn).os()
  ------------------
  295|      0|                  << "from the beginning of the XMP packet\n";
  296|    588|#endif
  297|    588|      xmpPacket = xmpPacket.substr(idx);
  298|    588|    }
  299|  1.52k|    if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (299:9): [True: 378, False: 1.14k]
  ------------------
  300|    378|#ifndef SUPPRESS_WARNINGS
  301|    378|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    378|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 378]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    378|  LogMsg(LogMsg::warn).os()
  ------------------
  302|    378|#endif
  303|    378|    }
  304|  1.52k|  }
  305|       |
  306|       |  // We look if a comments string exist. Note than we use only 'Description' keyword which
  307|       |  // is dedicated to store long comments. 'Comment' keyword is ignored.
  308|       |
  309|  7.44k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (309:7): [True: 6.77k, False: 671]
  |  Branch (309:7): [True: 71, False: 7.37k]
  |  Branch (309:24): [True: 261, False: 6.51k]
  |  Branch (309:63): [True: 71, False: 190]
  ------------------
  310|     71|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  311|     71|  }
  312|       |
  313|  7.44k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  336|    168|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  337|    168|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  338|    168|  int zlibResult = Z_BUF_ERROR;
  339|    168|  int dos = 0;
  340|       |
  341|    443|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (341:10): [True: 359, False: 84]
  ------------------
  342|    359|    arr.alloc(uncompressedLen);
  343|    359|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  344|    359|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (344:9): [True: 84, False: 275]
  ------------------
  345|     84|      arr.resize(uncompressedLen);
  346|    275|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (346:16): [True: 201, False: 74]
  ------------------
  347|       |      // the uncompressedArray needs to be larger
  348|    201|      uncompressedLen *= 2;
  349|       |      // DoS protection. can't be bigger than 64k
  350|    201|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (350:11): [True: 29, False: 172]
  ------------------
  351|     29|        if (++dos > 1)
  ------------------
  |  Branch (351:13): [True: 10, False: 19]
  ------------------
  352|     10|          break;
  353|     19|        uncompressedLen = 131072;
  354|     19|      }
  355|    201|    } else {
  356|       |      // something bad happened
  357|     74|      throw Error(ErrorCode::kerFailedToReadImageData);
  358|     74|    }
  359|    359|  }
  360|       |
  361|     94|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (361:7): [True: 10, False: 84]
  ------------------
  362|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  363|     10|  }
  364|     94|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  470|  4.69k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  471|  4.69k|  DataBuf info;
  472|  4.69k|  if (text.size() <= 1) {
  ------------------
  |  Branch (472:7): [True: 53, False: 4.63k]
  ------------------
  473|     53|    return info;
  474|     53|  }
  475|       |
  476|  4.63k|  const unsigned char unhex[103] = {
  477|  4.63k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  478|  4.63k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  479|  4.63k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15,
  480|  4.63k|  };
  481|       |
  482|  4.63k|  if (iTXt) {
  ------------------
  |  Branch (482:7): [True: 0, False: 4.63k]
  ------------------
  483|      0|    info.alloc(text.size());
  484|      0|    std::copy(text.begin(), text.end(), info.begin());
  485|      0|    return info;
  486|      0|  }
  487|       |
  488|  4.63k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  489|  4.63k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  490|       |
  491|  4.63k|  if (sp >= eot) {
  ------------------
  |  Branch (491:7): [True: 53, False: 4.58k]
  ------------------
  492|     53|    return info;
  493|     53|  }
  494|       |
  495|       |  // Look for newline
  496|  54.3k|  while (*sp != '\n') {
  ------------------
  |  Branch (496:10): [True: 49.8k, False: 4.53k]
  ------------------
  497|  49.8k|    sp++;
  498|  49.8k|    if (sp == eot) {
  ------------------
  |  Branch (498:9): [True: 51, False: 49.7k]
  ------------------
  499|     51|      return info;
  500|     51|    }
  501|  49.8k|  }
  502|  4.53k|  sp++;  // step over '\n'
  503|  4.53k|  if (sp == eot) {
  ------------------
  |  Branch (503:7): [True: 18, False: 4.51k]
  ------------------
  504|     18|    return info;
  505|     18|  }
  506|       |
  507|       |  // Look for length
  508|  84.9k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (508:10): [True: 4.82k, False: 80.1k]
  |  Branch (508:25): [True: 63.4k, False: 16.7k]
  |  Branch (508:39): [True: 12.2k, False: 4.49k]
  ------------------
  509|  80.4k|    sp++;
  510|  80.4k|    if (sp == eot) {
  ------------------
  |  Branch (510:9): [True: 24, False: 80.4k]
  ------------------
  511|     24|      return info;
  512|     24|    }
  513|  80.4k|  }
  514|       |
  515|       |  // Parse the length.
  516|  4.49k|  size_t length = 0;
  517|  8.54k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (517:10): [True: 5.08k, False: 3.46k]
  |  Branch (517:24): [True: 4.15k, False: 934]
  ------------------
  518|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  519|  4.15k|    const size_t newlength = (10 * length) + (*sp - '0');
  520|  4.15k|    length = newlength;
  521|  4.15k|    sp++;
  522|  4.15k|    if (sp == eot) {
  ------------------
  |  Branch (522:9): [True: 98, False: 4.05k]
  ------------------
  523|     98|      return info;
  524|     98|    }
  525|  4.15k|  }
  526|  4.39k|  sp++;  // step over '\n'
  527|  4.39k|  if (sp == eot) {
  ------------------
  |  Branch (527:7): [True: 427, False: 3.96k]
  ------------------
  528|    427|    return info;
  529|    427|  }
  530|       |
  531|  3.96k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  532|       |
  533|       |  // Allocate space
  534|  3.96k|  if (length == 0) {
  ------------------
  |  Branch (534:7): [True: 895, False: 3.07k]
  ------------------
  535|       |#ifdef EXIV2_DEBUG_MESSAGES
  536|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  537|       |#endif
  538|    895|  }
  539|  3.96k|  info.alloc(length);
  540|  3.96k|  if (info.size() != length) {
  ------------------
  |  Branch (540:7): [True: 0, False: 3.96k]
  ------------------
  541|       |#ifdef EXIV2_DEBUG_MESSAGES
  542|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: cannot allocate memory\n";
  543|       |#endif
  544|      0|    return info;
  545|      0|  }
  546|       |
  547|  3.96k|  if (info.empty())  // Early return
  ------------------
  |  Branch (547:7): [True: 895, False: 3.07k]
  ------------------
  548|    895|    return info;
  549|       |
  550|       |  // Copy profile, skipping white space and column 1 "=" signs
  551|  3.07k|  unsigned char* dp = info.data();  // decode pointer
  552|  3.07k|  size_t nibbles = length * 2;
  553|       |
  554|  35.9k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (554:22): [True: 33.3k, False: 2.62k]
  ------------------
  555|  33.3k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  556|  44.5k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (556:12): [True: 3.90k, False: 40.6k]
  |  Branch (556:26): [True: 14.9k, False: 25.6k]
  |  Branch (556:39): [True: 2.53k, False: 12.3k]
  |  Branch (556:53): [True: 5.20k, False: 32.8k]
  ------------------
  557|  11.6k|      if (*sp == '\0') {
  ------------------
  |  Branch (557:11): [True: 445, False: 11.1k]
  ------------------
  558|       |#ifdef EXIV2_DEBUG_MESSAGES
  559|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  560|       |#endif
  561|    445|        return {};
  562|    445|      }
  563|       |
  564|  11.1k|      sp++;
  565|  11.1k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  566|  11.1k|    }
  567|       |
  568|  32.9k|    if (i % 2 == 0)
  ------------------
  |  Branch (568:9): [True: 16.4k, False: 16.4k]
  ------------------
  569|  16.4k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  570|  16.4k|    else
  571|  16.4k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  572|  32.9k|  }
  573|       |
  574|  2.62k|  return info;
  575|       |
  576|  3.07k|}  // PngChunk::readRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  1.18k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  1.18k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.18k]
  |  Branch (57:26): [True: 0, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|      0|    IoCloser closer(*io_);
   62|      0|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 0]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|      0|  }
   68|  1.18k|}
_ZNK5Exiv28PngImage8mimeTypeEv:
   70|      6|std::string PngImage::mimeType() const {
   71|      6|  return "image/png";
   72|      6|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.18k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.18k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.18k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.18k|  IoCloser closer(*io_);
  400|  1.18k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.18k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.18k|  clearMetadata();
  404|       |
  405|  1.18k|  const size_t imgSize = io_->size();
  406|  1.18k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|  1.18k|  const DecodeParams dp(max_recursion_depth_);
  408|       |
  409|  25.8k|  while (!io_->eof()) {
  ------------------
  |  Branch (409:10): [True: 25.4k, False: 434]
  ------------------
  410|  25.4k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  411|       |
  412|       |    // Decode chunk data length.
  413|  25.4k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  414|  25.4k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (414:9): [True: 346, False: 25.0k]
  ------------------
  415|    346|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  416|    346|    }
  417|       |
  418|  25.0k|    std::string chunkType(cheaderBuf.c_str(4), 4);
  419|       |#ifdef EXIV2_DEBUG_MESSAGES
  420|       |    std::cout << "Exiv2::PngImage::readMetadata: chunk type: " << chunkType << " length: " << chunkLength << '\n';
  421|       |#endif
  422|       |
  423|       |    /// \todo analyse remaining chunks of the standard
  424|       |    // Perform a chunk triage for item that we need.
  425|  25.0k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (425:9): [True: 99, False: 24.9k]
  |  Branch (425:32): [True: 177, False: 24.8k]
  |  Branch (425:55): [True: 2.75k, False: 22.0k]
  |  Branch (425:78): [True: 185, False: 21.8k]
  ------------------
  426|  21.8k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (426:9): [True: 74, False: 21.8k]
  |  Branch (426:32): [True: 4.87k, False: 16.9k]
  |  Branch (426:55): [True: 1.52k, False: 15.4k]
  ------------------
  427|  9.59k|      DataBuf chunkData(chunkLength);
  428|  9.59k|      if (chunkLength > 0) {
  ------------------
  |  Branch (428:11): [True: 9.45k, False: 146]
  ------------------
  429|  9.45k|        readChunk(chunkData, *io_);  // Extract chunk data.
  430|  9.45k|      }
  431|       |
  432|  9.59k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (432:11): [True: 11, False: 9.58k]
  ------------------
  433|     11|        return;  // Last chunk found: we stop parsing.
  434|     11|      }
  435|  9.58k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (435:11): [True: 177, False: 9.41k]
  |  Branch (435:34): [True: 94, False: 83]
  ------------------
  436|     94|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  437|  9.49k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (437:18): [True: 2.75k, False: 6.73k]
  ------------------
  438|  2.75k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk, dp);
  439|  6.73k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (439:18): [True: 185, False: 6.54k]
  ------------------
  440|    185|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk, dp);
  441|  6.54k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (441:18): [True: 4.87k, False: 1.67k]
  ------------------
  442|  4.87k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk, dp);
  443|  4.87k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (443:18): [True: 74, False: 1.60k]
  ------------------
  444|     74|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size(), dp);
  445|     74|        setByteOrder(bo);
  446|  1.60k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (446:18): [True: 1.52k, False: 83]
  ------------------
  447|       |        // The ICC profile name can vary from 1-79 characters.
  448|  1.52k|        uint32_t iccOffset = 0;
  449|  10.9k|        do {
  450|  10.9k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (450:19): [True: 10.9k, False: 7]
  |  Branch (450:37): [True: 10.9k, False: 12]
  ------------------
  451|  10.9k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (451:18): [True: 9.46k, False: 1.52k]
  ------------------
  452|       |
  453|  1.52k|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  454|  1.52k|        ++iccOffset;  // +1 = 'compressed' flag
  455|  1.52k|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  456|       |
  457|  1.52k|        zlibToDataBuf(chunkData.c_data(iccOffset), static_cast<uLongf>(chunkLength - iccOffset), iccProfile_);
  458|       |#ifdef EXIV2_DEBUG_MESSAGES
  459|       |        std::cout << "Exiv2::PngImage::readMetadata: profile name: " << profileName_ << '\n';
  460|       |        std::cout << "Exiv2::PngImage::readMetadata: iccProfile.size_ (uncompressed) : " << iccProfile_.size() << '\n';
  461|       |#endif
  462|  1.52k|      }
  463|       |
  464|       |      // Set chunkLength to 0 in case we have read a supported chunk type. Otherwise, we need to seek the
  465|       |      // file to the next chunk position.
  466|  9.58k|      chunkLength = 0;
  467|  9.58k|    }
  468|       |
  469|       |    // Move to the next chunk: chunk data size + 4 CRC bytes.
  470|       |#ifdef EXIV2_DEBUG_MESSAGES
  471|       |    std::cout << "Exiv2::PngImage::readMetadata: Seek to offset: " << chunkLength + 4 << '\n';
  472|       |#endif
  473|  25.0k|    io_->seek(chunkLength + 4, BasicIo::cur);
  474|  25.0k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (474:9): [True: 434, False: 24.6k]
  |  Branch (474:25): [True: 397, False: 24.2k]
  ------------------
  475|    397|      throw Error(ErrorCode::kerFailedToReadImageData);
  476|    397|    }
  477|  25.0k|  }
  478|  1.18k|}  // PngImage::readMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  685|  1.18k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  686|  1.18k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  687|  1.18k|  if (!image->good()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 1.18k]
  ------------------
  688|      0|    return nullptr;
  689|      0|  }
  690|  1.18k|  return image;
  691|  1.18k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  693|  25.4k|bool isPngType(BasicIo& iIo, bool advance) {
  694|  25.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (694:7): [True: 0, False: 25.4k]
  |  Branch (694:22): [True: 221, False: 25.2k]
  ------------------
  695|    221|    throw Error(ErrorCode::kerInputDataReadFailed);
  696|    221|  }
  697|  25.2k|  const int32_t len = 8;
  698|  25.2k|  std::array<byte, len> buf;
  699|  25.2k|  iIo.read(buf.data(), len);
  700|  25.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (700:7): [True: 0, False: 25.2k]
  |  Branch (700:22): [True: 0, False: 25.2k]
  ------------------
  701|      0|    return false;
  702|      0|  }
  703|  25.2k|  bool rc = buf == pngSignature;
  704|  25.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (704:7): [True: 24.0k, False: 1.18k]
  |  Branch (704:19): [True: 0, False: 1.18k]
  ------------------
  705|  24.0k|    iIo.seek(-len, BasicIo::cur);
  706|  24.0k|  }
  707|       |
  708|  25.2k|  return rc;
  709|  25.2k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|  1.48k|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|  1.48k|  uLongf uncompressedLen = length;  // just a starting point
   76|  1.48k|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  3.62k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 2.14k, False: 1.48k]
  ------------------
   79|  2.14k|    result.alloc(uncompressedLen);
   80|  2.14k|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|  2.14k|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 4, False: 2.13k]
  |  Branch (82:31): [True: 4, False: 0]
  ------------------
   83|      4|      result.reset();
   84|       |
   85|      4|      result.alloc(uncompressedLen);
   86|      4|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|      4|    }
   88|  2.14k|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 655, False: 1.48k]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    655|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    655|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 655]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    655|      else
   96|    655|        uncompressedLen *= 2;
   97|    655|    }
   98|  2.14k|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|  1.48k|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  34.8k|static void readChunk(DataBuf& buffer, BasicIo& io) {
  380|       |#ifdef EXIV2_DEBUG_MESSAGES
  381|       |  std::cout << "Exiv2::PngImage::readMetadata: Position: " << io.tell() << '\n';
  382|       |#endif
  383|  34.8k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  34.8k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 34.8k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  34.8k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 88, False: 34.8k]
  ------------------
  388|     88|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     88|  }
  390|  34.8k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|     39|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|     39|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|     39|const byte* PreviewImage::pData() const {
 1018|     39|  return preview_.c_data();
 1019|     39|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|     39|uint32_t PreviewImage::size() const {
 1022|     39|  return static_cast<uint32_t>(preview_.size());
 1023|     39|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  17.3k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  17.3k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  17.3k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  17.3k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   602k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 584k, False: 17.3k]
  ------------------
 1052|   584k|    auto loader = Loader::create(id, image_);
 1053|   584k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 15.9k, False: 568k]
  |  Branch (1053:19): [True: 9.89k, False: 6.07k]
  ------------------
 1054|  9.89k|      PreviewProperties props = loader->getProperties();
 1055|  9.89k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  9.89k|      props.size_ = buf.size();         //     update the size
 1057|  9.89k|      list.push_back(std::move(props));
 1058|  9.89k|    }
 1059|   584k|  }
 1060|  17.3k|  std::sort(list.begin(), list.end(),
 1061|  17.3k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  17.3k|  return list;
 1064|  17.3k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|     39|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|     39|  auto loader = Loader::create(properties.id_, image_);
 1068|     39|  DataBuf buf;
 1069|     39|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 39, False: 0]
  ------------------
 1070|     39|    buf = loader->getData();
 1071|     39|  }
 1072|       |
 1073|     39|  return {properties, std::move(buf)};
 1074|     39|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|  1.18M|PreviewId Loader::getNumLoaders() {
  351|  1.18M|  return PreviewId{std::size(loaderList_)};
  352|  1.18M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  69.1k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  69.1k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  69.1k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  69.1k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  69.1k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 69.1k]
  |  Branch (355:21): [True: 66.8k, False: 2.32k]
  ------------------
  356|  66.8k|    return;
  357|  2.32k|  nativePreview_ = image.nativePreviews()[parIdx];
  358|  2.32k|  width_ = nativePreview_.width_;
  359|  2.32k|  height_ = nativePreview_.height_;
  360|  2.32k|  valid_ = true;
  361|  2.32k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (361:7): [True: 2.14k, False: 180]
  ------------------
  362|  2.14k|    size_ = nativePreview_.size_;
  363|  2.14k|  } else {
  364|    180|    size_ = getData().size();
  365|    180|  }
  366|  2.32k|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  343|   533k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   533k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  9.89k|PreviewProperties Loader::getProperties() const {
  347|  9.89k|  return {"", "", size_, width_, height_, id_};
  348|  9.89k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  4.25k|  virtual bool readDimensions() {
   78|  4.25k|    return true;
   79|  4.25k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   533k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   551k|  [[nodiscard]] virtual bool valid() const {
   67|   551k|    return valid_;
   68|   551k|  }
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative13getPropertiesEv:
  372|  2.17k|PreviewProperties LoaderNative::getProperties() const {
  373|  2.17k|  PreviewProperties prop = Loader::getProperties();
  374|  2.17k|  prop.mimeType_ = nativePreview_.mimeType_;
  375|  2.17k|  if (nativePreview_.mimeType_ == "image/jpeg") {
  ------------------
  |  Branch (375:7): [True: 1.83k, False: 336]
  ------------------
  376|  1.83k|    prop.extension_ = ".jpg";
  377|  1.83k|  } else if (nativePreview_.mimeType_ == "image/tiff") {
  ------------------
  |  Branch (377:14): [True: 1, False: 335]
  ------------------
  378|      1|    prop.extension_ = ".tif";
  379|    335|  } else if (nativePreview_.mimeType_ == "image/x-wmf") {
  ------------------
  |  Branch (379:14): [True: 2, False: 333]
  ------------------
  380|      2|    prop.extension_ = ".wmf";
  381|    333|  } else if (nativePreview_.mimeType_ == "image/x-portable-anymap") {
  ------------------
  |  Branch (381:14): [True: 106, False: 227]
  ------------------
  382|    106|    prop.extension_ = ".pnm";
  383|    227|  } else {
  384|    227|#ifndef SUPPRESS_WARNINGS
  385|    227|    EXV_WARNING << "Unknown native preview format: " << nativePreview_.mimeType_ << "\n";
  ------------------
  |  |  138|    227|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 227]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    227|  LogMsg(LogMsg::warn).os()
  ------------------
  386|    227|#endif
  387|    227|    prop.extension_ = ".dat";
  388|    227|  }
  389|  2.17k|  return prop;
  390|  2.17k|}
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative7getDataEv:
  392|  3.05k|DataBuf LoaderNative::getData() const {
  393|  3.05k|  if (!valid())
  ------------------
  |  Branch (393:7): [True: 0, False: 3.05k]
  ------------------
  394|      0|    return {};
  395|       |
  396|  3.05k|  BasicIo& io = image_.io();
  397|  3.05k|  if (io.open() != 0) {
  ------------------
  |  Branch (397:7): [True: 0, False: 3.05k]
  ------------------
  398|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  399|      0|  }
  400|  3.05k|  IoCloser closer(io);
  401|  3.05k|  const byte* data = io.mmap();
  402|  3.05k|  if (io.size() < Safe::add(nativePreview_.position_, nativePreview_.size_)) {
  ------------------
  |  Branch (402:7): [True: 713, False: 2.33k]
  ------------------
  403|    713|#ifndef SUPPRESS_WARNINGS
  404|    713|    EXV_WARNING << "Invalid native preview position or size.\n";
  ------------------
  |  |  138|    713|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 713]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    713|  LogMsg(LogMsg::warn).os()
  ------------------
  405|    713|#endif
  406|    713|    return {};
  407|    713|  }
  408|  2.33k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (408:7): [True: 2.02k, False: 319]
  ------------------
  409|  2.02k|    return {data + nativePreview_.position_, nativePreview_.size_};
  410|  2.02k|  }
  411|    319|  if (nativePreview_.filter_ == "hex-ai7thumbnail-pnm") {
  ------------------
  |  Branch (411:7): [True: 253, False: 66]
  ------------------
  412|    253|    size_t expectedSize = 0;
  413|    253|    if (!ai7ThumbnailSize(width_, height_, expectedSize)) {
  ------------------
  |  Branch (413:9): [True: 182, False: 71]
  ------------------
  414|    182|#ifndef SUPPRESS_WARNINGS
  415|    182|      EXV_WARNING << "Unsupported size of AI7 thumbnail: " << width_ << "x" << height_ << "\n";
  ------------------
  |  |  138|    182|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 182]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    182|  LogMsg(LogMsg::warn).os()
  ------------------
  416|    182|#endif
  417|    182|      return {};
  418|    182|    }
  419|     71|    const DataBuf ai7thumbnail = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  420|     71|    const DataBuf rgb = decodeAi7Thumbnail(ai7thumbnail, expectedSize);
  421|     71|    return makePnm(width_, height_, rgb);
  422|    253|  }
  423|     66|  if (nativePreview_.filter_ == "hex-irb") {
  ------------------
  |  Branch (423:7): [True: 66, False: 0]
  ------------------
  424|     66|    const DataBuf psData = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  425|     66|    const byte* record;
  426|     66|    uint32_t sizeHdr = 0;
  427|     66|    uint32_t sizeData = 0;
  428|     66|    if (Photoshop::locatePreviewIrb(psData.c_data(), psData.size(), &record, sizeHdr, sizeData) != 0) {
  ------------------
  |  Branch (428:9): [True: 66, False: 0]
  ------------------
  429|     66|#ifndef SUPPRESS_WARNINGS
  430|     66|      EXV_WARNING << "Missing preview IRB in Photoshop EPS preview.\n";
  ------------------
  |  |  138|     66|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 66]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     66|  LogMsg(LogMsg::warn).os()
  ------------------
  431|     66|#endif
  432|     66|      return {};
  433|     66|    }
  434|      0|    Internal::enforce(sizeData >= 28, ErrorCode::kerCorruptedMetadata);
  435|      0|    return {record + sizeHdr + 28, sizeData - 28};
  436|     66|  }
  437|      0|  throw Error(ErrorCode::kerErrorMessage, "Invalid native preview filter: ", nativePreview_.filter_);
  438|     66|}
preview.cpp:_ZN12_GLOBAL__N_116ai7ThumbnailSizeEmmRm:
  828|    253|bool ai7ThumbnailSize(size_t width, size_t height, size_t& rgbSize) {
  829|    253|  rgbSize = 0;
  830|    253|  if (width == 0 || height == 0)
  ------------------
  |  Branch (830:7): [True: 34, False: 219]
  |  Branch (830:21): [True: 2, False: 217]
  ------------------
  831|     36|    return false;
  832|       |
  833|    217|  constexpr size_t bytesPerPixel = 3;
  834|       |
  835|    217|  if (width > std::numeric_limits<size_t>::max() / height)
  ------------------
  |  Branch (835:7): [True: 96, False: 121]
  ------------------
  836|     96|    return false;
  837|       |
  838|    121|  const size_t pixels = width * height;
  839|    121|  if (pixels > std::numeric_limits<size_t>::max() / bytesPerPixel)
  ------------------
  |  Branch (839:7): [True: 12, False: 109]
  ------------------
  840|     12|    return false;
  841|       |
  842|    109|  rgbSize = pixels * bytesPerPixel;
  843|    109|  return rgbSize <= maxAi7ThumbnailSize;
  844|    121|}
preview.cpp:_ZN12_GLOBAL__N_19decodeHexEPKhm:
  846|    137|DataBuf decodeHex(const byte* src, size_t srcSize) {
  847|       |  // create decoding table
  848|    137|  byte invalid = 16;
  849|    137|  std::array<byte, 256> decodeHexTable;
  850|    137|  decodeHexTable.fill(invalid);
  851|  1.50k|  for (byte i = 0; i < 10; i++)
  ------------------
  |  Branch (851:20): [True: 1.37k, False: 137]
  ------------------
  852|  1.37k|    decodeHexTable[static_cast<byte>('0') + i] = i;
  853|    959|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (853:20): [True: 822, False: 137]
  ------------------
  854|    822|    decodeHexTable[static_cast<byte>('A') + i] = i + 10;
  855|    959|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (855:20): [True: 822, False: 137]
  ------------------
  856|    822|    decodeHexTable[static_cast<byte>('a') + i] = i + 10;
  857|       |
  858|       |  // calculate dest size
  859|    137|  long validSrcSize = 0;
  860|  4.86M|  for (size_t srcPos = 0; srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (860:27): [True: 4.86M, False: 137]
  ------------------
  861|  4.86M|    if (decodeHexTable[src[srcPos]] != invalid)
  ------------------
  |  Branch (861:9): [True: 4.51M, False: 345k]
  ------------------
  862|  4.51M|      validSrcSize++;
  863|  4.86M|  }
  864|    137|  const size_t destSize = validSrcSize / 2;
  865|       |
  866|       |  // allocate dest buffer
  867|    137|  DataBuf dest(destSize);
  868|       |
  869|       |  // decode
  870|  2.25M|  for (size_t srcPos = 0, destPos = 0; destPos < destSize; destPos++) {
  ------------------
  |  Branch (870:40): [True: 2.25M, False: 137]
  ------------------
  871|  2.25M|    byte buffer = 0;
  872|  7.12M|    for (int bufferPos = 1; bufferPos >= 0 && srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (872:29): [True: 4.86M, False: 2.25M]
  |  Branch (872:47): [True: 4.86M, False: 0]
  ------------------
  873|  4.86M|      byte srcValue = decodeHexTable[src[srcPos]];
  874|  4.86M|      if (srcValue == invalid)
  ------------------
  |  Branch (874:11): [True: 344k, False: 4.51M]
  ------------------
  875|   344k|        continue;
  876|  4.51M|      buffer |= srcValue << (bufferPos * 4);
  877|  4.51M|      bufferPos--;
  878|  4.51M|    }
  879|  2.25M|    dest.write_uint8(destPos, buffer);
  880|  2.25M|  }
  881|    137|  return dest;
  882|    137|}
preview.cpp:_ZN12_GLOBAL__N_118decodeAi7ThumbnailERKN5Exiv27DataBufEm:
  921|     71|DataBuf decodeAi7Thumbnail(const DataBuf& src, size_t expectedSize) {
  922|     71|  const byte* colorTable = src.c_data();
  923|     71|  const size_t colorTableSize = 256 * 3;
  924|     71|  if (src.size() < colorTableSize) {
  ------------------
  |  Branch (924:7): [True: 26, False: 45]
  ------------------
  925|     26|#ifndef SUPPRESS_WARNINGS
  926|     26|    EXV_WARNING << "Invalid size of AI7 thumbnail: " << src.size() << "\n";
  ------------------
  |  |  138|     26|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 26]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     26|  LogMsg(LogMsg::warn).os()
  ------------------
  927|     26|#endif
  928|     26|    return {};
  929|     26|  }
  930|     45|  const byte* imageData = src.c_data(colorTableSize);
  931|     45|  const size_t imageDataSize = src.size() - colorTableSize;
  932|     45|  const bool rle = (imageDataSize >= 3 && imageData[0] == 'R' && imageData[1] == 'L' && imageData[2] == 'E');
  ------------------
  |  Branch (932:21): [True: 37, False: 8]
  |  Branch (932:43): [True: 3, False: 34]
  |  Branch (932:66): [True: 0, False: 3]
  |  Branch (932:89): [True: 0, False: 0]
  ------------------
  933|     45|  DataBuf dest(expectedSize);
  934|     45|  auto destData = dest.data();
  935|     45|  size_t destPos = 0;
  936|  33.1k|  for (size_t i = rle ? 3 : 0; i < imageDataSize;) {
  ------------------
  |  Branch (936:19): [True: 0, False: 45]
  |  Branch (936:32): [True: 33.0k, False: 45]
  ------------------
  937|  33.0k|    byte num = 1;
  938|  33.0k|    byte value = imageData[i++];
  939|  33.0k|    if (rle && value == 0xFD) {
  ------------------
  |  Branch (939:9): [True: 0, False: 33.0k]
  |  Branch (939:16): [True: 0, False: 0]
  ------------------
  940|      0|      if (i >= imageDataSize) {
  ------------------
  |  Branch (940:11): [True: 0, False: 0]
  ------------------
  941|      0|#ifndef SUPPRESS_WARNINGS
  942|      0|        EXV_WARNING << "Unexpected end of image data at AI7 thumbnail.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  943|      0|#endif
  944|      0|        return {};
  945|      0|      }
  946|      0|      value = imageData[i++];
  947|      0|      if (value != 0xFD) {
  ------------------
  |  Branch (947:11): [True: 0, False: 0]
  ------------------
  948|      0|        if (i >= imageDataSize) {
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|      0|#ifndef SUPPRESS_WARNINGS
  950|      0|          EXV_WARNING << "Unexpected end of image data at AI7 thumbnail.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  951|      0|#endif
  952|      0|          return {};
  953|      0|        }
  954|      0|        num = value;
  955|      0|        value = imageData[i++];
  956|      0|      }
  957|      0|    }
  958|  33.0k|    Internal::enforce(expectedSize - destPos >= static_cast<size_t>(num) * 3, ErrorCode::kerCorruptedMetadata);
  959|  33.0k|    const auto c0 = colorTable[value * 3];
  960|  33.0k|    const auto c1 = colorTable[value * 3 + 1];
  961|  33.0k|    const auto c2 = colorTable[value * 3 + 2];
  962|  66.1k|    for (; num > 0; num--) {
  ------------------
  |  Branch (962:12): [True: 33.0k, False: 33.0k]
  ------------------
  963|  33.0k|      destData[destPos++] = c0;
  964|  33.0k|      destData[destPos++] = c1;
  965|  33.0k|      destData[destPos++] = c2;
  966|  33.0k|    }
  967|  33.0k|  }
  968|     45|  Internal::enforce(destPos == expectedSize, ErrorCode::kerCorruptedMetadata);
  969|     45|  return dest;
  970|     45|}
preview.cpp:_ZN12_GLOBAL__N_17makePnmEmmRKN5Exiv27DataBufE:
  972|     30|DataBuf makePnm(size_t width, size_t height, const DataBuf& rgb) {
  973|       |  // This was already checked in decodeAi7Thumbnail().
  974|     30|  assert(width * height * 3UL == rgb.size());
  975|       |
  976|     30|  const std::string header = "P6\n" + std::to_string(width) + " " + std::to_string(height) + "\n255\n";
  977|       |
  978|     30|  DataBuf dest(header.size() + rgb.size());
  979|     30|  std::copy(header.begin(), header.end(), dest.begin());
  980|     30|  std::copy(rgb.begin(), rgb.end(), dest.begin() + header.size());
  981|     30|  return dest;
  982|     30|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNative14readDimensionsEv:
  440|  2.28k|bool LoaderNative::readDimensions() {
  441|  2.28k|  if (!valid())
  ------------------
  |  Branch (441:7): [True: 0, False: 2.28k]
  ------------------
  442|      0|    return false;
  443|  2.28k|  if (width_ != 0 || height_ != 0)
  ------------------
  |  Branch (443:7): [True: 1.28k, False: 1.00k]
  |  Branch (443:22): [True: 301, False: 702]
  ------------------
  444|  1.58k|    return true;
  445|       |
  446|    702|  const DataBuf data = getData();
  447|    702|  if (data.empty())
  ------------------
  |  Branch (447:7): [True: 55, False: 647]
  ------------------
  448|     55|    return false;
  449|       |
  450|    647|  try {
  451|    647|    auto image = ImageFactory::open(data.c_data(), data.size());
  452|    647|    if (!image)
  ------------------
  |  Branch (452:9): [True: 0, False: 647]
  ------------------
  453|      0|      return false;
  454|    647|    image->readMetadata();
  455|       |
  456|    647|    width_ = image->pixelWidth();
  457|    647|    height_ = image->pixelHeight();
  458|    647|  } catch (const Error& /* error */) {
  459|     57|#ifndef SUPPRESS_WARNINGS
  460|     57|    EXV_WARNING << "Invalid native preview image.\n";
  ------------------
  |  |  138|     57|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 57]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     57|  LogMsg(LogMsg::warn).os()
  ------------------
  461|     57|#endif
  462|     57|    return false;
  463|     57|  }
  464|    584|  return true;
  465|    647|}
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|   190k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|   190k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|   190k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|   190k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|   190k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 679, False: 189k]
  ------------------
  557|    679|    size_ = pos->sizeDataArea();  // indirect data
  558|    679|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 592, False: 87]
  |  Branch (558:23): [True: 123, False: 469]
  ------------------
  559|    123|      size_ = pos->size();  // direct data
  560|    679|  }
  561|       |
  562|   190k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 190k, False: 200]
  ------------------
  563|   190k|    return;
  564|       |
  565|    200|  valid_ = true;
  566|    200|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|     49|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|     49|  PreviewProperties prop = Loader::getProperties();
  574|     49|  prop.mimeType_ = "image/jpeg";
  575|     49|  prop.extension_ = ".jpg";
  576|     49|  return prop;
  577|     49|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|    249|DataBuf LoaderExifDataJpeg::getData() const {
  580|    249|  DataBuf buf;
  581|       |
  582|    249|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 249]
  ------------------
  583|      0|    return buf;
  584|       |
  585|    249|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 249, False: 0]
  ------------------
  586|    249|    buf = pos->dataArea();  // indirect data
  587|       |
  588|    249|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 155, False: 94]
  ------------------
  589|    155|      buf = DataBuf(pos->size());
  590|    155|      pos->copy(buf.data(), invalidByteOrder);
  591|    155|    }
  592|       |
  593|    249|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|    249|    return buf;
  595|    249|  }
  596|       |
  597|      0|  return buf;
  598|    249|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  600|    161|bool LoaderExifDataJpeg::readDimensions() {
  601|    161|  if (!valid())
  ------------------
  |  Branch (601:7): [True: 0, False: 161]
  ------------------
  602|      0|    return false;
  603|       |
  604|    161|  DataBuf buf = getData();
  605|    161|  if (buf.empty())
  ------------------
  |  Branch (605:7): [True: 0, False: 161]
  ------------------
  606|      0|    return false;
  607|       |
  608|    161|  try {
  609|    161|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  610|    161|    if (!image)
  ------------------
  |  Branch (610:9): [True: 0, False: 161]
  ------------------
  611|      0|      return false;
  612|    161|    image->readMetadata();
  613|       |
  614|    161|    width_ = image->pixelWidth();
  615|    161|    height_ = image->pixelHeight();
  616|    161|  } catch (const Error& /* error */) {
  617|    112|    return false;
  618|    112|  }
  619|       |
  620|     49|  return true;
  621|    161|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|   120k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|   120k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|   120k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|   120k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|   120k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|   120k|  size_t offsetCount = 0;
  628|   120k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|   120k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 103k, False: 17.2k]
  ------------------
  632|   103k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|   103k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 98.4k, False: 4.85k]
  ------------------
  634|  98.4k|      return;
  635|  4.85k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 4.85k, False: 0]
  |  Branch (635:9): [True: 769, False: 4.08k]
  |  Branch (635:39): [True: 769, False: 4.08k]
  ------------------
  636|    769|      return;
  637|  4.85k|  }
  638|       |
  639|  21.2k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  21.2k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 4.48k, False: 16.8k]
  ------------------
  641|  4.48k|    offsetTag_ = "StripOffsets";
  642|  4.48k|    sizeTag_ = "StripByteCounts";
  643|  4.48k|    offsetCount = pos->value().count();
  644|  16.8k|  } else {
  645|  16.8k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  16.8k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 16.5k, False: 276]
  ------------------
  647|  16.5k|      return;
  648|    276|    offsetTag_ = "TileOffsets";
  649|    276|    sizeTag_ = "TileByteCounts";
  650|    276|    offsetCount = pos->value().count();
  651|    276|  }
  652|       |
  653|  4.75k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  4.75k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 142, False: 4.61k]
  ------------------
  655|    142|    return;
  656|  4.61k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 38, False: 4.57k]
  ------------------
  657|     38|    return;
  658|  42.6k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 38.0k, False: 4.57k]
  ------------------
  659|  38.0k|    size_ += pos->toUint32(i);
  660|  38.0k|  }
  661|       |
  662|  4.57k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 44, False: 4.53k]
  ------------------
  663|     44|    return;
  664|       |
  665|  4.53k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  4.53k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 4.38k, False: 150]
  |  Branch (666:7): [True: 4.33k, False: 195]
  |  Branch (666:32): [True: 4.33k, False: 45]
  ------------------
  667|  4.33k|    width_ = pos->toUint32();
  668|  4.33k|  }
  669|       |
  670|  4.53k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  4.53k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 4.41k, False: 118]
  |  Branch (671:7): [True: 4.34k, False: 194]
  |  Branch (671:32): [True: 4.34k, False: 76]
  ------------------
  672|  4.34k|    height_ = pos->toUint32();
  673|  4.34k|  }
  674|       |
  675|  4.53k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 217, False: 4.31k]
  |  Branch (675:22): [True: 65, False: 4.25k]
  ------------------
  676|    226|    return;
  677|       |
  678|  4.30k|  valid_ = true;
  679|  4.30k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  4.25k|PreviewProperties LoaderTiff::getProperties() const {
  686|  4.25k|  PreviewProperties prop = Loader::getProperties();
  687|  4.25k|  prop.mimeType_ = "image/tiff";
  688|  4.25k|  prop.extension_ = ".tif";
  689|  4.25k|  return prop;
  690|  4.25k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  4.25k|DataBuf LoaderTiff::getData() const {
  693|  4.25k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  4.25k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   717k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 717k, False: 4.25k]
  ------------------
  699|   717k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 223k, False: 494k]
  ------------------
  700|       |      /*
  701|       |         Write only the necessary TIFF image tags
  702|       |         tags that especially could cause problems are:
  703|       |         "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
  704|       |         "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
  705|       |                         consistent result for all previews, including JPEG
  706|       |      */
  707|   223k|      uint16_t tag = pos.tag();
  708|   223k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 218k, False: 4.23k]
  |  Branch (708:28): [True: 218k, False: 478]
  |  Branch (708:45): [True: 143k, False: 74.8k]
  ------------------
  709|   143k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|   143k|      }
  711|   223k|    }
  712|   717k|  }
  713|       |
  714|  4.25k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  4.25k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 4.01k, False: 237]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  4.01k|    BasicIo& io = image_.io();
  719|       |
  720|  4.01k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 4.01k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  4.01k|    IoCloser closer(io);
  724|       |
  725|  4.01k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  4.01k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  4.01k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 4.01k, False: 0]
  ------------------
  730|  4.01k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 3.78k, False: 229]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  3.78k|        uint32_t offset = dataValue.toUint32(0);
  733|  3.78k|        uint32_t size = sizes.toUint32(0);
  734|  3.78k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 2.41k, False: 1.37k]
  ------------------
  735|  2.41k|          dataValue.setDataArea(base + offset, size);
  736|  3.78k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    229|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    229|        DataBuf buf(size_);
  740|    229|        uint32_t idxBuf = 0;
  741|  10.3k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 10.1k, False: 229]
  ------------------
  742|  10.1k|          uint32_t offset = dataValue.toUint32(i);
  743|  10.1k|          uint32_t size = sizes.toUint32(i);
  744|       |
  745|       |          // the size_ parameter is originally computed by summing all values inside sizes
  746|       |          // see the constructor of LoaderTiff
  747|       |          // But e.g in malicious files some of these values could be negative
  748|       |          // That's why we check again for each step here to really make sure we don't overstep
  749|  10.1k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  10.1k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 3.12k, False: 7.03k]
  |  Branch (750:28): [True: 2.16k, False: 964]
  ------------------
  751|  2.16k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|  2.16k|          }
  753|       |
  754|  10.1k|          idxBuf += size;
  755|  10.1k|        }
  756|    229|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    229|      }
  758|  4.01k|    }
  759|  4.01k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  4.25k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 2, False: 4.25k]
  |  Branch (762:7): [True: 2, False: 4.25k]
  |  Branch (762:40): [True: 2, False: 0]
  ------------------
  763|      2|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  764|      2|  }
  765|       |
  766|       |  // write new image
  767|  4.25k|  MemIo mio;
  768|  4.25k|  IptcData emptyIptc;
  769|  4.25k|  XmpData emptyXmp;
  770|  4.25k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  4.25k|  return {mio.mmap(), mio.size()};
  772|  4.25k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|   136k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|   136k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|   136k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|   136k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|   136k|  const ExifData& exifData = image_.exifData();
  469|   136k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|   136k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 10.6k, False: 125k]
  |  Branch (470:7): [True: 9.53k, False: 127k]
  |  Branch (470:32): [True: 9.53k, False: 1.10k]
  ------------------
  471|  9.53k|    offset_ = pos->toUint32();
  472|  9.53k|  }
  473|       |
  474|   136k|  size_ = 0;
  475|   136k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|   136k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 11.6k, False: 124k]
  |  Branch (476:7): [True: 9.63k, False: 126k]
  |  Branch (476:32): [True: 9.63k, False: 2.03k]
  ------------------
  477|  9.63k|    size_ = pos->toUint32();
  478|  9.63k|  }
  479|       |
  480|   136k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 127k, False: 9.37k]
  |  Branch (480:23): [True: 162, False: 9.21k]
  ------------------
  481|   127k|    return;
  482|       |
  483|  9.24k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 3, False: 9.24k]
  ------------------
  484|      3|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  485|      3|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (485:9): [True: 3, False: 0]
  |  Branch (485:9): [True: 3, False: 0]
  |  Branch (485:34): [True: 3, False: 0]
  ------------------
  486|      3|      offset_ += pos->toUint32();
  487|      3|    }
  488|      3|  }
  489|       |
  490|  9.24k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 118, False: 9.12k]
  ------------------
  491|    118|    return;
  492|       |
  493|  9.12k|  valid_ = true;
  494|  9.12k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  3.25k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  3.25k|  PreviewProperties prop = Loader::getProperties();
  502|  3.25k|  prop.mimeType_ = "image/jpeg";
  503|  3.25k|  prop.extension_ = ".jpg";
  504|  3.25k|  return prop;
  505|  3.25k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  3.25k|DataBuf LoaderExifJpeg::getData() const {
  508|  3.25k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 3.25k]
  ------------------
  509|      0|    return {};
  510|  3.25k|  BasicIo& io = image_.io();
  511|       |
  512|  3.25k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 3.25k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  3.25k|  IoCloser closer(io);
  516|       |
  517|  3.25k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  3.25k|  return {base + offset_, size_};
  520|  3.25k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  9.09k|bool LoaderExifJpeg::readDimensions() {
  523|  9.09k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 9.09k]
  ------------------
  524|      0|    return false;
  525|  9.09k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 9.09k]
  |  Branch (525:17): [True: 0, False: 9.09k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  9.09k|  BasicIo& io = image_.io();
  529|       |
  530|  9.09k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 9.09k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  9.09k|  IoCloser closer(io);
  534|  9.09k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  9.09k|  try {
  537|  9.09k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  9.09k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 9.09k]
  ------------------
  539|      0|      return false;
  540|  9.09k|    image->readMetadata();
  541|       |
  542|  9.09k|    width_ = image->pixelWidth();
  543|  9.09k|    height_ = image->pixelHeight();
  544|  9.09k|  } catch (const Error& /* error */) {
  545|  5.83k|#ifndef SUPPRESS_WARNINGS
  546|  5.83k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  5.83k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.83k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.83k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  5.83k|#endif
  548|  5.83k|    return false;
  549|  5.83k|  }
  550|       |
  551|  3.25k|  return true;
  552|  9.09k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  17.0k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  17.0k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  17.0k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  17.0k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  17.0k|  (void)parIdx;
  776|       |
  777|  17.0k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  17.0k|  std::string prefix = "xmpGImg";
  780|  17.0k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 193, False: 16.8k]
  ------------------
  781|    193|    prefix = "xapGImg";
  782|    193|  }
  783|       |
  784|  17.0k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  17.0k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 16.8k, False: 193]
  ------------------
  786|  16.8k|    return;
  787|    193|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  788|    193|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (788:7): [True: 10, False: 183]
  ------------------
  789|     10|    return;
  790|    183|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  791|    183|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (791:7): [True: 6, False: 177]
  ------------------
  792|      6|    return;
  793|    177|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  794|    177|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (794:7): [True: 2, False: 175]
  ------------------
  795|      2|    return;
  796|       |
  797|    175|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (797:7): [True: 5, False: 170]
  ------------------
  798|      5|    return;
  799|       |
  800|    170|  width_ = widthDatum->toUint32();
  801|    170|  height_ = heightDatum->toUint32();
  802|    170|  preview_ = decodeBase64(imageDatum->toString());
  803|    170|  size_ = preview_.size();
  804|    170|  valid_ = true;
  805|    170|}
preview.cpp:_ZN12_GLOBAL__N_112decodeBase64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  886|    168|DataBuf decodeBase64(const std::string& src) {
  887|    168|  DataBuf dest;
  888|       |  // create decoding table
  889|    168|  unsigned long invalid = 64;
  890|    168|  auto decodeBase64Table = std::vector<unsigned long>(256, invalid);
  891|  10.9k|  for (unsigned long i = 0; i < 64; i++)
  ------------------
  |  Branch (891:29): [True: 10.7k, False: 168]
  ------------------
  892|  10.7k|    decodeBase64Table[static_cast<unsigned char>(encodeBase64Table[i])] = i;
  893|       |
  894|       |  // calculate dest size
  895|    168|  auto validSrcSize = static_cast<unsigned long>(
  896|    168|      std::count_if(src.begin(), src.end(), [&](unsigned char c) { return decodeBase64Table.at(c) != invalid; }));
  897|    168|  if (validSrcSize > ULONG_MAX / 3)
  ------------------
  |  Branch (897:7): [True: 0, False: 168]
  ------------------
  898|      0|    return dest;  // avoid integer overflow
  899|    168|  const unsigned long destSize = (validSrcSize * 3) / 4;
  900|       |
  901|       |  // allocate dest buffer
  902|    168|  dest = DataBuf(destSize);
  903|       |
  904|       |  // decode
  905|   411k|  for (unsigned long srcPos = 0, destPos = 0; destPos < destSize;) {
  ------------------
  |  Branch (905:47): [True: 410k, False: 168]
  ------------------
  906|   410k|    unsigned long buffer = 0;
  907|  2.06M|    for (int bufferPos = 3; bufferPos >= 0 && srcPos < src.size(); srcPos++) {
  ------------------
  |  Branch (907:29): [True: 1.65M, False: 410k]
  |  Branch (907:47): [True: 1.65M, False: 70]
  ------------------
  908|  1.65M|      unsigned long srcValue = decodeBase64Table[static_cast<unsigned char>(src[srcPos])];
  909|  1.65M|      if (srcValue == invalid)
  ------------------
  |  Branch (909:11): [True: 8.22k, False: 1.64M]
  ------------------
  910|  8.22k|        continue;
  911|  1.64M|      buffer |= srcValue << (bufferPos * 6);
  912|  1.64M|      bufferPos--;
  913|  1.64M|    }
  914|  1.64M|    for (int bufferPos = 2; bufferPos >= 0 && destPos < destSize; bufferPos--, destPos++) {
  ------------------
  |  Branch (914:29): [True: 1.23M, False: 410k]
  |  Branch (914:47): [True: 1.23M, False: 70]
  ------------------
  915|  1.23M|      dest.write_uint8(destPos, static_cast<byte>((buffer >> (bufferPos * 8))));
  916|  1.23M|    }
  917|   410k|  }
  918|    168|  return dest;
  919|    168|}
preview.cpp:_ZZN12_GLOBAL__N_112decodeBase64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_0clEh:
  896|  1.65M|      std::count_if(src.begin(), src.end(), [&](unsigned char c) { return decodeBase64Table.at(c) != invalid; }));
preview.cpp:_ZNK12_GLOBAL__N_113LoaderXmpJpeg13getPropertiesEv:
  811|    168|PreviewProperties LoaderXmpJpeg::getProperties() const {
  812|    168|  PreviewProperties prop = Loader::getProperties();
  813|    168|  prop.mimeType_ = "image/jpeg";
  814|    168|  prop.extension_ = ".jpg";
  815|    168|  return prop;
  816|    168|}
preview.cpp:_ZNK12_GLOBAL__N_113LoaderXmpJpeg7getDataEv:
  818|    168|DataBuf LoaderXmpJpeg::getData() const {
  819|    168|  if (!valid())
  ------------------
  |  Branch (819:7): [True: 0, False: 168]
  ------------------
  820|      0|    return {};
  821|    168|  return {preview_.c_data(), preview_.size()};
  822|    168|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpeg14readDimensionsEv:
  824|    168|bool LoaderXmpJpeg::readDimensions() {
  825|    168|  return valid();
  826|    168|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  328|   584k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   584k|  Loader::UniquePtr loader;
  330|   584k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 584k]
  |  Branch (330:17): [True: 0, False: 584k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   584k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 51.4k, False: 533k]
  |  Branch (333:7): [True: 51.2k, False: 533k]
  |  Branch (333:41): [True: 51.2k, False: 263]
  ------------------
  334|  51.2k|    return loader;
  335|       |
  336|   533k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   533k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 517k, False: 16.1k]
  ------------------
  338|   517k|    loader = nullptr;
  339|       |
  340|   533k|  return loader;
  341|   584k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  8.13k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  1.98M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  1.98M|  return ns_ == ns.ns_;
 4941|  1.98M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  53.1M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  53.1M|  return prefix_ == prefix.prefix_;
 4945|  53.1M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  1.68M|std::mutex& XmpProperties::getMutex() {
 4953|  1.68M|  static std::mutex m;
 4954|  1.68M|  return m;
 4955|  1.68M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  1.83M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  30.6M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 30.6M, False: 1.73M]
  ------------------
 4965|  30.6M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 101k, False: 30.5M]
  ------------------
 4966|   101k|      return &p;
 4967|  30.6M|  }
 4968|  1.73M|  return nullptr;
 4969|  1.83M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     26|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     26|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 26]
  ------------------
 4978|      0|    return;
 4979|     26|  std::string ns2 = ns;
 4980|     26|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 15, False: 11]
  |  Branch (4980:28): [True: 10, False: 5]
  ------------------
 4981|     10|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     26|  auto it = nsRegistry_.find(ns2);
 4985|     26|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 26]
  |  Branch (4985:7): [True: 0, False: 26]
  |  Branch (4985:34): [True: 0, False: 0]
  ------------------
 4986|      0|    return;  // Already registered with this prefix
 4987|      0|  }
 4988|       |
 4989|       |  // 2. Check if this prefix is already registered with a DIFFERENT URI
 4990|     26|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 26]
  ------------------
 4991|      0|#ifndef SUPPRESS_WARNINGS
 4992|      0|    if (ns2 != xnp->ns_)
  ------------------
  |  Branch (4992:9): [True: 0, False: 0]
  ------------------
 4993|      0|      EXV_WARNING << "Updating namespace URI for " << prefix << " from " << xnp->ns_ << " to " << ns2 << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 4994|      0|#endif
 4995|      0|    unregisterNsUnlocked(xnp->ns_, lock);
 4996|      0|  }
 4997|       |
 4998|       |  // 3. Ensure the URI is unregistered if it's currently used with a different prefix
 4999|       |  // (This handles the case where prefix changed for the same URI, preventing memory leak)
 5000|     26|  unregisterNsUnlocked(ns2, lock);
 5001|       |  // Allocated memory is freed when the namespace is unregistered.
 5002|       |  // Using malloc/free for better system compatibility in case
 5003|       |  // users don't unregister their namespaces explicitly.
 5004|     26|  XmpNsInfo xn;
 5005|     26|  auto c = new char[ns2.size() + 1];
 5006|     26|  std::strcpy(c, ns2.c_str());
 5007|     26|  xn.ns_ = c;
 5008|     26|  c = new char[prefix.size() + 1];
 5009|     26|  std::strcpy(c, prefix.c_str());
 5010|     26|  xn.prefix_ = c;
 5011|     26|  xn.xmpPropertyInfo_ = nullptr;
 5012|     26|  xn.desc_ = "";
 5013|     26|  nsRegistry_[ns2] = xn;
 5014|     26|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     26|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     26|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     26|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     52|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     52|  auto i = nsRegistry_.find(ns);
 5027|     52|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 26, False: 26]
  ------------------
 5028|     26|    delete[] i->second.prefix_;
 5029|     26|    delete[] i->second.ns_;
 5030|     26|    nsRegistry_.erase(i);
 5031|     26|  }
 5032|     52|}
_ZN5Exiv213XmpProperties21unregisterAllNsNoLockENS0_11LifetimeKeyE:
 5042|      1|void XmpProperties::unregisterAllNsNoLock(LifetimeKey) {
 5043|       |  /// \todo check if we are not unregistering the first NS
 5044|      1|  auto i = nsRegistry_.begin();
 5045|     27|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 26, False: 1]
  ------------------
 5046|     26|    auto kill = i++;
 5047|     26|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     26|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   143k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   143k|  std::string ns2 = ns;
 5058|   143k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 22.3k, False: 120k]
  |  Branch (5058:28): [True: 16.4k, False: 5.93k]
  ------------------
 5059|  16.4k|    ns2 += '/';
 5060|       |
 5061|   143k|  auto i = nsRegistry_.find(ns2);
 5062|   143k|  std::string p;
 5063|   143k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 90.9k, False: 52.2k]
  ------------------
 5064|  90.9k|    p = i->second.prefix_;
 5065|  52.2k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 11.9k, False: 40.3k]
  ------------------
 5066|  11.9k|    p = std::string(xn->prefix_);
 5067|   143k|  return p;
 5068|   143k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|   938k|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|   938k|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 96.0k, False: 842k]
  ------------------
 5077|  96.0k|    return xn->ns_;
 5078|   842k|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|   938k|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  9.04k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  9.04k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  9.04k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 5.12k, False: 3.91k]
  |  Branch (5083:59): [True: 3.89k, False: 26]
  ------------------
 5084|  9.04k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  46.2k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  46.2k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  46.2k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 44.8k, False: 1.47k]
  ------------------
 5114|  46.2k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  46.2k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  46.2k|  std::string prefix = key.groupName();
 5123|  46.2k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  46.2k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 46.2k]
  ------------------
 5126|      0|    i = std::distance(property.begin(), std::find_if(property.begin() + i, property.end(), isalpha));
 5127|      0|    property = property.substr(i);
 5128|      0|    i = property.find_first_of(':');
 5129|      0|    if (i != std::string::npos) {
  ------------------
  |  Branch (5129:9): [True: 0, False: 0]
  ------------------
 5130|      0|      prefix = property.substr(0, i);
 5131|      0|      property = property.substr(i + 1);
 5132|      0|    }
 5133|       |#ifdef EXIV2_DEBUG_MESSAGES
 5134|       |    std::cout << "Nested key: " << key.key() << ", prefix: " << prefix << ", property: " << property << "\n";
 5135|       |#endif
 5136|      0|  }
 5137|  46.2k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 46.2k, False: 0]
  ------------------
 5138|  6.22M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 6.22M, False: 1.47k]
  ------------------
 5139|  6.22M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 44.8k, False: 6.18M]
  ------------------
 5140|  44.8k|        return pl + j;
 5141|  44.8k|      }
 5142|  6.22M|    }
 5143|  46.2k|  }
 5144|  1.47k|  return nullptr;
 5145|  46.2k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  46.2k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  46.2k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  46.2k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|   888k|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|   888k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|   888k|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|   888k|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 888k, False: 0]
  ------------------
 5175|   888k|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|   888k|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 0, False: 888k]
  ------------------
 5177|      0|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|   888k|  return xn;
 5179|   888k|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   129k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   129k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 129k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   129k|  property_ = property;
 5256|   129k|  prefix_ = prefix;
 5257|   129k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   286k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   286k|  p_->decomposeKey(key);
 5261|   286k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   521k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   521k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   521k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   129k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   129k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.35M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   413k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   413k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   413k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   413k|  return UniquePtr(clone_());
 5288|   413k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   413k|XmpKey* XmpKey::clone_() const {
 5291|   413k|  return new XmpKey(*this);
 5292|   413k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  17.5M|std::string XmpKey::key() const {
 5295|  17.5M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  17.5M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|  46.2k|std::string XmpKey::groupName() const {
 5303|  46.2k|  return p_->prefix_;
 5304|  46.2k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|  46.2k|std::string XmpKey::tagName() const {
 5307|  46.2k|  return p_->property_;
 5308|  46.2k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5336|   286k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5337|   286k|  XmpProperties::XmpLock lock;
 5338|   286k|  decomposeKeyUnlocked(key, lock);
 5339|   286k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5341|   808k|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5342|       |  // Get the family name, prefix and property name parts of the key
 5343|   808k|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5343:7): [True: 264, False: 808k]
  ------------------
 5344|    264|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|   808k|  std::string::size_type pos1 = key.find('.');
 5346|   808k|  std::string::size_type pos0 = pos1 + 1;
 5347|   808k|  pos1 = key.find('.', pos0);
 5348|   808k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5348:7): [True: 0, False: 808k]
  ------------------
 5349|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5350|   808k|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5351|   808k|  if (prefix.empty())
  ------------------
  |  Branch (5351:7): [True: 0, False: 808k]
  ------------------
 5352|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5353|   808k|  std::string property = key.substr(pos1 + 1);
 5354|   808k|  if (property.empty())
  ------------------
  |  Branch (5354:7): [True: 0, False: 808k]
  ------------------
 5355|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5356|       |
 5357|       |  // Validate prefix unlocked (must hold lock)
 5358|   808k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5358:7): [True: 0, False: 808k]
  ------------------
 5359|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5360|       |
 5361|   808k|  property_ = std::move(property);
 5362|   808k|  prefix_ = std::move(prefix);
 5363|   808k|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|   808k|  Impl() = default;                                                                             //!< Default constructor

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  103|    729|    Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io), params) {
  104|    729|}  // PsdImage::PsdImage
_ZNK5Exiv28PsdImage8mimeTypeEv:
  106|    651|std::string PsdImage::mimeType() const {
  107|    651|  return "image/x-photoshop";
  108|    651|}
_ZN5Exiv28PsdImage12readMetadataEv:
  115|    719|void PsdImage::readMetadata() {
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  118|       |#endif
  119|    719|  if (io_->open() != 0) {
  ------------------
  |  Branch (119:7): [True: 0, False: 719]
  ------------------
  120|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  121|      0|  }
  122|    719|  IoCloser closer(*io_);
  123|       |  // Ensure that this is the correct image type
  124|    719|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (124:7): [True: 0, False: 719]
  ------------------
  125|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (125:9): [True: 0, False: 0]
  |  Branch (125:25): [True: 0, False: 0]
  ------------------
  126|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  127|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  128|      0|  }
  129|    719|  clearMetadata();
  130|       |
  131|       |  /*
  132|       |    The Photoshop header goes as follows -- all numbers are in big-endian byte order:
  133|       |
  134|       |    offset  length   name       description
  135|       |    ======  =======  =========  =========
  136|       |     0      4 bytes  signature  always '8BPS'
  137|       |     4      2 bytes  version    always equal to 1
  138|       |     6      6 bytes  reserved   must be zero
  139|       |    12      2 bytes  channels   number of channels in the image, including alpha channels (1 to 24)
  140|       |    14      4 bytes  rows       the height of the image in pixels
  141|       |    18      4 bytes  columns    the width of the image in pixels
  142|       |    22      2 bytes  depth      the number of bits per channel
  143|       |    24      2 bytes  mode       the color mode of the file; Supported values are: Bitmap=0; Grayscale=1;
  144|       |    Indexed=2; RGB=3; CMYK=4; Multichannel=7; Duotone=8; Lab=9
  145|       |  */
  146|    719|  byte buf[26];
  147|    719|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (147:7): [True: 0, False: 719]
  ------------------
  148|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  149|      0|  }
  150|    719|  pixelWidth_ = getLong(buf + 18, bigEndian);
  151|    719|  pixelHeight_ = getLong(buf + 14, bigEndian);
  152|       |
  153|       |  // immediately following the image header is the color mode data section,
  154|       |  // the first four bytes of which specify the byte size of the whole section
  155|    719|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (155:7): [True: 0, False: 719]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  157|      0|  }
  158|       |
  159|       |  // skip it
  160|    719|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (160:7): [True: 10, False: 709]
  ------------------
  161|     10|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  162|     10|  }
  163|       |
  164|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  165|    709|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (165:7): [True: 10, False: 699]
  ------------------
  166|     10|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  167|     10|  }
  168|    699|  uint32_t resourcesLength = getULong(buf, bigEndian);
  169|    699|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  170|       |
  171|  2.04k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (171:10): [True: 1.72k, False: 321]
  ------------------
  172|  1.72k|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  173|  1.72k|    resourcesLength -= 8;
  174|  1.72k|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (174:9): [True: 34, False: 1.69k]
  ------------------
  175|     34|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  176|     34|    }
  177|       |
  178|  1.69k|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (178:9): [True: 333, False: 1.35k]
  ------------------
  179|    333|      break;  // bad resource type
  180|    333|    }
  181|  1.35k|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  182|  1.35k|    uint32_t resourceNameLength = buf[6] & ~1;
  183|       |
  184|       |    // skip the resource name, plus any padding
  185|  1.35k|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  186|  1.35k|    resourcesLength -= resourceNameLength;
  187|  1.35k|    io_->seek(resourceNameLength, BasicIo::cur);
  188|       |
  189|       |    // read resource size
  190|  1.35k|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  191|  1.35k|    resourcesLength -= 4;
  192|  1.35k|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (192:9): [True: 11, False: 1.34k]
  ------------------
  193|     11|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  194|     11|    }
  195|  1.34k|    uint32_t resourceSize = getULong(buf, bigEndian);
  196|  1.34k|    const size_t curOffset = io_->tell();
  197|       |
  198|       |#ifdef EXIV2_DEBUG_MESSAGES
  199|       |    std::cerr << std::hex << "resourceId: " << resourceId << std::dec << " length: " << resourceSize << std::hex
  200|       |              << "\n";
  201|       |#endif
  202|       |
  203|  1.34k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  204|  1.34k|    readResourceBlock(resourceId, resourceSize);
  205|  1.34k|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  206|  1.34k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  207|  1.34k|    resourcesLength -= resourceSize;
  208|  1.34k|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  209|  1.34k|  }
  210|       |
  211|    699|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  213|  1.23k|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  214|  1.23k|  switch (resourceId) {
  215|     73|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (215:5): [True: 73, False: 1.15k]
  ------------------
  216|     73|      DataBuf rawIPTC(resourceSize);
  217|     73|      io_->read(rawIPTC.data(), rawIPTC.size());
  218|     73|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (218:11): [True: 0, False: 73]
  |  Branch (218:27): [True: 11, False: 62]
  ------------------
  219|     11|        throw Error(ErrorCode::kerFailedToReadImageData);
  220|     62|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (220:11): [True: 35, False: 27]
  ------------------
  221|     35|#ifndef SUPPRESS_WARNINGS
  222|     35|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     35|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 35]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     35|  LogMsg(LogMsg::warn).os()
  ------------------
  223|     35|#endif
  224|     35|        iptcData_.clear();
  225|     35|      }
  226|     62|      break;
  227|     73|    }
  228|       |
  229|    121|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (229:5): [True: 121, False: 1.11k]
  ------------------
  230|    121|      DataBuf rawExif(resourceSize);
  231|    121|      io_->read(rawExif.data(), rawExif.size());
  232|    121|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (232:11): [True: 0, False: 121]
  |  Branch (232:27): [True: 11, False: 110]
  ------------------
  233|     11|        throw Error(ErrorCode::kerFailedToReadImageData);
  234|    110|      const DecodeParams dp(max_recursion_depth_);
  235|    110|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size(), dp);
  236|    110|      setByteOrder(bo);
  237|    110|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (237:11): [True: 14, False: 96]
  |  Branch (237:31): [True: 0, False: 14]
  ------------------
  238|      0|#ifndef SUPPRESS_WARNINGS
  239|      0|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  240|      0|#endif
  241|      0|        exifData_.clear();
  242|      0|      }
  243|    110|      break;
  244|    121|    }
  245|       |
  246|     66|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (246:5): [True: 66, False: 1.16k]
  ------------------
  247|     66|      DataBuf xmpPacket(resourceSize);
  248|     66|      io_->read(xmpPacket.data(), xmpPacket.size());
  249|     66|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (249:11): [True: 0, False: 66]
  |  Branch (249:27): [True: 10, False: 56]
  ------------------
  250|     10|        throw Error(ErrorCode::kerFailedToReadImageData);
  251|     56|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  252|     56|      const DecodeParams dp(max_recursion_depth_);
  253|     56|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (253:11): [True: 46, False: 10]
  |  Branch (253:34): [True: 46, False: 0]
  ------------------
  254|     46|#ifndef SUPPRESS_WARNINGS
  255|     46|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     46|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     46|  LogMsg(LogMsg::warn).os()
  ------------------
  256|     46|#endif
  257|     46|      }
  258|     56|      break;
  259|     66|    }
  260|       |
  261|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  262|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  263|    743|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (263:5): [True: 743, False: 488]
  ------------------
  264|    767|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (264:5): [True: 24, False: 1.20k]
  ------------------
  265|       |      /*
  266|       |        Photoshop thumbnail resource header
  267|       |
  268|       |        offset  length    name            description
  269|       |        ======  ========  ====            ===========
  270|       |         0      4 bytes   format          = 1 (kJpegRGB). Also supports kRawRGB (0).
  271|       |         4      4 bytes   width           Width of thumbnail in pixels.
  272|       |         8      4 bytes   height          Height of thumbnail in pixels.
  273|       |        12      4 bytes   widthbytes      Padded row bytes as (width * bitspixel + 31) / 32 * 4.
  274|       |        16      4 bytes   size            Total size as widthbytes * height * planes
  275|       |        20      4 bytes   compressedsize  Size after compression. Used for consistency check.
  276|       |        24      2 bytes   bitspixel       = 24. Bits per pixel.
  277|       |        26      2 bytes   planes          = 1. Number of planes.
  278|       |        28      variable  data            JFIF data in RGB format.
  279|       |                                          Note: For resource ID 1033 the data is in BGR format.
  280|       |      */
  281|    767|      byte buf[28];
  282|    767|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (282:11): [True: 15, False: 752]
  ------------------
  283|     15|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  284|     15|      }
  285|    752|      NativePreview nativePreview;
  286|    752|      nativePreview.position_ = io_->tell();
  287|    752|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  288|    752|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  289|    752|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  290|    752|      const uint32_t format = getLong(buf + 0, bigEndian);
  291|       |
  292|    752|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  293|    752|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  294|       |
  295|    752|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (295:11): [True: 693, False: 59]
  |  Branch (295:38): [True: 693, False: 0]
  ------------------
  296|    693|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  297|    693|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (297:13): [True: 0, False: 693]
  |  Branch (297:29): [True: 48, False: 645]
  ------------------
  298|     48|          throw Error(ErrorCode::kerFailedToReadImageData);
  299|       |
  300|       |        // unsupported format of native preview
  301|    645|        if (format != 1)
  ------------------
  |  Branch (301:13): [True: 139, False: 506]
  ------------------
  302|    139|          break;
  303|    506|        nativePreview.filter_ = "";
  304|    506|        nativePreview.mimeType_ = "image/jpeg";
  305|    506|        nativePreviews_.push_back(std::move(nativePreview));
  306|    506|      }
  307|    565|      break;
  308|    752|    }
  309|       |
  310|    565|    default:
  ------------------
  |  Branch (310:5): [True: 204, False: 1.02k]
  ------------------
  311|    204|      break;
  312|  1.23k|  }
  313|  1.23k|}  // PsdImage::readResourceBlock
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  679|    729|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  680|    729|  auto image = std::make_unique<PsdImage>(std::move(io), params);
  681|    729|  if (!image->good()) {
  ------------------
  |  Branch (681:7): [True: 10, False: 719]
  ------------------
  682|     10|    return nullptr;
  683|     10|  }
  684|    719|  return image;
  685|    729|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  687|  17.0k|bool isPsdType(BasicIo& iIo, bool advance) {
  688|  17.0k|  const int32_t len = 6;
  689|  17.0k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  690|  17.0k|  std::array<byte, len> buf;
  691|  17.0k|  iIo.read(buf.data(), len);
  692|  17.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (692:7): [True: 0, False: 17.0k]
  |  Branch (692:22): [True: 324, False: 16.7k]
  ------------------
  693|    324|    return false;
  694|    324|  }
  695|  16.7k|  bool matched = buf == PsdHeader;
  696|  16.7k|  if (!advance || !matched) {
  ------------------
  |  Branch (696:7): [True: 16.7k, False: 0]
  |  Branch (696:19): [True: 0, False: 0]
  ------------------
  697|  16.7k|    iIo.seek(-len, BasicIo::cur);
  698|  16.7k|  }
  699|       |
  700|  16.7k|  return matched;
  701|  17.0k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  4.19k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  4.19k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  5.05k|std::string QuickTimeVideo::mimeType() const {
  544|  5.05k|  return "video/quicktime";
  545|  5.05k|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  4.17k|void QuickTimeVideo::readMetadata() {
  551|  4.17k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 4.17k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  4.17k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 4.17k]
  ------------------
  556|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (556:9): [True: 0, False: 0]
  |  Branch (556:25): [True: 0, False: 0]
  ------------------
  557|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  558|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  559|      0|  }
  560|       |
  561|  4.17k|  IoCloser closer(*io_);
  562|  4.17k|  clearMetadata();
  563|  4.17k|  continueTraversing_ = true;
  564|  4.17k|  height_ = width_ = 1;
  565|       |
  566|  4.17k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  4.17k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  44.6k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 40.4k, False: 4.17k]
  ------------------
  570|  40.4k|    decodeBlock(0);
  571|       |
  572|  4.17k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  4.17k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  51.5k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  51.5k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  51.5k|  const long bufMinSize = 4;
  579|  51.5k|  DataBuf buf(bufMinSize + 1);
  580|  51.5k|  uint64_t size = 0;
  581|  51.5k|  buf.data()[4] = '\0';
  582|       |
  583|  51.5k|  io_->read(buf.data(), 4);
  584|  51.5k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 332, False: 51.2k]
  ------------------
  585|    332|    continueTraversing_ = false;
  586|    332|    return;
  587|    332|  }
  588|       |
  589|  51.2k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  51.2k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  51.2k|  size_t hdrsize = 8;
  595|       |
  596|  51.2k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 139, False: 51.0k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    139|    DataBuf data(8);
  599|    139|    hdrsize += 8;
  600|    139|    io_->readOrThrow(data.data(), data.size());
  601|    139|    size = data.read_uint64(0, bigEndian);
  602|  51.0k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 250, False: 50.8k]
  |  Branch (602:27): [True: 107, False: 143]
  ------------------
  603|    107|    size = buf.read_uint32(0, bigEndian);
  604|    107|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|    107|  }
  606|       |
  607|  51.2k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  51.2k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  51.2k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  610|       |
  611|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  612|  51.2k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  51.2k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 1.04k, False: 50.1k]
  ------------------
  614|  1.04k|    discard(newsize);
  615|  1.04k|    return;
  616|  1.04k|  }
  617|  50.1k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  50.1k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  48.8k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  48.8k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  48.8k|  assert(buf.size() > 4);
  631|       |
  632|  48.8k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 48.8k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  48.8k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 7.25k, False: 41.5k]
  ------------------
  636|  7.25k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  41.5k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 7.67k, False: 33.9k]
  ------------------
  638|  7.67k|    fileTypeDecoder(size);
  639|       |
  640|  33.9k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 3.33k, False: 30.5k]
  ------------------
  641|  3.33k|    setMediaStream(size);
  642|       |
  643|  30.5k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 470, False: 30.0k]
  ------------------
  644|    470|    movieHeaderDecoder(size);
  645|       |
  646|  30.0k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 1.07k, False: 29.0k]
  ------------------
  647|  1.07k|    trackHeaderDecoder(size);
  648|       |
  649|  29.0k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 668, False: 28.3k]
  ------------------
  650|    668|    mediaHeaderDecoder(size);
  651|       |
  652|  28.3k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 1.49k, False: 26.8k]
  ------------------
  653|  1.49k|    handlerDecoder(size);
  654|       |
  655|  26.8k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 3.58k, False: 23.2k]
  ------------------
  656|  3.58k|    videoHeaderDecoder(size);
  657|       |
  658|  23.2k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 5.09k, False: 18.1k]
  ------------------
  659|  5.09k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  18.1k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 1.78k, False: 16.3k]
  ------------------
  662|  1.78k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  16.3k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 3.21k, False: 13.1k]
  ------------------
  665|  3.21k|    sampleDesc(size);
  666|       |
  667|  13.1k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 377, False: 12.8k]
  ------------------
  668|    377|    timeToSampleDecoder();
  669|       |
  670|  12.8k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 206, False: 12.5k]
  ------------------
  671|    206|    previewTagDecoder(size);
  672|       |
  673|  12.5k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 889, False: 11.7k]
  ------------------
  674|    889|    trackApertureTagDecoder(size);
  675|       |
  676|  11.7k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 250, False: 11.4k]
  ------------------
  677|    250|    keysTagDecoder(size);
  678|       |
  679|  11.4k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 671, False: 10.7k]
  ------------------
  680|    671|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 144, False: 527]
  ------------------
  681|    144|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    527|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 202, False: 325]
  ------------------
  683|    202|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|    325|    else
  685|    325|      discard(size);
  686|    671|  }
  687|       |
  688|  10.7k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 667, False: 10.1k]
  ------------------
  689|    667|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 301, False: 366]
  ------------------
  690|    301|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    366|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 140, False: 226]
  ------------------
  692|    140|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|    226|    else
  694|    226|      discard(size);
  695|    667|  }
  696|       |
  697|  10.1k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 57, False: 10.0k]
  ------------------
  698|     57|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|     57|  }
  700|       |
  701|  10.0k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 35, False: 10.0k]
  ------------------
  702|     35|    io_->readOrThrow(buf.data(), 4);
  703|     35|    io_->readOrThrow(buf.data(), 4);
  704|     35|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|     35|  }
  706|       |
  707|  10.0k|  else {
  708|  10.0k|    discard(size);
  709|  10.0k|  }
  710|  48.8k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  11.6k|void QuickTimeVideo::discard(size_t size) {
  713|  11.6k|  size_t cur_pos = io_->tell();
  714|  11.6k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  11.6k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|    206|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|    206|  DataBuf buf(5);
  719|    206|  size_t cur_pos = io_->tell();
  720|    206|  io_->readOrThrow(buf.data(), 4);
  721|    206|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|    206|  io_->readOrThrow(buf.data(), 2);
  723|    206|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|    206|  io_->readOrThrow(buf.data(), 4);
  726|    206|  buf.write_uint8(4, 0);  // nul-terminate string
  727|    206|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 12, False: 194]
  ------------------
  728|     12|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|    194|  else
  730|    194|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|    206|  io_->seek(cur_pos + size, BasicIo::beg);
  733|    206|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    250|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    250|  DataBuf buf(5);
  737|    250|  size_t cur_pos = io_->tell();
  738|    250|  io_->readOrThrow(buf.data(), 4);
  739|    250|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    250|  io_->readOrThrow(buf.data(), 2);
  741|    250|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    250|  io_->readOrThrow(buf.data(), 4);
  744|    250|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    250|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 18, False: 232]
  ------------------
  746|     18|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    232|  else
  748|    232|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    250|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    250|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|    889|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|    889|  DataBuf buf(4);
  755|    889|  DataBuf buf2(2);
  756|    889|  size_t cur_pos = io_->tell();
  757|    889|  byte n = 3;
  758|       |
  759|  3.54k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 2.65k, False: 889]
  ------------------
  760|  2.65k|    io_->seek(4L, BasicIo::cur);
  761|  2.65k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  2.65k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 331, False: 2.32k]
  ------------------
  764|    331|      io_->seek(4L, BasicIo::cur);
  765|    331|      io_->readOrThrow(buf.data(), 2);
  766|    331|      io_->readOrThrow(buf2.data(), 2);
  767|    331|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|    331|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    331|#define stringFormat std::format
  ------------------
  769|    331|      io_->readOrThrow(buf.data(), 2);
  770|    331|      io_->readOrThrow(buf2.data(), 2);
  771|    331|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|    331|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    331|#define stringFormat std::format
  ------------------
  773|    331|    }
  774|       |
  775|  2.32k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 118, False: 2.20k]
  ------------------
  776|    118|      io_->seek(4L, BasicIo::cur);
  777|    118|      io_->readOrThrow(buf.data(), 2);
  778|    118|      io_->readOrThrow(buf2.data(), 2);
  779|    118|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|    118|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    118|#define stringFormat std::format
  ------------------
  781|    118|      io_->readOrThrow(buf.data(), 2);
  782|    118|      io_->readOrThrow(buf2.data(), 2);
  783|    118|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|    118|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    118|#define stringFormat std::format
  ------------------
  785|    118|    }
  786|       |
  787|  2.20k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 12, False: 2.19k]
  ------------------
  788|     12|      io_->seek(4L, BasicIo::cur);
  789|     12|      io_->readOrThrow(buf.data(), 2);
  790|     12|      io_->readOrThrow(buf2.data(), 2);
  791|     12|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     12|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     12|#define stringFormat std::format
  ------------------
  793|     12|      io_->readOrThrow(buf.data(), 2);
  794|     12|      io_->readOrThrow(buf2.data(), 2);
  795|     12|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     12|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     12|#define stringFormat std::format
  ------------------
  797|     12|    }
  798|  2.65k|  }
  799|    889|  io_->seek(cur_pos + size, BasicIo::beg);
  800|    889|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|    494|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|    494|  size_t cur_pos = io_->tell();
  804|    494|  DataBuf buf(49);
  805|    494|  DataBuf buf2(4);
  806|       |
  807|    494|  io_->readOrThrow(buf.data(), 4);
  808|    494|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 405, False: 89]
  ------------------
  809|    405|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|    405|    io_->readOrThrow(buf.data(), 24);
  812|    405|    buf.write_uint8(24, 0);  // nul-terminate string
  813|    405|    xmpData_["Xmp.video.Make"] = buf.data();
  814|    405|    io_->readOrThrow(buf.data(), 14);
  815|    405|    buf.write_uint8(14, 0);  // nul-terminate string
  816|    405|    xmpData_["Xmp.video.Model"] = buf.data();
  817|    405|    io_->readOrThrow(buf.data(), 4);
  818|    405|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|    405|#define stringFormat std::format
  ------------------
  819|    405|    io_->readOrThrow(buf.data(), 4);
  820|    405|    io_->readOrThrow(buf2.data(), 4);
  821|    405|    xmpData_["Xmp.video.FNumber"] =
  822|    405|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|    405|    io_->readOrThrow(buf.data(), 4);
  824|    405|    io_->readOrThrow(buf2.data(), 4);
  825|    405|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|    405|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|    405|    io_->readOrThrow(buf.data(), 10);
  828|    405|    io_->readOrThrow(buf.data(), 4);
  829|    405|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 80, False: 325]
  ------------------
  830|     80|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|     80|#define _(String) (String)
  ------------------
  831|    405|    io_->readOrThrow(buf.data(), 4);
  832|    405|    io_->readOrThrow(buf2.data(), 4);
  833|    405|    xmpData_["Xmp.video.FocalLength"] =
  834|    405|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|    405|    io_->seek(95L, BasicIo::cur);
  836|    405|    io_->readOrThrow(buf.data(), 48);
  837|    405|    buf.write_uint8(48, 0);
  838|    405|    xmpData_["Xmp.video.Software"] = buf.data();
  839|    405|    io_->readOrThrow(buf.data(), 4);
  840|    405|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|    405|  }
  842|       |
  843|    494|  io_->seek(cur_pos + size, BasicIo::beg);
  844|    494|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  846|  5.18k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  847|  5.18k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  848|  5.18k|  const size_t start_pos = io_->tell();
  849|  5.18k|  const TagVocabulary* td;
  850|  5.18k|  const TagVocabulary* tv;
  851|  5.18k|  const TagVocabulary* tv_internal;
  852|       |
  853|  5.18k|  const long bufMinSize = 100;
  854|  5.18k|  DataBuf buf(bufMinSize);
  855|  5.18k|  size_t size_internal = outer_size;
  856|  5.18k|  std::memset(buf.data(), 0x0, buf.size());
  857|       |
  858|  10.0k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 7.78k, False: 2.23k]
  |  Branch (858:38): [True: 7.78k, False: 0]
  ------------------
  859|  7.78k|    const size_t loop_start_pos = io_->tell();
  860|  7.78k|    buf.data()[4] = '\0';
  861|  7.78k|    io_->readOrThrow(buf.data(), 4);
  862|  7.78k|    const size_t size = buf.read_uint32(0, bigEndian);
  863|  7.78k|    if (size > size_internal)
  ------------------
  |  Branch (863:9): [True: 2.88k, False: 4.90k]
  ------------------
  864|  2.88k|      break;
  865|  4.90k|    size_internal -= size;
  866|  4.90k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  4.90k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 18, False: 4.88k]
  ------------------
  869|     18|      buf.data()[0] = ' ';
  870|  4.90k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  4.90k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  4.90k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 68, False: 4.83k]
  ------------------
  875|     68|      break;
  876|       |
  877|  4.83k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 58, False: 4.77k]
  |  Branch (877:40): [True: 35, False: 4.74k]
  ------------------
  878|     93|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  4.74k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 1.95k, False: 2.78k]
  ------------------
  881|  1.95k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  2.78k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 494, False: 2.29k]
  ------------------
  884|    494|      CameraTagsDecoder(size - 8);
  885|       |
  886|  2.29k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 18, False: 2.27k]
  |  Branch (886:45): [True: 75, False: 2.19k]
  |  Branch (886:76): [True: 182, False: 2.01k]
  ------------------
  887|  2.01k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 54, False: 1.96k]
  |  Branch (887:45): [True: 75, False: 1.88k]
  ------------------
  888|    404|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    404|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    404|#define _(String) (String)
  ------------------
  890|    404|    }
  891|       |
  892|  1.88k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 190, False: 1.69k]
  |  Branch (892:45): [True: 0, False: 1.69k]
  ------------------
  893|    190|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|    190|      io_->readOrThrow(buf.data(), 2);
  895|    190|      buf.data()[2] = '\0';
  896|    190|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|    190|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 136, False: 54]
  ------------------
  899|    136|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    136|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    136|#define _(String) (String)
  ------------------
  900|     54|      else
  901|     54|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     54|#define _(String) (String)
  ------------------
  902|    190|    }
  903|       |
  904|  1.69k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 90, False: 1.60k]
  ------------------
  905|     90|      io_->readOrThrow(buf.data(), 4);
  906|     90|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|     90|#define _(String) (String)
  ------------------
  907|     90|    }
  908|       |
  909|  1.60k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 673, False: 934]
  ------------------
  910|    673|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  4.83k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  4.83k|  }
  914|       |
  915|  5.18k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  5.18k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.95k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.95k|  size_t cur_pos = io_->tell();
  920|  1.95k|  DataBuf buf(201);
  921|  1.95k|  DataBuf buf2(4 + 1);
  922|  1.95k|  uint32_t TagID = 0;
  923|  1.95k|  uint16_t dataLength = 0;
  924|  1.95k|  uint16_t dataType = 2;
  925|  1.95k|  const TagDetails* td;
  926|  1.95k|  const TagDetails* td2;
  927|       |
  928|   119k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 117k, False: 1.95k]
  ------------------
  929|   117k|    io_->readOrThrow(buf.data(), 4);
  930|   117k|    TagID = buf.read_uint32(0, bigEndian);
  931|   117k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   117k|    io_->readOrThrow(buf.data(), 2);
  934|   117k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   117k|    std::memset(buf.data(), 0x0, buf.size());
  937|   117k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   117k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 5.50k, False: 111k]
  ------------------
  940|  5.50k|      size_t local_pos = io_->tell();
  941|  5.50k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  5.50k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  5.50k|      io_->readOrThrow(buf.data(), 4);
  945|  5.50k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  5.50k|      io_->readOrThrow(buf.data(), 20);
  947|  5.50k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  5.50k|      io_->readOrThrow(buf.data(), 20);
  949|  5.50k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  5.50k|      io_->readOrThrow(buf.data(), 4);
  951|  5.50k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  5.50k|      io_->readOrThrow(buf.data(), 1);
  954|  5.50k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  5.50k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 3.56k, False: 1.93k]
  ------------------
  956|  3.56k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.56k|#define _(String) (String)
  ------------------
  957|  1.93k|      else
  958|  1.93k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  5.50k|      io_->readOrThrow(buf.data(), 1);
  961|  5.50k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  5.50k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 3.47k, False: 2.02k]
  ------------------
  963|  3.47k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.47k|#define _(String) (String)
  ------------------
  964|       |
  965|  5.50k|      io_->readOrThrow(buf.data(), 1);
  966|  5.50k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  5.50k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 3.69k, False: 1.80k]
  ------------------
  968|  3.69k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  3.69k|#define _(String) (String)
  ------------------
  969|  1.80k|      else
  970|  1.80k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  5.50k|      io_->readOrThrow(buf.data(), 1);
  973|  5.50k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  5.50k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 3.67k, False: 1.82k]
  ------------------
  975|  3.67k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  3.67k|#define _(String) (String)
  ------------------
  976|  1.82k|      else
  977|  1.82k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  5.50k|      io_->readOrThrow(buf.data(), 1);
  980|  5.50k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  5.50k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 3.45k, False: 2.04k]
  ------------------
  982|  3.45k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  3.45k|#define _(String) (String)
  ------------------
  983|  2.04k|      else
  984|  2.04k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  5.50k|      io_->readOrThrow(buf.data(), 1);
  987|  5.50k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  5.50k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 3.58k, False: 1.91k]
  ------------------
  989|  3.58k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  3.58k|#define _(String) (String)
  ------------------
  990|  1.91k|      else
  991|  1.91k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  5.50k|      io_->readOrThrow(buf.data(), 1);
  994|  5.50k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  5.50k|      io_->readOrThrow(buf.data(), 1);
  997|  5.50k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  5.50k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 738, False: 4.76k]
  ------------------
  999|    738|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    738|#define _(String) (String)
  ------------------
 1000|  4.76k|      else
 1001|  4.76k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  5.50k|      io_->readOrThrow(buf.data(), 1);
 1004|  5.50k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  5.50k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 1.23k, False: 4.26k]
  ------------------
 1006|  1.23k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.23k|#define _(String) (String)
  ------------------
 1007|  4.26k|      else
 1008|  4.26k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  5.50k|      io_->readOrThrow(buf.data(), 1);
 1011|  5.50k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  5.50k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  5.50k|    }
 1015|       |
 1016|   111k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 892, False: 110k]
  ------------------
 1017|    892|      size_t local_pos = io_->tell();
 1018|    892|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    892|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    892|      io_->readOrThrow(buf.data(), 2);
 1022|    892|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    892|      io_->readOrThrow(buf.data(), 1);
 1024|    892|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    892|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 743, False: 149]
  ------------------
 1026|    743|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    743|#define _(String) (String)
  ------------------
 1027|       |
 1028|    892|      io_->readOrThrow(buf.data(), 1);
 1029|    892|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    892|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 276, False: 616]
  ------------------
 1031|    276|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    276|#define _(String) (String)
  ------------------
 1032|       |
 1033|    892|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    892|    }
 1035|       |
 1036|   110k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 2.27k, False: 108k]
  |  Branch (1036:31): [True: 252, False: 108k]
  ------------------
 1037|  1.68k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.68k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.68k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 401, False: 1.28k]
  ------------------
 1042|    401|#ifndef SUPPRESS_WARNINGS
 1043|    401|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    401|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 401]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    401|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    401|#endif
 1046|    401|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    401|        buf.data()[0] = '\0';
 1048|  1.28k|      } else {
 1049|  1.28k|        io_->readOrThrow(buf.data(), dataLength);
 1050|  1.28k|        buf.data()[dataLength] = '\0';
 1051|  1.28k|      }
 1052|       |
 1053|  1.68k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 444, False: 1.23k]
  ------------------
 1054|    444|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    444|#define _(String) (String)
  ------------------
 1055|    444|      }
 1056|   109k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 757, False: 108k]
  ------------------
 1057|    757|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|    757|      std::memset(buf.data(), 0x0, buf.size());
 1059|    757|      io_->readOrThrow(buf.data(), 4);
 1060|    757|      if (td)
  ------------------
  |  Branch (1060:11): [True: 153, False: 604]
  ------------------
 1061|    153|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    153|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|    757|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 285, False: 472]
  |  Branch (1064:31): [True: 387, False: 85]
  ------------------
 1065|    672|#ifndef SUPPRESS_WARNINGS
 1066|    672|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    672|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 672]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    672|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    672|#endif
 1069|    672|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    672|      } else
 1071|     85|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|   108k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 865, False: 107k]
  ------------------
 1073|    865|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|    865|      std::memset(buf.data(), 0x0, buf.size());
 1075|    865|      io_->readOrThrow(buf.data(), 2);
 1076|    865|      if (td)
  ------------------
  |  Branch (1076:11): [True: 285, False: 580]
  ------------------
 1077|    285|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    285|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|    865|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 367, False: 498]
  |  Branch (1080:31): [True: 184, False: 314]
  ------------------
 1081|    551|#ifndef SUPPRESS_WARNINGS
 1082|    551|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    551|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 551]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    551|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|    551|#endif
 1085|    551|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|    551|      } else
 1087|    314|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|   107k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 2.31k, False: 105k]
  ------------------
 1089|  2.31k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  2.31k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  2.31k|      io_->readOrThrow(buf.data(), 4);
 1092|  2.31k|      io_->readOrThrow(buf2.data(), 4);
 1093|  2.31k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 1.68k, False: 635]
  ------------------
 1094|  1.68k|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|  1.68k|#define _(String) (String)
  ------------------
 1095|  1.68k|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1096|       |
 1097|       |      // Sanity check with an "unreasonably" large number
 1098|  2.31k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 613, False: 1.70k]
  |  Branch (1098:31): [True: 258, False: 1.44k]
  ------------------
 1099|    869|#ifndef SUPPRESS_WARNINGS
 1100|    869|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    869|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 869]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    869|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    869|#endif
 1103|    869|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    869|      } else
 1105|  1.44k|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|   105k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 554, False: 104k]
  ------------------
 1107|    554|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|    554|      std::memset(buf.data(), 0x0, buf.size());
 1109|    554|      io_->readOrThrow(buf.data(), 2);
 1110|    554|      io_->readOrThrow(buf2.data(), 2);
 1111|    554|      if (td)
  ------------------
  |  Branch (1111:11): [True: 228, False: 326]
  ------------------
 1112|    228|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    228|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    228|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|    554|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 379, False: 175]
  |  Branch (1115:31): [True: 99, False: 76]
  ------------------
 1116|    477|#ifndef SUPPRESS_WARNINGS
 1117|    477|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    477|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 477]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    477|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    477|#endif
 1120|    477|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    477|      } else
 1122|     77|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|    554|    }
 1124|   117k|  }
 1125|       |
 1126|  1.95k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.95k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  3.33k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  3.33k|  size_t current_position = io_->tell();
 1131|  3.33k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  3.33k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 3.33k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  3.33k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  57.1k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 57.1k, False: 0]
  |  Branch (1136:25): [True: 55.6k, False: 1.57k]
  ------------------
 1137|  55.6k|    io_->readOrThrow(buf.data(), 4);
 1138|  55.6k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 1.76k, False: 53.8k]
  ------------------
 1139|  1.76k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 161, False: 1.60k]
  ------------------
 1140|    161|        break;
 1141|  1.60k|      io_->readOrThrow(buf.data(), 4);
 1142|  1.60k|      io_->readOrThrow(buf.data(), 4);
 1143|  1.60k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  1.60k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 41, False: 1.56k]
  ------------------
 1146|     41|        currentStream_ = Video;
 1147|  1.56k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 479, False: 1.08k]
  ------------------
 1148|    479|        currentStream_ = Audio;
 1149|  1.08k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 509, False: 579]
  ------------------
 1150|    509|        currentStream_ = Hint;
 1151|    579|      else
 1152|    579|        currentStream_ = GenMediaHeader;
 1153|  1.60k|      break;
 1154|  1.76k|    }
 1155|  55.6k|  }
 1156|       |
 1157|  3.33k|  io_->seek(current_position, BasicIo::beg);
 1158|  3.33k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|    377|void QuickTimeVideo::timeToSampleDecoder() {
 1161|    377|  DataBuf buf(4 + 1);
 1162|    377|  io_->readOrThrow(buf.data(), 4);
 1163|    377|  io_->readOrThrow(buf.data(), 4);
 1164|    377|  uint64_t totalframes = 0;
 1165|    377|  uint64_t timeOfFrames = 0;
 1166|    377|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  1.15k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 780, False: 377]
  ------------------
 1169|    780|    io_->readOrThrow(buf.data(), 4);
 1170|    780|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|    780|    totalframes = Safe::add(totalframes, temp);
 1172|    780|    io_->readOrThrow(buf.data(), 4);
 1173|    780|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|    780|  }
 1175|    377|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 183, False: 194]
  ------------------
 1176|    183|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 43, False: 140]
  ------------------
 1177|     43|      timeOfFrames = 1;
 1178|    183|    xmpData_["Xmp.video.FrameRate"] =
 1179|    183|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    183|  }
 1181|    377|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  3.21k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  3.21k|  DataBuf buf(100);
 1185|  3.21k|  size_t cur_pos = io_->tell();
 1186|  3.21k|  io_->readOrThrow(buf.data(), 4);
 1187|  3.21k|  io_->readOrThrow(buf.data(), 4);
 1188|  3.21k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|  58.9k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 57.7k, False: 1.15k]
  ------------------
 1191|  57.7k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 44.2k, False: 13.4k]
  ------------------
 1192|  44.2k|      imageDescDecoder();
 1193|  13.4k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 11.4k, False: 2.05k]
  ------------------
 1194|  11.4k|      audioDescDecoder();
 1195|  2.05k|    else
 1196|  2.05k|      break;
 1197|  57.7k|  }
 1198|  3.21k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  3.21k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  11.4k|void QuickTimeVideo::audioDescDecoder() {
 1202|  11.4k|  DataBuf buf(40);
 1203|  11.4k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  11.4k|  buf.data()[4] = '\0';
 1205|  11.4k|  io_->readOrThrow(buf.data(), 4);
 1206|  11.4k|  size_t size = 82;
 1207|       |
 1208|  11.4k|  const TagVocabulary* td;
 1209|       |
 1210|   239k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 227k, False: 11.3k]
  ------------------
 1211|   227k|    io_->readOrThrow(buf.data(), 4);
 1212|   227k|    switch (i) {
 1213|  11.4k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 11.4k, False: 216k]
  ------------------
 1214|  11.4k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  11.4k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 144, False: 11.2k]
  ------------------
 1216|    144|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    144|#define _(String) (String)
  ------------------
 1217|  11.2k|        else
 1218|  11.2k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  11.4k|        break;
 1220|  11.4k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 11.4k, False: 216k]
  ------------------
 1221|  11.4k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  11.4k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 501, False: 10.9k]
  ------------------
 1223|    501|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    501|#define _(String) (String)
  ------------------
 1224|  11.4k|        break;
 1225|  11.4k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 11.4k, False: 216k]
  ------------------
 1226|  11.4k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  11.4k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  11.4k|        break;
 1229|  11.4k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 11.4k, False: 216k]
  ------------------
 1230|  11.4k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  11.4k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  11.4k|        break;
 1233|   182k|      default:
  ------------------
  |  Branch (1233:7): [True: 182k, False: 45.7k]
  ------------------
 1234|   182k|        break;
 1235|   227k|    }
 1236|   227k|  }
 1237|  11.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  11.3k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  44.2k|void QuickTimeVideo::imageDescDecoder() {
 1241|  44.2k|  DataBuf buf(40);
 1242|  44.2k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  44.2k|  buf.data()[4] = '\0';
 1244|  44.2k|  io_->readOrThrow(buf.data(), 4);
 1245|  44.2k|  size_t size = 82;
 1246|       |
 1247|  44.2k|  const TagVocabulary* td;
 1248|       |
 1249|   530k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 486k, False: 44.1k]
  ------------------
 1250|   486k|    io_->readOrThrow(buf.data(), 4);
 1251|   486k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   486k|    switch (i) {
 1254|  44.2k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 44.2k, False: 441k]
  ------------------
 1255|  44.2k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  44.2k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 2.91k, False: 41.3k]
  ------------------
 1257|  2.91k|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|  2.91k|#define _(String) (String)
  ------------------
 1258|  41.3k|        else
 1259|  41.3k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  44.2k|        break;
 1261|  44.2k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 44.2k, False: 442k]
  ------------------
 1262|  44.2k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  44.2k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 1.43k, False: 42.7k]
  ------------------
 1264|  1.43k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.43k|#define _(String) (String)
  ------------------
 1265|  44.2k|        break;
 1266|  44.1k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 44.1k, False: 442k]
  ------------------
 1267|  44.1k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  44.1k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  44.1k|        break;
 1270|  44.1k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 44.1k, False: 442k]
  ------------------
 1271|  44.1k|        xmpData_["Xmp.video.XResolution"] =
 1272|  44.1k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  44.1k|        break;
 1274|  44.1k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 44.1k, False: 442k]
  ------------------
 1275|  44.1k|        xmpData_["Xmp.video.YResolution"] =
 1276|  44.1k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  44.1k|        io_->readOrThrow(buf.data(), 3);
 1278|  44.1k|        size -= 3;
 1279|  44.1k|        break;
 1280|  44.1k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 44.1k, False: 442k]
  ------------------
 1281|  44.1k|        io_->readOrThrow(buf.data(), 32);
 1282|  44.1k|        size -= 32;
 1283|  44.1k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  44.1k|        break;
 1285|   221k|      default:
  ------------------
  |  Branch (1285:7): [True: 221k, False: 265k]
  ------------------
 1286|   221k|        break;
 1287|   486k|    }
 1288|   486k|  }
 1289|  44.1k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  44.1k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  44.1k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  1.78k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  1.78k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  1.78k|  DataBuf buf(4 + 1);
 1296|  1.78k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.78k|  io_->readOrThrow(buf.data(), 4);
 1298|  1.78k|  uint32_t noOfEntries;
 1299|       |
 1300|  1.78k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  5.57k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 4.09k, False: 1.47k]
  |  Branch (1302:43): [True: 3.78k, False: 311]
  ------------------
 1303|  3.78k|    decodeBlock(recursion_depth + 1);
 1304|  3.78k|  }
 1305|  1.78k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  3.58k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  3.58k|  DataBuf buf(3);
 1309|  3.58k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  3.58k|  buf.data()[2] = '\0';
 1311|  3.58k|  currentStream_ = Video;
 1312|       |
 1313|  3.58k|  const TagDetails* td;
 1314|       |
 1315|  25.3k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 21.7k, False: 3.58k]
  ------------------
 1316|  21.7k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  21.7k|    switch (i) {
 1319|  3.48k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 3.48k, False: 18.2k]
  ------------------
 1320|  3.48k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  3.48k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 2.83k, False: 648]
  ------------------
 1322|  2.83k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.83k|#define _(String) (String)
  ------------------
 1323|  3.48k|        break;
 1324|  1.70k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 1.70k, False: 20.0k]
  ------------------
 1325|  1.70k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  1.70k|        break;
 1327|  16.5k|      default:
  ------------------
  |  Branch (1327:7): [True: 16.5k, False: 5.19k]
  ------------------
 1328|  16.5k|        break;
 1329|  21.7k|    }
 1330|  21.7k|  }
 1331|  3.58k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  3.58k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  1.49k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  1.49k|  size_t cur_pos = io_->tell();
 1336|  1.49k|  DataBuf buf(5);
 1337|  1.49k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  1.49k|  buf.data()[4] = '\0';
 1339|       |
 1340|  1.49k|  const TagVocabulary* tv;
 1341|       |
 1342|  8.92k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 7.44k, False: 1.48k]
  ------------------
 1343|  7.44k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  7.44k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 4.46k, False: 2.98k]
  ------------------
 1346|  1.49k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 1.49k, False: 5.95k]
  ------------------
 1347|  1.49k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  1.49k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 224, False: 1.26k]
  ------------------
 1349|    224|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 69, False: 155]
  ------------------
 1350|     69|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     69|#define _(String) (String)
  ------------------
 1351|    155|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 69, False: 86]
  ------------------
 1352|     69|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     69|#define _(String) (String)
  ------------------
 1353|    224|        }
 1354|  1.49k|        break;
 1355|  1.48k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 1.48k, False: 5.95k]
  ------------------
 1356|  1.48k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  1.48k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 1.13k, False: 350]
  ------------------
 1358|  1.13k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 86, False: 1.05k]
  ------------------
 1359|     86|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|     86|#define _(String) (String)
  ------------------
 1360|  1.05k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 126, False: 927]
  ------------------
 1361|    126|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    126|#define _(String) (String)
  ------------------
 1362|  1.13k|        }
 1363|  1.48k|        break;
 1364|  1.48k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 1.48k, False: 5.95k]
  ------------------
 1365|  1.48k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  1.48k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 911, False: 574]
  ------------------
 1367|    911|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 35, False: 876]
  ------------------
 1368|     35|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|     35|#define _(String) (String)
  ------------------
 1369|    876|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 131, False: 745]
  ------------------
 1370|    131|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    131|#define _(String) (String)
  ------------------
 1371|    911|        }
 1372|  1.48k|        break;
 1373|  7.44k|    }
 1374|  7.44k|  }
 1375|  1.48k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  1.48k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  7.67k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  7.67k|  DataBuf buf(5);
 1380|  7.67k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  7.67k|  buf.data()[4] = '\0';
 1382|  7.67k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  7.67k|  const TagVocabulary* td;
 1384|       |
 1385|  58.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 50.6k, False: 7.67k]
  ------------------
 1386|  50.6k|    io_->readOrThrow(buf.data(), 4);
 1387|  50.6k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  50.6k|    switch (i) {
 1390|  7.04k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 7.04k, False: 43.6k]
  ------------------
 1391|  7.04k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 6.26k, False: 786]
  ------------------
 1392|  6.26k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  6.26k|#define _(String) (String)
  ------------------
 1393|  7.04k|        break;
 1394|  1.55k|      case 1:
  ------------------
  |  Branch (1394:7): [True: 1.55k, False: 49.1k]
  ------------------
 1395|  1.55k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|  1.55k|        break;
 1397|  42.0k|      default:
  ------------------
  |  Branch (1397:7): [True: 42.0k, False: 8.59k]
  ------------------
 1398|  42.0k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 866, False: 41.1k]
  ------------------
 1399|    866|          v->read(_(td->label_));
  ------------------
  |  |   40|    866|#define _(String) (String)
  ------------------
 1400|  41.1k|        else
 1401|  41.1k|          v->read(Exiv2::toString(buf.data()));
 1402|  42.0k|        break;
 1403|  50.6k|    }
 1404|  50.6k|  }
 1405|  7.67k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  7.67k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  7.67k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|    668|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|    668|  DataBuf buf(5);
 1411|    668|  std::memset(buf.data(), 0x0, buf.size());
 1412|    668|  buf.data()[4] = '\0';
 1413|    668|  int64_t time_scale = 1;
 1414|       |
 1415|  4.54k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 3.88k, False: 668]
  ------------------
 1416|  3.88k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  3.88k|    switch (i) {
 1419|    650|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 650, False: 3.23k]
  ------------------
 1420|    650|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 310, False: 340]
  ------------------
 1421|    310|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|    340|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 196, False: 144]
  ------------------
 1423|    196|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    650|        break;
 1425|    369|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 369, False: 3.51k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|    369|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 69, False: 300]
  ------------------
 1428|     69|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|    300|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 189, False: 111]
  ------------------
 1430|    189|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    369|        break;
 1432|    368|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 368, False: 3.51k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|    368|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 68, False: 300]
  ------------------
 1435|     68|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|    300|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 189, False: 111]
  ------------------
 1437|    189|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    368|        break;
 1439|    367|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 367, False: 3.51k]
  ------------------
 1440|    367|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 67, False: 300]
  ------------------
 1441|     67|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|    300|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 189, False: 111]
  ------------------
 1443|    189|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    367|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|    367|        mdhdTimeScale_ = time_scale;
 1446|    367|        break;
 1447|    366|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 366, False: 3.51k]
  ------------------
 1448|    366|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 67, False: 299]
  ------------------
 1449|     67|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 67, False: 0]
  ------------------
 1450|    299|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 189, False: 110]
  ------------------
 1451|    189|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 189, False: 0]
  ------------------
 1452|    366|        break;
 1453|    364|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 364, False: 3.51k]
  ------------------
 1454|    364|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 66, False: 298]
  ------------------
 1455|     66|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|    298|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 189, False: 109]
  ------------------
 1457|    189|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    364|        break;
 1459|       |
 1460|  1.39k|      default:
  ------------------
  |  Branch (1460:7): [True: 1.39k, False: 2.48k]
  ------------------
 1461|  1.39k|        break;
 1462|  3.88k|    }
 1463|  3.88k|  }
 1464|    668|  io_->readOrThrow(buf.data(), size % 4);
 1465|    668|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|  1.07k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|  1.07k|  DataBuf buf(5);
 1469|  1.07k|  std::memset(buf.data(), 0x0, buf.size());
 1470|  1.07k|  buf.data()[4] = '\0';
 1471|  1.07k|  int64_t temp = 0;
 1472|       |
 1473|  14.0k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 12.9k, False: 1.07k]
  ------------------
 1474|  12.9k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  12.9k|    switch (i) {
 1477|    606|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 606, False: 12.3k]
  ------------------
 1478|    606|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 79, False: 527]
  ------------------
 1479|     79|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|    527|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 34, False: 493]
  ------------------
 1481|     34|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    606|        break;
 1483|    532|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 532, False: 12.4k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|    532|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 76, False: 456]
  ------------------
 1486|     76|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|    456|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 34, False: 422]
  ------------------
 1488|     34|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    532|        break;
 1490|    521|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 521, False: 12.4k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|    521|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 76, False: 445]
  ------------------
 1493|     76|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|    445|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 34, False: 411]
  ------------------
 1495|     34|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    521|        break;
 1497|    521|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 521, False: 12.4k]
  ------------------
 1498|    521|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 76, False: 445]
  ------------------
 1499|     76|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|    445|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 34, False: 411]
  ------------------
 1501|     34|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    521|        break;
 1503|    512|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 512, False: 12.4k]
  ------------------
 1504|    512|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 73, False: 439]
  ------------------
 1505|     73|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 73, False: 0]
  ------------------
 1506|    439|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 34, False: 405]
  ------------------
 1507|     34|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 34, False: 0]
  ------------------
 1508|    512|        break;
 1509|    509|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 509, False: 12.4k]
  ------------------
 1510|    509|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 73, False: 436]
  ------------------
 1511|     73|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|    436|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 34, False: 402]
  ------------------
 1513|     34|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    509|        break;
 1515|    508|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 508, False: 12.4k]
  ------------------
 1516|    508|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 73, False: 435]
  ------------------
 1517|     73|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|    435|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 34, False: 401]
  ------------------
 1519|     34|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    508|        break;
 1521|    502|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 502, False: 12.4k]
  ------------------
 1522|    502|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 69, False: 433]
  ------------------
 1523|     69|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|     69|          xmpData_["Xmp.video.Width"] = temp;
 1525|     69|          width_ = temp;
 1526|     69|        }
 1527|    502|        break;
 1528|    502|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 502, False: 12.4k]
  ------------------
 1529|    502|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 69, False: 433]
  ------------------
 1530|     69|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|     69|          xmpData_["Xmp.video.Height"] = temp;
 1532|     69|          height_ = temp;
 1533|     69|        }
 1534|    502|        break;
 1535|  8.23k|      default:
  ------------------
  |  Branch (1535:7): [True: 8.23k, False: 4.71k]
  ------------------
 1536|  8.23k|        break;
 1537|  12.9k|    }
 1538|  12.9k|  }
 1539|  1.07k|  io_->readOrThrow(buf.data(), size % 4);
 1540|  1.07k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|    470|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|    470|  DataBuf buf(5);
 1544|    470|  std::memset(buf.data(), 0x0, buf.size());
 1545|    470|  buf.data()[4] = '\0';
 1546|       |
 1547|  1.56k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 1.09k, False: 470]
  ------------------
 1548|  1.09k|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|  1.09k|    switch (i) {
 1551|    109|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 109, False: 984]
  ------------------
 1552|    109|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|    109|        break;
 1554|     90|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 90, False: 1.00k]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|     90|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|     90|        break;
 1558|     85|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 85, False: 1.00k]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|     85|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|     85|        break;
 1562|     77|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 77, False: 1.01k]
  ------------------
 1563|     77|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|     77|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|     77|        break;
 1566|     75|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 75, False: 1.01k]
  ------------------
 1567|     75|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 75, False: 0]
  ------------------
 1568|     75|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|     75|        }
 1570|     75|        break;
 1571|     74|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 74, False: 1.01k]
  ------------------
 1572|     74|        xmpData_["Xmp.video.PreferredRate"] =
 1573|     74|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|     74|        break;
 1575|     74|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 74, False: 1.01k]
  ------------------
 1576|     74|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|     74|        break;
 1578|     12|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 12, False: 1.08k]
  ------------------
 1579|     12|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     12|        break;
 1581|     12|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 12, False: 1.08k]
  ------------------
 1582|     12|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     12|        break;
 1584|     12|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 12, False: 1.08k]
  ------------------
 1585|     12|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     12|        break;
 1587|     11|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 11, False: 1.08k]
  ------------------
 1588|     11|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     11|        break;
 1590|     11|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 11, False: 1.08k]
  ------------------
 1591|     11|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     11|        break;
 1593|     10|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 10, False: 1.08k]
  ------------------
 1594|     10|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     10|        break;
 1596|      9|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 9, False: 1.08k]
  ------------------
 1597|      9|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|      9|        break;
 1599|    432|      default:
  ------------------
  |  Branch (1599:7): [True: 432, False: 661]
  ------------------
 1600|    432|        break;
 1601|  1.09k|    }
 1602|  1.09k|  }
 1603|    470|  io_->readOrThrow(buf.data(), size % 4);
 1604|    470|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  4.19k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  4.19k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  4.19k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 18, False: 4.17k]
  ------------------
 1609|     18|    return nullptr;
 1610|     18|  }
 1611|  4.17k|  return image;
 1612|  4.19k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  21.3k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  21.3k|  auto buf = DataBuf(12 + 1);
 1616|  21.3k|  iIo.read(buf.data(), 12);
 1617|  21.3k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  21.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 21.3k]
  |  Branch (1619:22): [True: 314, False: 20.9k]
  ------------------
 1620|    314|    return false;
 1621|    314|  }
 1622|  20.9k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  20.9k|  bool matched = false;
 1625|       |
 1626|   108k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 108k, False: 5.28k]
  ------------------
 1627|   108k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   108k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 15.7k, False: 92.9k]
  ------------------
 1629|       |      // we only match if we actually know the video type. This is done
 1630|       |      // to avoid matching just on ftyp because bmffimage also has that
 1631|       |      // header.
 1632|  15.7k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 12.5k, False: 3.15k]
  ------------------
 1633|  12.5k|        matched = true;
 1634|  12.5k|      }
 1635|  15.7k|      break;
 1636|  15.7k|    }
 1637|   108k|  }
 1638|       |
 1639|  20.9k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 20.9k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  20.9k|    iIo.seek(0L, BasicIo::beg);
 1641|  20.9k|  }
 1642|       |
 1643|  20.9k|  return matched;
 1644|  21.3k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|  98.0k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|  98.0k|  const char ignoreList[13][5] = {
  505|  98.0k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|  98.0k|  };
  507|       |
  508|  98.0k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.27M, False: 96.9k]
  ------------------
  509|  1.27M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 1.04k, False: 1.26M]
  ------------------
  510|  1.04k|      return true;
  511|       |
  512|  96.9k|  return false;
  513|  98.0k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  48.8k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  48.8k|  const char ignoreList[8][5] = {
  524|  48.8k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  48.8k|  };
  526|       |
  527|  48.8k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 358k, False: 41.5k]
  ------------------
  528|   358k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 7.25k, False: 351k]
  ------------------
  529|  7.25k|      return true;
  530|       |
  531|  41.5k|  return false;
  532|  48.8k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.09M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.09M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.09M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.09M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.46M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  1.32k|static std::string readString(BasicIo& io, size_t size) {
  621|  1.32k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  1.32k|  Exiv2::DataBuf str(size + 1);
  623|  1.32k|  io.readOrThrow(str.data(), size);
  624|  1.32k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  1.32k|  return Exiv2::toString(str.data());
  626|  1.32k|}

_ZN5Exiv28RafImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   25|    193|    Image(ImageType::raf, mdExif | mdIptc | mdXmp, std::move(io), params) {
   26|    193|}  // RafImage::RafImage
_ZNK5Exiv28RafImage8mimeTypeEv:
   28|     30|std::string RafImage::mimeType() const {
   29|     30|  return "image/x-fuji-raf";
   30|     30|}
_ZNK5Exiv28RafImage10pixelWidthEv:
   32|     17|uint32_t RafImage::pixelWidth() const {
   33|     17|  if (pixelWidth_ != 0)
  ------------------
  |  Branch (33:7): [True: 0, False: 17]
  ------------------
   34|      0|    return pixelWidth_;
   35|       |
   36|     17|  auto widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Fujifilm.RawImageFullWidth"));
   37|     17|  if (widthIter == exifData_.end() || widthIter->count() == 0)
  ------------------
  |  Branch (37:7): [True: 17, False: 0]
  |  Branch (37:7): [True: 17, False: 0]
  |  Branch (37:39): [True: 0, False: 0]
  ------------------
   38|     17|    return 0;
   39|      0|  return widthIter->toUint32();
   40|     17|}
_ZNK5Exiv28RafImage11pixelHeightEv:
   42|     17|uint32_t RafImage::pixelHeight() const {
   43|     17|  if (pixelHeight_ != 0)
  ------------------
  |  Branch (43:7): [True: 0, False: 17]
  ------------------
   44|      0|    return pixelHeight_;
   45|       |
   46|     17|  auto heightIter = exifData_.findKey(Exiv2::ExifKey("Exif.Fujifilm.RawImageFullHeight"));
   47|     17|  if (heightIter == exifData_.end() || heightIter->count() == 0)
  ------------------
  |  Branch (47:7): [True: 17, False: 0]
  |  Branch (47:7): [True: 17, False: 0]
  |  Branch (47:40): [True: 0, False: 0]
  ------------------
   48|     17|    return 0;
   49|      0|  return heightIter->toUint32();
   50|     17|}
_ZN5Exiv28RafImage12readMetadataEv:
  252|    193|void RafImage::readMetadata() {
  253|       |#ifdef EXIV2_DEBUG_MESSAGES
  254|       |  std::cerr << "Reading RAF file " << io_->path() << "\n";
  255|       |#endif
  256|    193|  if (io_->open() != 0)
  ------------------
  |  Branch (256:7): [True: 0, False: 193]
  ------------------
  257|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  258|    193|  IoCloser closer(*io_);
  259|       |  // Ensure that this is the correct image type
  260|    193|  if (!isRafType(*io_, false)) {
  ------------------
  |  Branch (260:7): [True: 0, False: 193]
  ------------------
  261|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (261:9): [True: 0, False: 0]
  |  Branch (261:25): [True: 0, False: 0]
  ------------------
  262|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  263|      0|    throw Error(ErrorCode::kerNotAnImage, "RAF");
  264|      0|  }
  265|       |
  266|    193|  clearMetadata();
  267|       |
  268|    193|  if (io_->seek(84, BasicIo::beg) != 0)
  ------------------
  |  Branch (268:7): [True: 11, False: 182]
  ------------------
  269|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  270|    182|  byte jpg_img_offset[4];
  271|    182|  if (io_->read(jpg_img_offset, 4) != 4)
  ------------------
  |  Branch (271:7): [True: 10, False: 172]
  ------------------
  272|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  273|    172|  byte jpg_img_length[4];
  274|    172|  if (io_->read(jpg_img_length, 4) != 4)
  ------------------
  |  Branch (274:7): [True: 11, False: 161]
  ------------------
  275|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  276|    161|  uint32_t jpg_img_off_u32 = Exiv2::getULong(jpg_img_offset, bigEndian);
  277|    161|  uint32_t jpg_img_len_u32 = Exiv2::getULong(jpg_img_length, bigEndian);
  278|       |
  279|    161|  Internal::enforce(Safe::add(jpg_img_off_u32, jpg_img_len_u32) <= io_->size(), ErrorCode::kerCorruptedMetadata);
  280|       |
  281|    161|  auto jpg_img_off = static_cast<long>(jpg_img_off_u32);
  282|    161|  auto jpg_img_len = static_cast<long>(jpg_img_len_u32);
  283|       |
  284|    161|  Internal::enforce(jpg_img_len >= 12, ErrorCode::kerCorruptedMetadata);
  285|       |
  286|    161|  DataBuf jpg_buf(jpg_img_len);
  287|    161|  if (io_->seek(jpg_img_off, BasicIo::beg) != 0)
  ------------------
  |  Branch (287:7): [True: 0, False: 161]
  ------------------
  288|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  289|       |
  290|    161|  if (!jpg_buf.empty()) {
  ------------------
  |  Branch (290:7): [True: 102, False: 59]
  ------------------
  291|    102|    io_->read(jpg_buf.data(), jpg_buf.size());
  292|    102|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (292:9): [True: 0, False: 102]
  |  Branch (292:25): [True: 0, False: 102]
  ------------------
  293|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  294|    102|  }
  295|       |
  296|       |  // Retrieve metadata from embedded JPEG preview image.
  297|    161|  try {
  298|    161|    auto jpg_io = std::make_unique<Exiv2::MemIo>(jpg_buf.data(), jpg_buf.size());
  299|    161|    auto jpg_img = JpegImage(std::move(jpg_io), ImageCtorParams(false, 0));
  300|    161|    jpg_img.readMetadata();
  301|    161|    setByteOrder(jpg_img.byteOrder());
  302|    161|    xmpData_ = jpg_img.xmpData();
  303|    161|    exifData_ = jpg_img.exifData();
  304|    161|    iptcData_ = jpg_img.iptcData();
  305|    161|    comment_ = jpg_img.comment();
  306|    161|  } catch (const Exiv2::Error&) {
  307|     98|  }
  308|       |
  309|    161|  exifData_["Exif.Image2.JPEGInterchangeFormat"] = getULong(jpg_img_offset, bigEndian);
  310|    102|  exifData_["Exif.Image2.JPEGInterchangeFormatLength"] = getULong(jpg_img_length, bigEndian);
  311|       |
  312|       |  // Todo: parse the proprietary metadata structure
  313|       |  //       at offset 92 for pixelWidth_ & pixelHeight_
  314|       |  // See https://libopenraw.freedesktop.org/formats/raf/
  315|       |  // and https://exiftool.org/TagNames/FujiFilm.html#RAF
  316|       |
  317|       |  // parse the tiff
  318|    102|  std::array<byte, 4> readBuff;
  319|    102|  if (io_->seek(100, BasicIo::beg) != 0)
  ------------------
  |  Branch (319:7): [True: 11, False: 91]
  ------------------
  320|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  321|     91|  if (io_->read(readBuff.data(), 4) != 4)
  ------------------
  |  Branch (321:7): [True: 16, False: 75]
  ------------------
  322|     16|    throw Error(ErrorCode::kerFailedToReadImageData);
  323|     75|  uint32_t tiffOffset = Exiv2::getULong(readBuff.data(), bigEndian);
  324|       |
  325|     75|  if (io_->read(readBuff.data(), 4) != 4)
  ------------------
  |  Branch (325:7): [True: 11, False: 64]
  ------------------
  326|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  327|     64|  uint32_t tiffLength = Exiv2::getULong(readBuff.data(), bigEndian);
  328|       |
  329|       |  // sanity check.  Does tiff lie inside the file?
  330|     64|  Internal::enforce(Safe::add(tiffOffset, tiffLength) <= io_->size(), ErrorCode::kerCorruptedMetadata);
  331|       |
  332|     64|  if (io_->seek(tiffOffset, BasicIo::beg) != 0)
  ------------------
  |  Branch (332:7): [True: 0, False: 64]
  ------------------
  333|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  334|       |
  335|       |  // Check if this really is a tiff and then call the tiff parser.
  336|       |  // Check is needed because some older models just embed a raw bitstream.
  337|       |  // For those files we skip the parsing step.
  338|     64|  if (io_->read(readBuff.data(), 4) != 4) {
  ------------------
  |  Branch (338:7): [True: 10, False: 54]
  ------------------
  339|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  340|     10|  }
  341|     54|  io_->seek(-4, BasicIo::cur);
  342|     54|  const std::array<byte, 4> Id1{0x49, 0x49, 0x2A, 0x00};
  343|     54|  const std::array<byte, 4> Id2{0x4D, 0x4D, 0x00, 0x2A};
  344|     54|  if (readBuff == Id1 || readBuff == Id2) {
  ------------------
  |  Branch (344:7): [True: 28, False: 26]
  |  Branch (344:26): [True: 1, False: 25]
  ------------------
  345|      3|    DataBuf tiff(tiffLength);
  346|      3|    io_->read(tiff.data(), tiff.size());
  347|       |
  348|      3|    if (!io_->error() && !io_->eof()) {
  ------------------
  |  Branch (348:9): [True: 3, False: 0]
  |  Branch (348:26): [True: 3, False: 0]
  ------------------
  349|      3|      const DecodeParams dp(max_recursion_depth_);
  350|      3|      TiffParser::decode(exifData_, iptcData_, xmpData_, tiff.c_data(), tiff.size(), dp);
  351|      3|    }
  352|      3|  }
  353|     54|}
_ZN5Exiv214newRafInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  362|    193|Image::UniquePtr newRafInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  363|    193|  auto image = std::make_unique<RafImage>(std::move(io), params);
  364|    193|  if (!image->good()) {
  ------------------
  |  Branch (364:7): [True: 0, False: 193]
  ------------------
  365|      0|    return nullptr;
  366|      0|  }
  367|    193|  return image;
  368|    193|}
_ZN5Exiv29isRafTypeERNS_7BasicIoEb:
  370|  21.5k|bool isRafType(BasicIo& iIo, bool advance) {
  371|  21.5k|  const int32_t len = 8;
  372|  21.5k|  constexpr std::array<byte, len> RafId{'F', 'U', 'J', 'I', 'F', 'I', 'L', 'M'};
  373|  21.5k|  std::array<byte, len> buf;
  374|  21.5k|  iIo.read(buf.data(), len);
  375|  21.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (375:7): [True: 0, False: 21.5k]
  |  Branch (375:22): [True: 0, False: 21.5k]
  ------------------
  376|      0|    return false;
  377|      0|  }
  378|  21.5k|  bool rc = buf == RafId;
  379|  21.5k|  if (!advance || !rc) {
  ------------------
  |  Branch (379:7): [True: 21.5k, False: 0]
  |  Branch (379:19): [True: 0, False: 0]
  ------------------
  380|  21.5k|    iIo.seek(-len, BasicIo::cur);
  381|  21.5k|  }
  382|  21.5k|  return rc;
  383|  21.5k|}

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  365|    872|    Image(ImageType::riff, mdNone, std::move(io), params) {
  366|    872|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  368|    962|std::string RiffVideo::mimeType() const {
  369|    962|  return "video/riff";
  370|    962|}
_ZN5Exiv29RiffVideo12readMetadataEv:
  375|    872|void RiffVideo::readMetadata() {
  376|    872|  if (io_->open() != 0)
  ------------------
  |  Branch (376:7): [True: 0, False: 872]
  ------------------
  377|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  378|       |
  379|       |  // Ensure that this is the correct image type
  380|    872|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (380:7): [True: 0, False: 872]
  ------------------
  381|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (381:9): [True: 0, False: 0]
  |  Branch (381:25): [True: 0, False: 0]
  ------------------
  382|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  383|      0|    throw Error(ErrorCode::kerNotAnImage, "RIFF");
  384|      0|  }
  385|       |
  386|    872|  IoCloser closer(*io_);
  387|    872|  clearMetadata();
  388|       |
  389|    872|  xmpData_["Xmp.video.FileSize"] = io_->size();
  390|    872|  xmpData_["Xmp.video.MimeType"] = mimeType();
  391|       |
  392|    872|  HeaderReader header(io_);
  393|    872|  xmpData_["Xmp.video.Container"] = header.getId();
  394|       |
  395|    872|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  396|       |
  397|    872|  decodeBlocks();
  398|    872|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  400|  25.6k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  401|  25.6k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  402|  25.6k|  id_ = readStringTag(io);
  403|  25.6k|  size_ = readDWORDTag(io);
  404|  25.6k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  406|   225k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  407|   225k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (407:7): [True: 182k, False: 43.0k]
  ------------------
  408|   182k|    return false;
  409|       |
  410|  43.0k|  return Internal::upper(str1) == str2;
  411|   225k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  413|  1.94k|void RiffVideo::readList(const HeaderReader& header_) {
  414|  1.94k|  std::string chunk_type = readStringTag(io_);
  415|       |
  416|       |#ifdef EXIV2_DEBUG_MESSAGES
  417|       |  EXV_INFO << "-> Reading list : id= " << header_.getId() << "  type= " << chunk_type << " size= " << header_.getSize()
  418|       |           << "(" << io_->tell() << "/" << io_->size() << ")" << '\n';
  419|       |#endif
  420|       |
  421|  1.94k|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (421:7): [True: 679, False: 1.26k]
  ------------------
  422|    679|    readInfoListChunk(header_.getSize());
  423|  1.26k|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (423:12): [True: 389, False: 872]
  ------------------
  424|    389|    readMoviList(header_.getSize());
  425|    389|  }
  426|  1.94k|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  428|  22.7k|void RiffVideo::readChunk(const HeaderReader& header_) {
  429|       |#ifdef EXIV2_DEBUG_MESSAGES
  430|       |  if (header_.getSize())
  431|       |    EXV_INFO << "--> Reading Chunk : [" << header_.getId() << "] size= " << header_.getSize() << "(" << io_->tell()
  432|       |             << "/" << io_->size() << ")" << '\n';
  433|       |#endif
  434|       |
  435|  22.7k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (435:7): [True: 619, False: 22.0k]
  ------------------
  436|    619|    readAviHeader();
  437|  22.0k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (437:12): [True: 664, False: 21.4k]
  ------------------
  438|    664|    readStreamHeader();
  439|  21.4k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (439:12): [True: 1.04k, False: 20.3k]
  ------------------
  440|  1.04k|    readStreamFormat(header_.getSize());
  441|  20.3k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (441:12): [True: 1.26k, False: 19.1k]
  ------------------
  442|  1.26k|    streamType_ = Audio;
  443|  1.26k|    readStreamFormat(header_.getSize());
  444|  19.1k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (444:14): [True: 216, False: 18.8k]
  ------------------
  445|    216|    readStreamData(header_.getSize());
  446|  18.8k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (446:12): [True: 332, False: 18.5k]
  ------------------
  447|    332|    StreamName(header_.getSize());
  448|  18.5k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (448:12): [True: 194, False: 18.3k]
  ------------------
  449|    194|    readVPRPChunk(header_.getSize());
  450|  18.3k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (450:12): [True: 238, False: 18.1k]
  ------------------
  451|    238|    readIndexChunk(header_.getSize());
  452|  18.1k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (452:12): [True: 379, False: 17.7k]
  ------------------
  453|    379|    readDataChunk(header_.getSize());
  454|  17.7k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (454:12): [True: 35, False: 17.7k]
  ------------------
  455|     35|    readJunk(header_.getSize());
  456|  17.7k|  else {
  457|       |#ifdef EXIV2_DEBUG_MESSAGES
  458|       |    if (header_.getSize())
  459|       |      EXV_WARNING << "--> Ignoring Chunk : " << header_.getId() << "] size= " << header_.getSize() << "(" << io_->tell()
  460|       |                  << "/" << io_->size() << ")" << '\n';
  461|       |#endif
  462|  17.7k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  463|  17.7k|  }
  464|  22.7k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  466|    872|void RiffVideo::decodeBlocks() {
  467|  24.8k|  do {
  468|  24.8k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (468:35): [True: 1.94k, False: 22.8k]
  ------------------
  469|  1.94k|      readList(header);
  470|  22.8k|    } else {
  471|  22.8k|      readChunk(header);
  472|  22.8k|    }
  473|  24.8k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (473:12): [True: 23.9k, False: 828]
  |  Branch (473:27): [True: 23.9k, False: 44]
  ------------------
  474|    872|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  476|    619|void RiffVideo::readAviHeader() {
  477|       |#ifdef EXIV2_DEBUG_MESSAGES
  478|       |  EXV_INFO << "--> dwMicroSecPerFrame    = " << readDWORDTag(io_) << '\n';
  479|       |  EXV_INFO << "--> dwMaxBytesPerSec      = " << readDWORDTag(io_) << '\n';
  480|       |  EXV_INFO << "--> dwPaddingGranularity  = " << readDWORDTag(io_) << '\n';
  481|       |  EXV_INFO << "--> dwFlags               = " << readDWORDTag(io_) << '\n';
  482|       |  EXV_INFO << "--> dwTotalFrames         = " << readDWORDTag(io_) << '\n';
  483|       |  EXV_INFO << "--> dwInitialFrames       = " << readDWORDTag(io_) << '\n';
  484|       |  EXV_INFO << "--> dwStreams             = " << readDWORDTag(io_) << '\n';
  485|       |  EXV_INFO << "--> dwSuggestedBufferSize = " << readDWORDTag(io_) << '\n';
  486|       |  EXV_INFO << "--> dwWidth               = " << readDWORDTag(io_) << '\n';
  487|       |  EXV_INFO << "--> dwHeight              = " << readDWORDTag(io_) << '\n';
  488|       |  EXV_INFO << "--> dwReserved1           = " << readDWORDTag(io_) << '\n';
  489|       |  EXV_INFO << "--> dwReserved2           = " << readDWORDTag(io_) << '\n';
  490|       |  EXV_INFO << "--> dwReserved3           = " << readDWORDTag(io_) << '\n';
  491|       |  EXV_INFO << "--> dwReserved4           = " << readDWORDTag(io_) << '\n';
  492|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  493|       |    io_->seekOrThrow(io_->tell() - DWORD * 14, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  494|       |#endif
  495|       |
  496|    619|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  497|    619|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  498|    619|  double frame_rate = 1000000. / TimeBetweenFrames;
  499|       |
  500|    619|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  501|       |
  502|    619|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  503|    619|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  504|       |
  505|    619|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  506|    619|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  507|       |
  508|    619|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  509|    619|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  510|       |
  511|    619|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  512|       |
  513|    619|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  514|       |
  515|    619|  uint32_t width = readDWORDTag(io_);
  516|    619|  xmpData_["Xmp.video.Width"] = width;
  517|       |
  518|    619|  uint32_t height = readDWORDTag(io_);
  519|    619|  xmpData_["Xmp.video.Height"] = height;
  520|       |
  521|    619|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  522|    619|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  523|       |
  524|    619|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  525|       |
  526|    619|  fillDuration(frame_rate, frame_count);
  527|    619|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  529|    664|void RiffVideo::readStreamHeader() {
  530|    664|  std::string stream = readStringTag(io_);
  531|    664|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (531:17): [True: 173, False: 491]
  ------------------
  532|       |
  533|       |#ifdef EXIV2_DEBUG_MESSAGES
  534|       |  EXV_INFO << "--> fccType                = " << stream << '\n';
  535|       |  EXV_INFO << "--> fccHandler             = " << readStringTag(io_) << '\n';
  536|       |  EXV_INFO << "--> dwFlags                = " << readDWORDTag(io_) << '\n';
  537|       |  EXV_INFO << "--> wPriority              = " << readWORDTag(io_) << '\n';
  538|       |  EXV_INFO << "--> wLanguage              = " << readWORDTag(io_) << '\n';
  539|       |  EXV_INFO << "--> dwInitialFrames        = " << readDWORDTag(io_) << '\n';  // 20
  540|       |  EXV_INFO << "--> dwScale                = " << readDWORDTag(io_) << '\n';
  541|       |  EXV_INFO << "--> dwRate                 = " << readDWORDTag(io_) << '\n';
  542|       |  EXV_INFO << "--> dwStart                = " << readDWORDTag(io_) << '\n';
  543|       |  EXV_INFO << "--> dwLength               = " << readDWORDTag(io_) << '\n';
  544|       |  EXV_INFO << "--> dwSuggestedBufferSize  = " << readDWORDTag(io_) << '\n';  // 40
  545|       |  EXV_INFO << "--> dwSampleSize           = " << readDWORDTag(io_) << '\n';
  546|       |  EXV_INFO << "--> Left                   = " << readWORDTag(io_) << '\n';
  547|       |  EXV_INFO << "--> top                    = " << readWORDTag(io_) << '\n';
  548|       |  EXV_INFO << "--> right                  = " << readWORDTag(io_) << '\n';
  549|       |  EXV_INFO << "--> bottom                 = " << readWORDTag(io_) << '\n';
  550|       |  EXV_INFO << "--> XXXXXX                 = " << readDWORDTag(io_) << '\n';  // 56
  551|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  552|       |    io_->seekOrThrow(io_->tell() - DWORD * 13, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  553|       |#endif
  554|       |
  555|    664|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  556|       |
  557|    664|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  558|    664|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  559|       |
  560|    664|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  561|       |
  562|    664|  if (divisor) {
  ------------------
  |  Branch (562:7): [True: 475, False: 189]
  ------------------
  563|    475|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  564|    475|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (564:14): [True: 81, False: 394]
  ------------------
  565|    475|  }
  566|    664|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  567|       |
  568|    664|  if (divisor) {
  ------------------
  |  Branch (568:7): [True: 464, False: 200]
  ------------------
  569|    464|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  570|    464|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (570:14): [True: 77, False: 387]
  ------------------
  571|    464|  }
  572|       |
  573|    664|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  574|       |
  575|    664|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (575:12): [True: 149, False: 515]
  ------------------
  576|       |
  577|    664|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (577:12): [True: 138, False: 526]
  ------------------
  578|    664|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  579|    664|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  581|  2.31k|void RiffVideo::readStreamFormat(uint64_t size_) {
  582|       |  // The structure of the strf chunk depends on the media type. Video streams use the BITMAPINFOHEADER structure,
  583|       |  // whereas audio streams use the WAVEFORMATEX structure.
  584|       |
  585|       |#ifdef EXIV2_DEBUG_MESSAGES
  586|       |  if (streamType_ == Audio) {
  587|       |    EXV_INFO << "--> wFormatTag      = " << readWORDTag(io_) << '\n';
  588|       |    EXV_INFO << "--> nChannels       = " << readWORDTag(io_) << '\n';
  589|       |    EXV_INFO << "--> nSamplesPerSec  = " << readDWORDTag(io_) << '\n';
  590|       |    EXV_INFO << "--> nAvgBytesPerSec = " << readDWORDTag(io_) << '\n';
  591|       |    EXV_INFO << "--> nBlockAlign     = " << readWORDTag(io_) << '\n';
  592|       |    EXV_INFO << "--> wBitsPerSample  = " << readWORDTag(io_) << '\n';
  593|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  594|       |      io_->seekOrThrow(io_->tell() - DWORD * 4, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  595|       |  } else if (streamType_ == Video) {
  596|       |    EXV_INFO << "--> biSize            = " << readDWORDTag(io_) << '\n';
  597|       |    EXV_INFO << "--> biWidth           = " << readDWORDTag(io_) << '\n';
  598|       |    EXV_INFO << "--> biHeight          = " << readDWORDTag(io_) << '\n';
  599|       |    EXV_INFO << "--> biPlanes          = " << readWORDTag(io_) << '\n';
  600|       |    EXV_INFO << "--> biBitCount        = " << readWORDTag(io_) << '\n';
  601|       |    EXV_INFO << "--> biCompression     = " << readDWORDTag(io_) << '\n';
  602|       |    EXV_INFO << "--> biSizeImage       = " << readDWORDTag(io_) << '\n';
  603|       |    EXV_INFO << "--> biXPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  604|       |    EXV_INFO << "--> biYPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  605|       |    EXV_INFO << "--> biClrUsed         = " << readDWORDTag(io_) << '\n';
  606|       |    EXV_INFO << "--> biClrImportant    = " << readDWORDTag(io_) << '\n';
  607|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  608|       |      io_->seekOrThrow(io_->tell() - DWORD * 10, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  609|       |  }
  610|       |#endif
  611|       |
  612|  2.31k|  if (streamType_ == Video) {
  ------------------
  |  Branch (612:7): [True: 1.03k, False: 1.28k]
  ------------------
  613|  1.03k|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  614|  1.03k|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  615|  1.03k|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  616|  1.03k|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  617|  1.03k|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  618|  1.03k|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  619|  1.03k|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  620|  1.03k|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  621|  1.03k|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (621:18): [True: 632, False: 403]
  ------------------
  622|    632|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  623|    403|    else
  624|    403|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  625|  1.03k|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (625:18): [True: 214, False: 821]
  ------------------
  626|    214|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  627|    821|    else
  628|    821|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  629|  1.28k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (629:14): [True: 1.27k, False: 10]
  ------------------
  630|  1.27k|    uint16_t format_tag = readWORDTag(io_);
  631|  1.27k|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (631:67): [True: 429, False: 842]
  ------------------
  632|    429|      xmpData_["Xmp.audio.Compressor"] = it->second;
  633|    842|    else
  634|    842|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  635|       |
  636|  1.27k|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  637|  1.27k|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  638|  1.27k|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  639|  1.27k|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  640|  1.27k|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  641|  1.27k|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (641:9): [True: 89, False: 1.18k]
  ------------------
  642|     89|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  643|  1.27k|  } else {
  644|     10|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  645|     10|  }
  646|  2.31k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  648|    216|void RiffVideo::readStreamData(uint64_t size_) const {
  649|    216|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  650|    216|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  652|    332|void RiffVideo::StreamName(uint64_t size_) const {
  653|       |  // This element contains a name for the stream. That stream name should only use plain ASCII, especially not UTF-8.
  654|    332|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  655|    332|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  657|    679|void RiffVideo::readInfoListChunk(uint64_t size_) {
  658|    679|  uint64_t current_size = DWORD;
  659|       |
  660|       |  // Add the elements to a temporary table first, so that we can check
  661|       |  // for duplicates before adding them to xmpData_.
  662|    679|  std::map<std::string, std::string> table;
  663|  3.52k|  while (current_size < size_) {
  ------------------
  |  Branch (663:10): [True: 2.84k, False: 679]
  ------------------
  664|  2.84k|    std::string type = readStringTag(io_);
  665|  2.84k|    size_t size = readDWORDTag(io_);
  666|  2.84k|    std::string content = readStringTag(io_, size);
  667|  2.84k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
  ------------------
  |  Branch (667:50): [True: 398, False: 2.45k]
  ------------------
  668|       |      // Check that it isn't a duplicate.
  669|    398|      Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
  670|    398|      table[it->second] = content;
  671|    398|    }
  672|  2.84k|    current_size += DWORD * 2;
  673|  2.84k|    current_size += size;
  674|  2.84k|  }
  675|       |  // Copy the elements from the temporary table to xmpData_.
  676|    679|  for (const auto& it : table) {
  ------------------
  |  Branch (676:23): [True: 235, False: 679]
  ------------------
  677|    235|    xmpData_[it.first] = it.second;
  678|    235|  }
  679|    679|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  681|    389|void RiffVideo::readMoviList(uint64_t size_) const {
  682|    389|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  683|    389|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  685|    194|void RiffVideo::readVPRPChunk(uint64_t size_) const {
  686|       |#ifdef EXIV2_DEBUG_MESSAGES
  687|       |  EXV_INFO << "--> VideoFormatToken         = " << readDWORDTag(io_) << '\n';
  688|       |  EXV_INFO << "--> VideoStandard            = " << readDWORDTag(io_) << '\n';
  689|       |  EXV_INFO << "--> VerticalRefreshRate      = " << readDWORDTag(io_) << '\n';
  690|       |  EXV_INFO << "--> HTotalInT                = " << readDWORDTag(io_) << '\n';
  691|       |  EXV_INFO << "--> VTotalInLines            = " << readDWORDTag(io_) << '\n';
  692|       |  EXV_INFO << "--> FrameAspectRatio Height  = " << readWORDTag(io_) << '\n';
  693|       |  EXV_INFO << "--> FrameAspectRatio Width   = " << readWORDTag(io_) << '\n';
  694|       |  EXV_INFO << "--> FrameWidthInPixels       = " << readDWORDTag(io_) << '\n';
  695|       |  EXV_INFO << "--> FrameHeightInLines       = " << readDWORDTag(io_) << '\n';
  696|       |  EXV_INFO << "--> CompressedBMHeight       = " << readDWORDTag(io_) << '\n';
  697|       |  EXV_INFO << "--> FieldPerFrame            = " << readDWORDTag(io_) << '\n';
  698|       |  EXV_INFO << "--> CompressedBMWidth        = " << readDWORDTag(io_) << '\n';
  699|       |  EXV_INFO << "--> ValidBMHeight            = " << readDWORDTag(io_) << '\n';
  700|       |  EXV_INFO << "--> ValidBMWidth             = " << readDWORDTag(io_) << '\n';
  701|       |  EXV_INFO << "--> ValidBMXOffset           = " << readDWORDTag(io_) << '\n';
  702|       |  EXV_INFO << "--> ValidBMYOffset           = " << readDWORDTag(io_) << '\n';
  703|       |  EXV_INFO << "--> VideoXOffsetInT          = " << readDWORDTag(io_) << '\n';
  704|       |  EXV_INFO << "--> VideoYValidStartLine     = " << readDWORDTag(io_) << '\n';
  705|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  706|       |    io_->seekOrThrow(io_->tell() - DWORD * 17, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  707|       |#endif
  708|    194|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  709|    194|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  711|    238|void RiffVideo::readIndexChunk(uint64_t size_) const {
  712|       |#ifdef EXIV2_DEBUG_MESSAGES
  713|       |  uint64_t current_size = 0;
  714|       |  while (current_size < size_) {
  715|       |    EXV_DEBUG << "--> Identifier               = " << readStringTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  716|       |              << '\n';
  717|       |    EXV_DEBUG << "--> Flags                    = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  718|       |              << '\n';
  719|       |    EXV_DEBUG << "--> Offset                   = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  720|       |              << '\n';
  721|       |    EXV_DEBUG << "--> Length                   = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  722|       |              << '\n';
  723|       |    current_size += DWORD * 4;
  724|       |  }
  725|       |  if (LogMsg::debug >= LogMsg::level() && LogMsg::handler())
  726|       |    io_->seekOrThrow(io_->tell() - size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  727|       |#endif
  728|    238|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|    238|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  731|    379|void RiffVideo::readDataChunk(uint64_t size_) const {
  732|       |#ifdef EXIV2_DEBUG_MESSAGES
  733|       |  EXV_INFO << "--> Data               = " << readStringTag(io_, static_cast<size_t>(size_)) << '\n';
  734|       |  uint64_t readed_size = size_;
  735|       |  if (size_ % 2 != 0) {
  736|       |    EXV_INFO << "--> pad byte          = " << readStringTag(io_, 1) << '\n';
  737|       |    readed_size += 1;
  738|       |  }
  739|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  740|       |    io_->seekOrThrow(io_->tell() - readed_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  741|       |#endif
  742|    379|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  743|    379|  if (size_ % 2 != 0)
  ------------------
  |  Branch (743:7): [True: 284, False: 95]
  ------------------
  744|    284|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  745|    379|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  747|     35|void RiffVideo::readJunk(uint64_t size_) const {
  748|     35|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  749|     35|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  751|  1.87k|std::string RiffVideo::getStreamType(uint32_t stream) {
  752|  1.87k|  if (stream == 1)
  ------------------
  |  Branch (752:7): [True: 350, False: 1.52k]
  ------------------
  753|    350|    return "Mono";
  754|  1.52k|  if (stream == 2)
  ------------------
  |  Branch (754:7): [True: 76, False: 1.45k]
  ------------------
  755|     76|    return "Stereo";
  756|  1.45k|  if (stream == 5)
  ------------------
  |  Branch (756:7): [True: 286, False: 1.16k]
  ------------------
  757|    286|    return "5.1 Surround Sound";
  758|  1.16k|  if (stream == 7)
  ------------------
  |  Branch (758:7): [True: 224, False: 943]
  ------------------
  759|    224|    return "7.1 Surround Sound";
  760|    943|  return "Mono";
  761|  1.16k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  763|    596|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  764|    596|  if (frame_rate == 0)
  ------------------
  |  Branch (764:7): [True: 0, False: 596]
  ------------------
  765|      0|    return;
  766|       |
  767|    596|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  768|    596|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  769|    596|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  770|    596|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|    872|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|    872|  auto image = std::make_unique<RiffVideo>(std::move(io), params);
  774|    872|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 872]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|    872|  return image;
  778|    872|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  780|  9.76k|bool isRiffType(BasicIo& iIo, bool advance) {
  781|  9.76k|  constexpr int len = 4;
  782|  9.76k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  783|  9.76k|  std::array<byte, len> buf;
  784|  9.76k|  iIo.read(buf.data(), len);
  785|  9.76k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 9.76k]
  |  Branch (785:22): [True: 314, False: 9.44k]
  ------------------
  786|    314|    return false;
  787|    314|  }
  788|  9.44k|  bool matched = buf == RiffVideoId;
  789|  9.44k|  if (!advance || !matched) {
  ------------------
  |  Branch (789:7): [True: 9.44k, False: 0]
  |  Branch (789:19): [True: 0, False: 0]
  ------------------
  790|  9.44k|    iIo.seek(-1 * len, BasicIo::cur);
  791|  9.44k|  }
  792|  9.44k|  return matched;
  793|  9.76k|}

_ZN5Exiv28Rw2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   30|    160|    Image(ImageType::rw2, mdExif | mdIptc | mdXmp, std::move(io), params) {
   31|    160|}  // Rw2Image::Rw2Image
_ZNK5Exiv28Rw2Image8mimeTypeEv:
   33|    594|std::string Rw2Image::mimeType() const {
   34|    594|  return "image/x-panasonic-rw2";
   35|    594|}
_ZNK5Exiv28Rw2Image10pixelWidthEv:
   37|    110|uint32_t Rw2Image::pixelWidth() const {
   38|    110|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.PanasonicRaw.SensorWidth"));
   39|    110|  if (imageWidth == exifData_.end() || imageWidth->count() == 0)
  ------------------
  |  Branch (39:7): [True: 82, False: 28]
  |  Branch (39:7): [True: 97, False: 13]
  |  Branch (39:40): [True: 15, False: 13]
  ------------------
   40|     97|    return 0;
   41|     13|  return imageWidth->toUint32();
   42|    110|}
_ZNK5Exiv28Rw2Image11pixelHeightEv:
   44|    110|uint32_t Rw2Image::pixelHeight() const {
   45|    110|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.PanasonicRaw.SensorHeight"));
   46|    110|  if (imageHeight == exifData_.end() || imageHeight->count() == 0)
  ------------------
  |  Branch (46:7): [True: 79, False: 31]
  |  Branch (46:7): [True: 89, False: 21]
  |  Branch (46:41): [True: 10, False: 21]
  ------------------
   47|     89|    return 0;
   48|     21|  return imageHeight->toUint32();
   49|    110|}
_ZN5Exiv28Rw2Image12readMetadataEv:
   82|    160|void Rw2Image::readMetadata() {
   83|       |#ifdef EXIV2_DEBUG_MESSAGES
   84|       |  std::cerr << "Reading RW2 file " << io_->path() << "\n";
   85|       |#endif
   86|    160|  if (io_->open() != 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 160]
  ------------------
   87|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   88|      0|  }
   89|    160|  IoCloser closer(*io_);
   90|       |  // Ensure that this is the correct image type
   91|    160|  if (!isRw2Type(*io_, false)) {
  ------------------
  |  Branch (91:7): [True: 0, False: 160]
  ------------------
   92|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (92:9): [True: 0, False: 0]
  |  Branch (92:25): [True: 0, False: 0]
  ------------------
   93|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   94|      0|    throw Error(ErrorCode::kerNotAnImage, "RW2");
   95|      0|  }
   96|    160|  clearMetadata();
   97|    160|  const DecodeParams dp(max_recursion_depth_);
   98|    160|  ByteOrder bo = Rw2Parser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size(), dp);
   99|    160|  setByteOrder(bo);
  100|       |
  101|       |  // A lot more metadata is hidden in the embedded preview image
  102|       |  // Todo: This should go into the Rw2Parser, but for that it needs the Image
  103|    160|  PreviewManager loader(*this);
  104|    160|  PreviewPropertiesList list = loader.getPreviewProperties();
  105|       |  // Todo: What if there are more preview images?
  106|    160|  if (list.size() > 1) {
  ------------------
  |  Branch (106:7): [True: 0, False: 160]
  ------------------
  107|      0|#ifndef SUPPRESS_WARNINGS
  108|      0|    EXV_WARNING << "RW2 image contains more than one preview. None used.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  109|      0|#endif
  110|      0|  }
  111|    160|  if (list.size() != 1)
  ------------------
  |  Branch (111:7): [True: 110, False: 50]
  ------------------
  112|    110|    return;
  113|     50|  ExifData exifData;
  114|     50|  PreviewImage preview = loader.getPreviewImage(*list.begin());
  115|     50|  auto image = ImageFactory::open(preview.pData(), preview.size());
  116|     50|  if (!image) {
  ------------------
  |  Branch (116:7): [True: 0, False: 50]
  ------------------
  117|      0|#ifndef SUPPRESS_WARNINGS
  118|      0|    EXV_WARNING << "Failed to open RW2 preview image.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  119|      0|#endif
  120|      0|    return;
  121|      0|  }
  122|     50|  image->readMetadata();
  123|     50|  ExifData& prevData = image->exifData();
  124|     50|  if (!prevData.empty()) {
  ------------------
  |  Branch (124:7): [True: 0, False: 50]
  ------------------
  125|       |    // Filter duplicate tags
  126|      0|    for (const auto& pos : exifData_) {
  ------------------
  |  Branch (126:26): [True: 0, False: 0]
  ------------------
  127|      0|      if (pos.ifdId() == IfdId::panaRawId)
  ------------------
  |  Branch (127:11): [True: 0, False: 0]
  ------------------
  128|      0|        continue;
  129|      0|      auto dup = prevData.findKey(ExifKey(pos.key()));
  130|      0|      if (dup != prevData.end()) {
  ------------------
  |  Branch (130:11): [True: 0, False: 0]
  ------------------
  131|       |#ifdef EXIV2_DEBUG_MESSAGES
  132|       |        std::cerr << "Filtering duplicate tag " << pos.key() << " (values '" << pos.value() << "' and '" << dup->value()
  133|       |                  << "')\n";
  134|       |#endif
  135|      0|        prevData.erase(dup);
  136|      0|      }
  137|      0|    }
  138|      0|  }
  139|       |  // Remove tags not applicable for raw images
  140|     50|  static constexpr auto filteredTags = std::array{
  141|     50|      "Exif.Photo.ComponentsConfiguration",
  142|     50|      "Exif.Photo.CompressedBitsPerPixel",
  143|     50|      "Exif.Panasonic.ColorEffect",
  144|     50|      "Exif.Panasonic.Contrast",
  145|     50|      "Exif.Panasonic.NoiseReduction",
  146|     50|      "Exif.Panasonic.ColorMode",
  147|     50|      "Exif.Panasonic.OpticalZoomMode",
  148|     50|      "Exif.Panasonic.Contrast",
  149|     50|      "Exif.Panasonic.Saturation",
  150|     50|      "Exif.Panasonic.Sharpness",
  151|     50|      "Exif.Panasonic.FilmMode",
  152|     50|      "Exif.Panasonic.SceneMode",
  153|     50|      "Exif.Panasonic.WBRedLevel",
  154|     50|      "Exif.Panasonic.WBGreenLevel",
  155|     50|      "Exif.Panasonic.WBBlueLevel",
  156|     50|      "Exif.Photo.ColorSpace",
  157|     50|      "Exif.Photo.PixelXDimension",
  158|     50|      "Exif.Photo.PixelYDimension",
  159|     50|      "Exif.Photo.SceneType",
  160|     50|      "Exif.Photo.CustomRendered",
  161|     50|      "Exif.Photo.DigitalZoomRatio",
  162|     50|      "Exif.Photo.SceneCaptureType",
  163|     50|      "Exif.Photo.GainControl",
  164|     50|      "Exif.Photo.Contrast",
  165|     50|      "Exif.Photo.Saturation",
  166|     50|      "Exif.Photo.Sharpness",
  167|     50|      "Exif.Image.PrintImageMatching",
  168|     50|      "Exif.Image.YCbCrPositioning",
  169|     50|  };
  170|  1.09k|  for (auto&& filteredTag : filteredTags) {
  ------------------
  |  Branch (170:27): [True: 1.09k, False: 50]
  ------------------
  171|  1.09k|    auto pos = prevData.findKey(ExifKey(filteredTag));
  172|  1.09k|    if (pos != prevData.end()) {
  ------------------
  |  Branch (172:9): [True: 0, False: 1.09k]
  ------------------
  173|       |#ifdef EXIV2_DEBUG_MESSAGES
  174|       |      std::cerr << "Exif tag " << pos->key() << " removed\n";
  175|       |#endif
  176|      0|      prevData.erase(pos);
  177|      0|    }
  178|  1.09k|  }
  179|       |
  180|       |  // Add the remaining tags
  181|     50|  for (const auto& pos : prevData) {
  ------------------
  |  Branch (181:24): [True: 0, False: 50]
  ------------------
  182|      0|    exifData_.add(pos);
  183|      0|  }
  184|       |
  185|     50|}  // Rw2Image::readMetadata
_ZN5Exiv29Rw2Parser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmRKNS_12DecodeParamsE:
  193|    160|                            const DecodeParams& dp) {
  194|    160|  Rw2Header rw2Header;
  195|    160|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::pana, TiffMapping::findDecoder, dp,
  196|    160|                                  &rw2Header);
  197|    160|}
_ZN5Exiv214newRw2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  201|    160|Image::UniquePtr newRw2Instance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  202|    160|  auto image = std::make_unique<Rw2Image>(std::move(io), params);
  203|    160|  if (!image->good()) {
  ------------------
  |  Branch (203:7): [True: 0, False: 160]
  ------------------
  204|      0|    return nullptr;
  205|      0|  }
  206|    160|  return image;
  207|    160|}
_ZN5Exiv29isRw2TypeERNS_7BasicIoEb:
  209|  23.6k|bool isRw2Type(BasicIo& iIo, bool advance) {
  210|  23.6k|  const int32_t len = 24;
  211|  23.6k|  byte buf[len];
  212|  23.6k|  iIo.read(buf, len);
  213|  23.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (213:7): [True: 0, False: 23.6k]
  |  Branch (213:22): [True: 221, False: 23.3k]
  ------------------
  214|    221|    return false;
  215|    221|  }
  216|  23.3k|  Rw2Header header;
  217|  23.3k|  bool rc = header.read(buf, len);
  218|  23.3k|  if (!advance || !rc) {
  ------------------
  |  Branch (218:7): [True: 23.3k, False: 0]
  |  Branch (218:19): [True: 0, False: 0]
  ------------------
  219|  23.3k|    iIo.seek(-len, BasicIo::cur);
  220|  23.3k|  }
  221|  23.3k|  return rc;
  222|  23.6k|}

_ZN5Exiv28Internal9Rw2HeaderC2Ev:
    6|  23.5k|Rw2Header::Rw2Header() : TiffHeaderBase(0x0055, 24, littleEndian, 0x00000018) {
    7|  23.5k|}

_ZN4Safe3addIjEET_S1_S1_:
  137|  17.8k|T add(T summand_1, T summand_2) {
  138|  17.8k|  T res = 0;
  139|  17.8k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 20, False: 17.8k]
  ------------------
  140|     20|    throw std::overflow_error("Overflow in addition");
  141|     20|  }
  142|  17.8k|  return res;
  143|  17.8k|}
_ZN4Safe8Internal20builtin_add_overflowIjEEbT_S2_RS2_:
   96|  17.8k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  17.8k|#if (defined(__GNUC__) || defined(__clang__)) && (__GNUC__ >= 5 || __clang_major__ >= 3)
   98|       |  if constexpr (std::is_same_v<T, int>)
   99|       |    return __builtin_sadd_overflow(summand_1, summand_2, &result);
  100|       |  else if constexpr (std::is_same_v<T, long>)
  101|       |    return __builtin_saddl_overflow(summand_1, summand_2, &result);
  102|       |  else if constexpr (std::is_same_v<T, long long>)
  103|       |    return __builtin_saddll_overflow(summand_1, summand_2, &result);
  104|       |  else if constexpr (std::is_same_v<T, unsigned int>)
  105|  17.8k|    return __builtin_uadd_overflow(summand_1, summand_2, &result);
  106|       |  else if constexpr (std::is_same_v<T, unsigned long>)
  107|       |    return __builtin_uaddl_overflow(summand_1, summand_2, &result);
  108|       |  else if constexpr (std::is_same_v<T, unsigned long long>)
  109|       |    return __builtin_uaddll_overflow(summand_1, summand_2, &result);
  110|       |  else
  111|       |#endif
  112|       |    return fallback_add_overflow(summand_1, summand_2, result);
  113|  17.8k|}
_ZN4Safe3addImEET_S1_S1_:
  137|   663k|T add(T summand_1, T summand_2) {
  138|   663k|  T res = 0;
  139|   663k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 8, False: 663k]
  ------------------
  140|      8|    throw std::overflow_error("Overflow in addition");
  141|      8|  }
  142|   663k|  return res;
  143|   663k|}
_ZN4Safe8Internal20builtin_add_overflowImEEbT_S2_RS2_:
   96|   663k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|   663k|#if (defined(__GNUC__) || defined(__clang__)) && (__GNUC__ >= 5 || __clang_major__ >= 3)
   98|       |  if constexpr (std::is_same_v<T, int>)
   99|       |    return __builtin_sadd_overflow(summand_1, summand_2, &result);
  100|       |  else if constexpr (std::is_same_v<T, long>)
  101|       |    return __builtin_saddl_overflow(summand_1, summand_2, &result);
  102|       |  else if constexpr (std::is_same_v<T, long long>)
  103|       |    return __builtin_saddll_overflow(summand_1, summand_2, &result);
  104|       |  else if constexpr (std::is_same_v<T, unsigned int>)
  105|       |    return __builtin_uadd_overflow(summand_1, summand_2, &result);
  106|       |  else if constexpr (std::is_same_v<T, unsigned long>)
  107|   663k|    return __builtin_uaddl_overflow(summand_1, summand_2, &result);
  108|       |  else if constexpr (std::is_same_v<T, unsigned long long>)
  109|       |    return __builtin_uaddll_overflow(summand_1, summand_2, &result);
  110|       |  else
  111|       |#endif
  112|       |    return fallback_add_overflow(summand_1, summand_2, result);
  113|   663k|}

_ZN5Exiv28Internal17Samsung2MakerNote7tagListEv:
   19|    511|  static constexpr auto tagList() {
   20|    511|    return tagInfo_;
   21|    511|  }
_ZN5Exiv28Internal17Samsung2MakerNote9tagListPwEv:
   23|     20|  static constexpr auto tagListPw() {
   24|     20|    return tagInfoPw_;
   25|     20|  }

_ZN5Exiv28Internal14SigmaMakerNote7tagListEv:
   25|    237|  static constexpr auto tagList() {
   26|    237|    return tagInfo_;
   27|    237|  }

_ZN5Exiv28Internal15sonyTagDecipherEtPKhmPNS0_13TiffComponentE:
 2333|    287|DataBuf sonyTagDecipher(uint16_t tag, const byte* bytes, size_t size, TiffComponent* object) {
 2334|    287|  return sonyTagCipher(tag, bytes, size, object, true);
 2335|    287|}
sonymn_int.cpp:_ZN5Exiv28InternalL13sonyTagCipherEtPKhmPKNS0_13TiffComponentEb:
 2309|    287|                             bool bDecipher) {
 2310|    287|  DataBuf b(bytes, size);  // copy the data
 2311|       |
 2312|       |  // initialize the code table
 2313|    287|  byte code[256];
 2314|  71.7k|  for (uint32_t i = 0; i < 249; i++) {
  ------------------
  |  Branch (2314:24): [True: 71.4k, False: 287]
  ------------------
 2315|  71.4k|    if (bDecipher) {
  ------------------
  |  Branch (2315:9): [True: 71.4k, False: 0]
  ------------------
 2316|  71.4k|      code[(i * i * i) % 249] = static_cast<byte>(i);
 2317|  71.4k|    } else {
 2318|      0|      code[i] = (i * i * i) % 249;
 2319|      0|    }
 2320|  71.4k|  }
 2321|  2.29k|  for (uint32_t i = 249; i < 256; i++) {
  ------------------
  |  Branch (2321:26): [True: 2.00k, False: 287]
  ------------------
 2322|  2.00k|    code[i] = static_cast<byte>(i);
 2323|  2.00k|  }
 2324|       |
 2325|       |  // code byte-by-byte
 2326|  86.8k|  for (uint32_t i = 0; i < size; i++) {
  ------------------
  |  Branch (2326:24): [True: 86.5k, False: 287]
  ------------------
 2327|  86.5k|    b.write_uint8(i, code[bytes[i]]);
 2328|  86.5k|  }
 2329|       |
 2330|    287|  return b;
 2331|    287|}

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  5.73k|  static constexpr auto tagList() {
   30|  5.73k|    return tagInfo_;
   31|  5.73k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    863|  static constexpr auto tagListCs() {
   34|    863|    return tagInfoCs_;
   35|    863|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    274|  static constexpr auto tagListCs2() {
   38|    274|    return tagInfoCs2_;
   39|    274|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  70.7k|  static constexpr auto tagListFp() {
   42|  70.7k|    return tagInfoFp_;
   43|  70.7k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|    550|  static constexpr auto tagListSonyMisc1() {
   46|    550|    return tagInfoSonyMisc1_;
   47|    550|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  1.94k|  static constexpr auto tagListSonyMisc2b() {
   50|  1.94k|    return tagInfoSonyMisc2b_;
   51|  1.94k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  12.4k|  static constexpr auto tagListSonyMisc3c() {
   54|  12.4k|    return tagInfoSonyMisc3c_;
   55|  12.4k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|  13.3k|  static constexpr auto tagListSonySInfo1() {
   58|  13.3k|    return tagInfoSonySInfo1_;
   59|  13.3k|  }

_ZNK5Exiv28Internal13TagVocabularyeqENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   48|  11.2M|bool TagVocabulary::operator==(std::string_view key) const {
   49|  11.2M|  return key.ends_with(voc_);
   50|  11.2M|}
_ZNK5Exiv29GroupInfoeqENS_5IfdIdE:
   68|   148M|bool GroupInfo::operator==(IfdId ifdId) const {
   69|   148M|  return ifdId_ == ifdId;
   70|   148M|}
_ZNK5Exiv29GroupInfoeqERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   72|  53.3M|bool GroupInfo::operator==(const GroupName& groupName) const {
   73|  53.3M|  return groupName == groupName_;
   74|  53.3M|}
_ZN5Exiv28ExifTags7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  108|  11.4k|const TagInfo* ExifTags::tagList(const std::string& groupName) {
  109|  11.4k|  return Internal::tagList(groupName);
  110|  11.4k|}
_ZNK5Exiv27ExifKey4Impl7tagNameEv:
  177|  1.86M|std::string ExifKey::Impl::tagName() const {
  178|  1.86M|  if (tagInfo_ && tagInfo_->tag_ != 0xffff) {
  ------------------
  |  Branch (178:7): [True: 1.86M, False: 0]
  |  Branch (178:19): [True: 1.24M, False: 623k]
  ------------------
  179|  1.24M|    return tagInfo_->name_;
  180|  1.24M|  }
  181|   623k|  return stringFormat("0x{:04x}", tag_);
  ------------------
  |  |   18|   623k|#define stringFormat std::format
  ------------------
  182|  1.86M|}
_ZN5Exiv27ExifKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  184|   810k|void ExifKey::Impl::decomposeKey(const std::string& key) {
  185|       |  // Get the family name, IFD name and tag name parts of the key
  186|   810k|  std::string::size_type pos1 = key.find('.');
  187|   810k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (187:7): [True: 0, False: 810k]
  ------------------
  188|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  189|   810k|  std::string familyName = key.substr(0, pos1);
  190|   810k|  if (familyName != familyName_)
  ------------------
  |  Branch (190:7): [True: 0, False: 810k]
  ------------------
  191|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  192|   810k|  std::string::size_type pos0 = pos1 + 1;
  193|   810k|  pos1 = key.find('.', pos0);
  194|   810k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (194:7): [True: 0, False: 810k]
  ------------------
  195|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  196|   810k|  std::string groupName = key.substr(pos0, pos1 - pos0);
  197|   810k|  if (groupName.empty())
  ------------------
  |  Branch (197:7): [True: 0, False: 810k]
  ------------------
  198|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  199|   810k|  std::string tn = key.substr(pos1 + 1);
  200|   810k|  if (tn.empty())
  ------------------
  |  Branch (200:7): [True: 0, False: 810k]
  ------------------
  201|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  202|       |
  203|       |  // Find IfdId
  204|   810k|  IfdId ifdId = groupId(groupName);
  205|   810k|  if (ifdId == IfdId::ifdIdNotSet)
  ------------------
  |  Branch (205:7): [True: 0, False: 810k]
  ------------------
  206|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  207|   810k|  if (!Internal::isExifIfd(ifdId) && !Internal::isMakerIfd(ifdId)) {
  ------------------
  |  Branch (207:7): [True: 224k, False: 585k]
  |  Branch (207:38): [True: 0, False: 224k]
  ------------------
  208|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  209|      0|  }
  210|       |  // Convert tag
  211|   810k|  uint16_t tag = tagNumber(tn, ifdId);
  212|       |  // Get tag info
  213|   810k|  tagInfo_ = tagInfo(tag, ifdId);
  214|   810k|  if (!tagInfo_)
  ------------------
  |  Branch (214:7): [True: 0, False: 810k]
  ------------------
  215|      0|    throw Error(ErrorCode::kerInvalidKey, key);
  216|       |
  217|   810k|  tag_ = tag;
  218|   810k|  ifdId_ = ifdId;
  219|   810k|  groupName_ = groupName;
  220|       |  // tagName() translates hex tag name (0xabcd) to a real tag name if there is one
  221|   810k|  key_ = familyName + "." + groupName + "." + tagName();
  222|   810k|}
_ZN5Exiv27ExifKey4Impl7makeKeyEtNS_5IfdIdEPKNS_7TagInfoE:
  224|  1.05M|void ExifKey::Impl::makeKey(uint16_t tag, IfdId ifdId, const TagInfo* tagInfo) {
  225|  1.05M|  tagInfo_ = tagInfo;
  226|  1.05M|  tag_ = tag;
  227|  1.05M|  ifdId_ = ifdId;
  228|  1.05M|  key_ = std::string(familyName_) + "." + groupName_ + "." + tagName();
  229|  1.05M|}
_ZN5Exiv27ExifKeyC2EtRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  231|  1.05M|ExifKey::ExifKey(uint16_t tag, const std::string& groupName) : p_(std::make_unique<Impl>()) {
  232|  1.05M|  IfdId ifdId = groupId(groupName);
  233|       |  // Todo: Test if this condition can be removed
  234|  1.05M|  if (!Internal::isExifIfd(ifdId) && !Internal::isMakerIfd(ifdId)) {
  ------------------
  |  Branch (234:7): [True: 428k, False: 625k]
  |  Branch (234:38): [True: 0, False: 428k]
  ------------------
  235|      0|    throw Error(ErrorCode::kerInvalidIfdId, ifdId);
  236|      0|  }
  237|  1.05M|  if (auto ti = tagInfo(tag, ifdId)) {
  ------------------
  |  Branch (237:12): [True: 1.05M, False: 0]
  ------------------
  238|  1.05M|    p_->groupName_ = groupName;
  239|  1.05M|    p_->makeKey(tag, ifdId, ti);
  240|  1.05M|    return;
  241|  1.05M|  }
  242|      0|  throw Error(ErrorCode::kerInvalidIfdId, ifdId);
  243|  1.05M|}
_ZN5Exiv27ExifKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  254|   810k|ExifKey::ExifKey(const std::string& key) : p_(std::make_unique<Impl>()) {
  255|   810k|  p_->decomposeKey(key);
  256|   810k|}
_ZN5Exiv27ExifKeyC2ERKS0_:
  258|  2.22M|ExifKey::ExifKey(const ExifKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  259|  2.22M|}
_ZN5Exiv27ExifKeyD2Ev:
  261|  4.08M|ExifKey::~ExifKey() = default;
_ZNK5Exiv27ExifKey6setIdxEi:
  270|   892k|void ExifKey::setIdx(int idx) const {
  271|   892k|  p_->idx_ = idx;
  272|   892k|}
_ZNK5Exiv27ExifKey3keyEv:
  274|  35.9M|std::string ExifKey::key() const {
  275|  35.9M|  return p_->key_;
  276|  35.9M|}
_ZNK5Exiv27ExifKey9groupNameEv:
  282|   860k|std::string ExifKey::groupName() const {
  283|   860k|  return p_->groupName_;
  284|   860k|}
_ZNK5Exiv27ExifKey13defaultTypeIdEv:
  302|  1.74k|TypeId ExifKey::defaultTypeId() const {
  303|  1.74k|  if (!p_->tagInfo_)
  ------------------
  |  Branch (303:7): [True: 0, False: 1.74k]
  ------------------
  304|      0|    return unknownTag.typeId_;
  305|  1.74k|  return p_->tagInfo_->typeId_;
  306|  1.74k|}
_ZNK5Exiv27ExifKey3tagEv:
  308|   651k|uint16_t ExifKey::tag() const {
  309|   651k|  return p_->tag_;
  310|   651k|}
_ZNK5Exiv27ExifKey5cloneEv:
  312|  2.22M|ExifKey::UniquePtr ExifKey::clone() const {
  313|  2.22M|  return UniquePtr(clone_());
  314|  2.22M|}
_ZNK5Exiv27ExifKey6clone_Ev:
  316|  2.22M|ExifKey* ExifKey::clone_() const {
  317|  2.22M|  return new ExifKey(*this);
  318|  2.22M|}
_ZNK5Exiv27ExifKey5ifdIdEv:
  320|   142k|IfdId ExifKey::ifdId() const {
  321|   142k|  return p_->ifdId_;
  322|   142k|}
_ZNK5Exiv27ExifKey3idxEv:
  324|   142k|int ExifKey::idx() const {
  325|   142k|  return p_->idx_;
  326|   142k|}

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.84M|const TagInfo* ifdTagList() {
 1779|  1.84M|  return ifdTagInfo;
 1780|  1.84M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|  15.1k|const TagInfo* exifTagList() {
 2217|  15.1k|  return exifTagInfo;
 2218|  15.1k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|  2.03k|const TagInfo* gpsTagList() {
 2433|  2.03k|  return gpsTagInfo;
 2434|  2.03k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|    830|const TagInfo* iopTagList() {
 2508|    830|  return iopTagInfo;
 2509|    830|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  11.0k|const TagInfo* mnTagList() {
 2524|  11.0k|  return mnTagInfo;
 2525|  11.0k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|   653k|bool isMakerIfd(IfdId ifdId) {
 2528|   653k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 653k, False: 0]
  ------------------
 2529|   653k|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|   653k|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  1.86M|bool isExifIfd(IfdId ifdId) {
 2534|  1.86M|  switch (ifdId) {
 2535|   456k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 456k, False: 1.40M]
  ------------------
 2536|   465k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 9.35k, False: 1.85M]
  ------------------
 2537|   467k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 1.28k, False: 1.86M]
  ------------------
 2538|   467k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 830, False: 1.86M]
  ------------------
 2539|   559k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 92.0k, False: 1.77M]
  ------------------
 2540|   594k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 35.1k, False: 1.82M]
  ------------------
 2541|   595k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 458, False: 1.86M]
  ------------------
 2542|   595k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 1.86M]
  ------------------
 2543|   766k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 171k, False: 1.69M]
  ------------------
 2544|   836k|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 69.6k, False: 1.79M]
  ------------------
 2545|   955k|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 118k, False: 1.74M]
  ------------------
 2546|  1.09M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 136k, False: 1.72M]
  ------------------
 2547|  1.10M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 14.9k, False: 1.84M]
  ------------------
 2548|  1.12M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 14.1k, False: 1.85M]
  ------------------
 2549|  1.13M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 12.3k, False: 1.85M]
  ------------------
 2550|  1.14M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 12.6k, False: 1.85M]
  ------------------
 2551|  1.15M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 11.9k, False: 1.85M]
  ------------------
 2552|  1.21M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 52.5k, False: 1.81M]
  ------------------
 2553|  1.21M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 873, False: 1.86M]
  ------------------
 2554|  1.21M|      return true;
 2555|   653k|    default:
  ------------------
  |  Branch (2555:5): [True: 653k, False: 1.21M]
  ------------------
 2556|   653k|      return false;
 2557|  1.86M|  }
 2558|  1.86M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  2.67M|const TagInfo* tagList(IfdId ifdId) {
 2569|  2.67M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 2.67M, False: 0]
  ------------------
 2570|  2.67M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 2.67M, False: 0]
  ------------------
 2571|  2.67M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  2.67M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  1.86M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  1.86M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 1.86M, False: 0]
  ------------------
 2577|  1.86M|    int idx = 0;
 2578|  97.4M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 96.7M, False: 623k]
  ------------------
 2579|  96.7M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.24M, False: 95.5M]
  ------------------
 2580|  1.24M|        break;
 2581|  96.7M|    }
 2582|  1.86M|    return ti + idx;
 2583|  1.86M|  }
 2584|      0|  return nullptr;
 2585|  1.86M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   810k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   810k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 810k]
  ------------------
 2589|      0|    return nullptr;
 2590|   810k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 810k, False: 0]
  ------------------
 2591|  25.8M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 25.8M, False: 0]
  ------------------
 2592|  25.8M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 810k, False: 25.0M]
  ------------------
 2593|   810k|        return ti + idx;
 2594|   810k|      }
 2595|  25.8M|    }
 2596|   810k|  }
 2597|      0|  return nullptr;
 2598|   810k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  2.00M|IfdId groupId(const std::string& groupName) {
 2601|  2.00M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 2.00M, False: 0]
  ------------------
 2602|  2.00M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  2.00M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|   912k|const char* groupName(IfdId ifdId) {
 2613|   912k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 912k, False: 0]
  ------------------
 2614|   912k|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|   912k|}
_ZN5Exiv28Internal7fnumberEf:
 2647|     21|float fnumber(float apertureValue) {
 2648|     21|  float result = std::exp2(apertureValue / 2.F);
 2649|     21|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 21]
  ------------------
 2650|      0|    result = 3.5F;
 2651|      0|  }
 2652|     21|  return result;
 2653|     21|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|     21|URational exposureTime(float shutterSpeedValue) {
 2656|     21|  URational ur(1, 1);
 2657|     21|  const double tmp = std::exp2(shutterSpeedValue);
 2658|     21|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 0, False: 21]
  ------------------
 2659|      0|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|      0|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 0, False: 0]
  ------------------
 2662|      0|      ur.second = static_cast<uint32_t>(x);
 2663|      0|    }
 2664|     21|  } else {
 2665|     21|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     21|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 21, False: 0]
  |  Branch (2667:19): [True: 21, False: 0]
  ------------------
 2668|     21|      ur.first = static_cast<uint32_t>(x);
 2669|     21|    }
 2670|     21|  }
 2671|     21|  return ur;
 2672|     21|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   810k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   810k|  auto ti = tagInfo(tagName, ifdId);
 2676|   810k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 810k, False: 0]
  |  Branch (2676:13): [True: 810k, False: 0]
  ------------------
 2677|   810k|    return ti->tag_;
 2678|      0|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 0]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|      0|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|      0|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  11.4k|const TagInfo* tagList(const std::string& groupName) {
 3295|  11.4k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  11.4k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 11.4k]
  |  Branch (3296:14): [True: 0, False: 11.4k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  11.4k|  return ii->tagList_();
 3300|  11.4k|}

_ZNK5Exiv28Internal10TagDetailseqEl:
   50|  5.23M|  bool operator==(int64_t key) const {
   51|  5.23M|    return key == val_;
   52|  5.23M|  }

_ZN5Exiv28TgaImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   22|     10|    Image(ImageType::tga, mdNone, std::move(io), params) {
   23|     10|}
_ZN5Exiv214newTgaInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
   96|     10|Image::UniquePtr newTgaInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
   97|     10|  auto image = std::make_unique<TgaImage>(std::move(io), params);
   98|     10|  if (!image->good()) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  ------------------
   99|     10|    return nullptr;
  100|     10|  }
  101|      0|  return image;
  102|     10|}
_ZN5Exiv29isTgaTypeERNS_7BasicIoEb:
  104|  14.8k|bool isTgaType(BasicIo& iIo, bool /*advance*/) {
  105|       |  // not all TARGA files have a signature string, so first just try to match the file name extension
  106|  14.8k|  const std::string& path = iIo.path();
  107|  14.8k|  if (path.ends_with(".tga") || path.ends_with(".TGA")) {
  ------------------
  |  Branch (107:7): [True: 0, False: 14.8k]
  |  Branch (107:33): [True: 0, False: 14.8k]
  ------------------
  108|      0|    return true;
  109|      0|  }
  110|  14.8k|  byte buf[26];
  111|  14.8k|  const size_t curPos = iIo.tell();
  112|  14.8k|  if (curPos < 26)
  ------------------
  |  Branch (112:7): [True: 14.7k, False: 158]
  ------------------
  113|  14.7k|    return false;
  114|       |
  115|    158|  iIo.seek(-26, BasicIo::end);
  116|    158|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (116:7): [True: 0, False: 158]
  |  Branch (116:22): [True: 0, False: 158]
  ------------------
  117|      0|    return false;
  118|      0|  }
  119|    158|  iIo.read(buf, sizeof(buf));
  120|    158|  if (iIo.error()) {
  ------------------
  |  Branch (120:7): [True: 0, False: 158]
  ------------------
  121|      0|    return false;
  122|      0|  }
  123|       |  // some TARGA files, but not all, have a signature string at the end
  124|    158|  bool matched = (memcmp(buf + 8, "TRUEVISION-XFILE", 16) == 0);
  125|    158|  iIo.seek(curPos, BasicIo::beg);
  126|    158|  return matched;
  127|    158|}

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  5.14M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  5.14M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 5.14M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 1.03M, False: 4.11M]
  |  Branch (42:86): [True: 12.1k, False: 4.10M]
  ------------------
   43|  1.04M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 11.7k, False: 1.03M]
  ------------------
   44|  5.14M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  4.19k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  4.19k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 0, False: 4.19k]
  |  Branch (48:20): [True: 0, False: 4.19k]
  ------------------
   49|      0|    wroteHeader_ = true;
   50|  4.19k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|   327k|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|   327k|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 4.19k, False: 323k]
  |  Branch (53:24): [True: 4.19k, False: 0]
  ------------------
   54|  4.19k|    io_.write(pHeader_, size_);
   55|  4.19k|    wroteHeader_ = true;
   56|  4.19k|  }
   57|   327k|  return io_.write(pData, wcount);
   58|   327k|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  5.26k|int IoWrapper::putb(byte data) {
   61|  5.26k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 5.26k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  5.26k|  return io_.putb(data);
   66|  5.26k|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|  52.5k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|  52.5k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  10.1k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  10.1k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  3.12k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  3.12k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  3.12k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  4.83k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  4.83k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  1.66k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  1.66k|    cfgSelFct_(cfgSelFct),
   99|  1.66k|    arraySet_(arraySet),
  100|  1.66k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  1.66k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  1.37M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  1.37M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  1.37M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  64.4k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  64.4k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  80.6k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  80.6k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  11.7k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  11.7k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  11.7k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  2.81M|int TiffEntryBase::idx() const {
  206|  2.81M|  return idx_;
  207|  2.81M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|  34.3k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|  34.3k|  storage_ = std::move(buf);
  211|  34.3k|  pData_ = storage_->data();
  212|  34.3k|  size_ = storage_->size();
  213|  34.3k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|   888k|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|   888k|  pData_ = pData;
  217|   888k|  size_ = size;
  218|   888k|  storage_ = std::move(storage);
  219|   888k|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 888k]
  ------------------
  220|      0|    size_ = 0;
  221|   888k|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|   135k|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|   135k|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 135k]
  ------------------
  225|      0|    return;
  226|   135k|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 34.0k, False: 101k]
  ------------------
  227|  34.0k|    auto d = std::make_shared<DataBuf>(newSize);
  228|  34.0k|    setData(std::move(d));
  229|  34.0k|  }
  230|   135k|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 34.0k, False: 101k]
  ------------------
  231|  34.0k|    memset(pData_, 0x0, size_);
  232|  34.0k|  }
  233|   135k|  size_ = value->copy(pData_, byteOrder);
  234|   135k|  setValue(std::move(value));
  235|   135k|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  1.03M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  1.03M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 1.03M]
  ------------------
  239|      0|    return;
  240|  1.03M|  tiffType_ = toTiffType(value->typeId());
  241|  1.03M|  count_ = value->count();
  242|  1.03M|  pValue_ = std::move(value);
  243|  1.03M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  10.5k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  10.5k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 697, False: 9.82k]
  |  Branch (246:20): [True: 498, False: 9.32k]
  ------------------
  247|  1.19k|#ifndef SUPPRESS_WARNINGS
  248|  1.19k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.19k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.19k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.19k|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|  1.19k|#endif
  251|  1.19k|    return;
  252|  1.19k|  }
  253|  9.32k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 953, False: 8.36k]
  ------------------
  254|    953|#ifndef SUPPRESS_WARNINGS
  255|    953|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    953|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 953]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    953|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|    953|#endif
  258|    953|    return;
  259|    953|  }
  260|  8.36k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.68k, False: 6.68k]
  ------------------
  261|  1.68k|#ifndef SUPPRESS_WARNINGS
  262|  1.68k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.68k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.68k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.68k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.68k|#endif
  266|  1.68k|    return;
  267|  1.68k|  }
  268|  6.68k|  size_t size = 0;
  269|  41.1k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 34.4k, False: 6.68k]
  ------------------
  270|  34.4k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  34.4k|  }
  272|  6.68k|  const size_t offset = pValue()->toUint32(0);
  273|  6.68k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 597, False: 6.08k]
  |  Branch (273:26): [True: 497, False: 5.58k]
  |  Branch (273:54): [True: 10, False: 5.57k]
  ------------------
  274|  1.10k|#ifndef SUPPRESS_WARNINGS
  275|  1.10k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.10k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.10k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.10k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.10k|#endif
  278|  1.10k|    return;
  279|  1.10k|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  5.57k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 332, False: 5.24k]
  ------------------
  283|    332|#ifndef SUPPRESS_WARNINGS
  284|    332|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    332|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 332]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    332|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    332|#endif
  287|    332|    return;
  288|    332|  }
  289|  5.24k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  5.24k|  sizeDataArea_ = size;
  291|  5.24k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  5.24k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  37.2k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  37.2k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 2.32k, False: 34.9k]
  |  Branch (295:20): [True: 931, False: 33.9k]
  ------------------
  296|  3.25k|#ifndef SUPPRESS_WARNINGS
  297|  3.25k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  3.25k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.25k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.25k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  3.25k|#endif
  300|  3.25k|    return;
  301|  3.25k|  }
  302|  33.9k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 5.06k, False: 28.9k]
  ------------------
  303|  5.06k|#ifndef SUPPRESS_WARNINGS
  304|  5.06k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  5.06k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.06k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.06k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  5.06k|#endif
  308|  5.06k|    return;
  309|  5.06k|  }
  310|  86.1k|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 57.2k, False: 28.9k]
  ------------------
  311|  57.2k|    const size_t offset = pValue()->toUint32(i);
  312|  57.2k|    const size_t size = pSize->toUint32(i);
  313|       |
  314|  57.2k|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 7.63k, False: 49.6k]
  |  Branch (314:28): [True: 5.81k, False: 43.7k]
  |  Branch (314:56): [True: 10, False: 43.7k]
  ------------------
  315|  13.4k|#ifndef SUPPRESS_WARNINGS
  316|  13.4k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  13.4k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13.4k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  13.4k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  13.4k|#endif
  319|  43.7k|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 29.2k, False: 14.5k]
  ------------------
  320|  29.2k|      const byte* pStrip = pData + baseOffset + offset;
  321|  29.2k|      strips_.emplace_back(pStrip, size);
  322|  29.2k|    }
  323|  57.2k|  }
  324|  28.9k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  2.83k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  2.83k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 734, False: 2.09k]
  ------------------
  328|    734|    return 0;
  329|  2.09k|  return pHeader_->ifdOffset();
  330|  2.83k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  5.58k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  5.58k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 1.46k, False: 4.11k]
  |  Branch (333:20): [True: 2.95k, False: 1.16k]
  ------------------
  334|  4.42k|    return imageByteOrder_;
  335|  4.42k|  }
  336|  1.16k|  return pHeader_->byteOrder();
  337|  5.58k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  2.76k|size_t TiffIfdMakernote::mnOffset() const {
  340|  2.76k|  return mnOffset_;
  341|  2.76k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  2.82k|size_t TiffIfdMakernote::baseOffset() const {
  344|  2.82k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 734, False: 2.08k]
  ------------------
  345|    734|    return 0;
  346|  2.08k|  return pHeader_->baseOffset(mnOffset_);
  347|  2.82k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  3.12k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  3.12k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 734, False: 2.39k]
  ------------------
  351|    734|    return true;
  352|  2.39k|  return pHeader_->read(pData, size, byteOrder);
  353|  3.12k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|   769k|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|   769k|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|   769k|  return count_ * TypeInfo::typeSize(typeId);
  375|   769k|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  1.43k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  1.43k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 628, False: 811]
  ------------------
  394|    628|    return true;  // Not a complex array
  395|       |
  396|    811|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|    811|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 460, False: 351]
  ------------------
  398|    460|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|    460|    arrayDef_ = arraySet_[idx].def_;
  400|    460|    defSize_ = arraySet_[idx].defSize_;
  401|    460|  }
  402|    811|  return idx > -1;
  403|  1.43k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  6.49k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  6.49k|  origData_ = const_cast<byte*>(pData());
  407|  6.49k|  origSize_ = TiffEntryBase::doSize();
  408|  6.49k|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|   384k|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|   384k|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|   384k|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|   384k|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|   384k|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|   384k|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 384k]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|   384k|  tp->setStart(pData() + idx);
  429|   384k|  auto s = storage();
  430|   384k|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|   384k|  tp->setElDef(def);
  432|   384k|  tp->setElByteOrder(cfg()->byteOrder_);
  433|   384k|  addChild(std::move(tc));
  434|   384k|  return sz;
  435|   384k|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|   285k|                                      TiffComponent::UniquePtr object) {
  439|   285k|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|   285k|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|   142k|                                        TiffComponent::UniquePtr /*object*/) {
  444|   142k|  return this;
  445|   142k|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|   142k|                                        TiffComponent::UniquePtr object) {
  449|   142k|  tiffPath.pop();
  450|   142k|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|   142k|  TiffComponent* tc = nullptr;
  453|       |  // Try to use an existing component if there is still at least one
  454|       |  // composite tag on the stack or the tag to add is the MakerNote tag.
  455|       |  // This is used to prevent duplicate entries. Sub-IFDs also, but the > 1
  456|       |  // condition takes care of them, see below.
  457|   142k|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 0, False: 142k]
  |  Branch (457:31): [True: 0, False: 142k]
  |  Branch (457:62): [True: 0, False: 0]
  ------------------
  458|      0|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 0, False: 0]
  ------------------
  459|      0|      tc = pNext_.get();
  460|      0|    } else {
  461|      0|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 0, False: 0]
  ------------------
  462|      0|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 0, False: 0]
  |  Branch (462:46): [True: 0, False: 0]
  ------------------
  463|      0|          tc = component.get();
  464|      0|          break;
  465|      0|        }
  466|      0|      }
  467|      0|    }
  468|      0|  }
  469|       |
  470|   142k|  if (tc)
  ------------------
  |  Branch (470:7): [True: 0, False: 142k]
  ------------------
  471|      0|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|   142k|  auto atc = [&] {
  474|   142k|    if (tiffPath.size() == 1 && object) {
  475|   142k|      return std::move(object);
  476|   142k|    }
  477|   142k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   142k|  }();
  479|       |
  480|       |  // Prevent dangling sub-IFD tags: Do not add a sub-IFD component without children.
  481|       |  // Todo: How to check before creating the component?
  482|   142k|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 142k, False: 0]
  |  Branch (482:31): [True: 0, False: 142k]
  ------------------
  483|      0|    return nullptr;
  484|       |
  485|   142k|  tc = [&] {
  486|   142k|    if (tpi.extendedTag() == Tag::next)
  487|   142k|      return this->addNext(std::move(atc));
  488|   142k|    return this->addChild(std::move(atc));
  489|   142k|  }();
  490|   142k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|   142k|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  1.40M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  1.40M|  return doAddChild(std::move(tiffComponent));
  573|  1.40M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|   990k|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|   990k|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|   990k|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  25.9k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  25.9k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  25.9k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 25.9k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  25.9k|  return ifds_.emplace_back(std::move(d)).get();
  589|  25.9k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|   384k|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|   384k|  setDecoded(true);
  604|   384k|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|   384k|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  2.07k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  2.07k|  return doAddNext(std::move(tiffComponent));
  609|  2.07k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  2.07k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  2.07k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 2.07k, False: 0]
  ------------------
  617|  2.07k|    pNext_ = std::move(tiffComponent);
  618|  2.07k|    return pNext_.get();
  619|  2.07k|  }
  620|      0|  return nullptr;
  621|  2.07k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  21.2M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  21.2M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 21.2M, False: 15.0k]
  ------------------
  636|  21.2M|    doAccept(visitor);  // one for NVI :)
  637|  21.2M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  12.5M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  12.5M|  visitor.visitEntry(this);
  641|  12.5M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   171k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   171k|  visitor.visitDataEntry(this);
  645|   171k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  2.26M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  2.26M|  visitor.visitImageEntry(this);
  649|  2.26M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.86M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.86M|  visitor.visitSizeEntry(this);
  653|  2.86M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|   641k|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|   641k|  visitor.visitDirectory(this);
  657|  18.2M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 18.2M, False: 498k]
  ------------------
  658|  18.2M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 143k, False: 18.1M]
  ------------------
  659|   143k|      break;
  660|  18.1M|    component->accept(visitor);
  661|  18.1M|  }
  662|   641k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 494k, False: 147k]
  ------------------
  663|   494k|    visitor.visitDirectoryNext(this);
  664|   641k|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 48.1k, False: 593k]
  ------------------
  665|  48.1k|    pNext_->accept(visitor);
  666|   641k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 480k, False: 161k]
  ------------------
  667|   480k|    visitor.visitDirectoryEnd(this);
  668|   641k|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   148k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   148k|  visitor.visitSubIfd(this);
  672|   463k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 463k, False: 115k]
  ------------------
  673|   463k|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 33.1k, False: 430k]
  ------------------
  674|  33.1k|      break;
  675|   430k|    ifd->accept(visitor);
  676|   430k|  }
  677|   148k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|  56.1k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|  56.1k|  visitor.visitMnEntry(this);
  681|  56.1k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 12.6k, False: 43.5k]
  ------------------
  682|  12.6k|    mn_->accept(visitor);
  683|  56.1k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.13k, False: 55.0k]
  ------------------
  684|  1.13k|    mn_ = nullptr;
  685|  1.13k|  }
  686|       |
  687|  56.1k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  12.6k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  12.6k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 12.6k, False: 0]
  ------------------
  691|  12.6k|    visitor.visitIfdMakernote(this);
  692|  12.6k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 12.2k, False: 362]
  ------------------
  693|  12.2k|    ifd_.accept(visitor);
  694|  12.6k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 12.2k, False: 362]
  |  Branch (694:52): [True: 8.20k, False: 4.08k]
  ------------------
  695|  8.20k|    visitor.visitIfdMakernoteEnd(this);
  696|  12.6k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|  46.0k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|  46.0k|  visitor.visitBinaryArray(this);
  700|  2.45M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 2.45M, False: 45.2k]
  ------------------
  701|  2.45M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 805, False: 2.45M]
  ------------------
  702|    805|      break;
  703|  2.45M|    element->accept(visitor);
  704|  2.45M|  }
  705|  46.0k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 39.3k, False: 6.74k]
  ------------------
  706|  39.3k|    visitor.visitBinaryArrayEnd(this);
  707|  46.0k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  2.48M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  2.48M|  visitor.visitBinaryElement(this);
  711|  2.48M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|   142k|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|   142k|  doEncode(encoder, datum);
  715|   142k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|   101k|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|   101k|  encoder.encodeTiffEntry(this, datum);
  731|   101k|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  17.1k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  17.1k|  encoder.encodeImageEntry(this, datum);
  735|  17.1k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  23.7k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  23.7k|  encoder.encodeSizeEntry(this, datum);
  743|  23.7k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|   188k|size_t TiffComponent::count() const {
  750|   188k|  return doCount();
  751|   188k|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|  4.19k|size_t TiffDirectory::doCount() const {
  754|  4.19k|  return components_.size();
  755|  4.19k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|   184k|size_t TiffEntryBase::doCount() const {
  758|   184k|  return count_;
  759|   184k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|   146k|                            size_t& imageIdx) {
  807|   146k|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|   146k|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  4.19k|                              size_t& imageIdx) {
  812|  4.19k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  4.19k|  const size_t compCount = count();
  816|  4.19k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 4.19k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  4.19k|  size_t sizeNext = 0;
  821|  4.19k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 0, False: 4.19k]
  ------------------
  822|      0|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  4.19k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 0, False: 4.19k]
  |  Branch (825:25): [True: 0, False: 0]
  ------------------
  826|      0|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  4.19k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 0, False: 4.19k]
  ------------------
  830|       |#ifdef EXIV2_DEBUG_MESSAGES
  831|       |    std::cerr << "Directory " << groupName(group()) << " offset is 0x" << std::setw(8) << std::setfill('0') << std::hex
  832|       |              << offset << std::dec << "\n";
  833|       |#endif
  834|      0|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|      0|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  4.19k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 4.19k, False: 0]
  ------------------
  838|       |
  839|       |  // TIFF standard requires IFD entries to be sorted in ascending order by tag.
  840|       |  // Not sorting makernote directories sometimes preserves them better.
  841|  4.19k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 4.19k, False: 0]
  ------------------
  842|  4.19k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  4.19k|  }
  844|       |  // Size of IFD values and additional data
  845|  4.19k|  size_t sizeValue = 0;
  846|  4.19k|  size_t sizeData = 0;
  847|   142k|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 142k, False: 4.19k]
  ------------------
  848|   142k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 10.6k, False: 132k]
  ------------------
  849|  10.6k|      sv += sv & 1;  // Align value to word boundary
  850|  10.6k|      sizeValue += sv;
  851|  10.6k|    }
  852|       |    // Also add the size of data, but only if needed
  853|   142k|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 142k, False: 0]
  ------------------
  854|   142k|      auto sd = component->sizeData();
  855|   142k|      sd += sd & 1;  // Align data to word boundary
  856|   142k|      sizeData += sd;
  857|   142k|    }
  858|   142k|  }
  859|       |
  860|  4.19k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  4.19k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  4.19k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  4.19k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 4.19k, False: 0]
  ------------------
  864|  4.19k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  4.19k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  4.19k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  4.19k|  byte buf[4];
  870|  4.19k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  4.19k|  ioWrapper.write(buf, 2);
  872|  4.19k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|   142k|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 142k, False: 4.19k]
  ------------------
  875|   142k|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|   142k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 10.6k, False: 131k]
  ------------------
  877|  10.6k|      sv += sv & 1;  // Align value to word boundary
  878|  10.6k|      valueIdx += sv;
  879|  10.6k|    }
  880|   142k|    auto sd = component->sizeData();
  881|   142k|    sd += sd & 1;  // Align data to word boundary
  882|   142k|    dataIdx += sd;
  883|   142k|  }
  884|       |  // c) Pointer to the next IFD
  885|  4.19k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 4.14k, False: 50]
  ------------------
  886|  4.14k|    memset(buf, 0x0, 4);
  887|  4.14k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 0, False: 4.14k]
  |  Branch (887:19): [True: 0, False: 0]
  ------------------
  888|      0|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|      0|    }
  890|  4.14k|    ioWrapper.write(buf, 4);
  891|  4.14k|    idx += 4;
  892|  4.14k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  4.19k|  valueIdx = sizeDir;
  896|  4.19k|  dataIdx = sizeDir + sizeValue;
  897|   141k|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 141k, False: 4.19k]
  ------------------
  898|   141k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 10.5k, False: 130k]
  ------------------
  899|  10.5k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  10.5k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  10.5k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 4.18k, False: 6.33k]
  ------------------
  902|  4.18k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  4.18k|        sv += 1;
  904|  4.18k|      }
  905|  10.5k|      idx += sv;
  906|  10.5k|      valueIdx += sv;
  907|  10.5k|    }
  908|   141k|    auto sd = component->sizeData();
  909|   141k|    sd += sd & 1;  // Align data to word boundary
  910|   141k|    dataIdx += sd;
  911|   141k|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  4.19k|  dataIdx = sizeDir + sizeValue;
  915|  4.19k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  4.19k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 0, False: 4.19k]
  |  Branch (918:17): [True: 0, False: 0]
  ------------------
  919|      0|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|      0|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  4.19k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 4.11k, False: 79]
  ------------------
  924|  4.11k|    idx += writeImage(ioWrapper, byteOrder);
  925|  4.11k|  }
  926|       |
  927|  4.19k|  return idx;
  928|  4.19k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|   142k|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|   142k|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|   142k|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 142k]
  ------------------
  934|      0|    return 0;
  935|   142k|  byte buf[8];
  936|   142k|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|   142k|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|   142k|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|   142k|  ioWrapper.write(buf, 8);
  940|   142k|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 10.6k, False: 131k]
  ------------------
  941|  10.6k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  10.6k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  10.6k|    ioWrapper.write(buf, 4);
  944|   131k|  } else {
  945|   131k|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|   131k|#ifndef SUPPRESS_WARNINGS
  947|   131k|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 0, False: 131k]
  ------------------
  948|      0|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  949|      0|    }
  950|   131k|#endif
  951|   131k|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 123k, False: 7.69k]
  ------------------
  952|   123k|      memset(buf, 0x0, 4);
  953|   123k|      ioWrapper.write(buf, 4 - len);
  954|   123k|    }
  955|   131k|  }
  956|   142k|  return 12;
  957|   142k|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|   125k|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|   125k|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 0, False: 125k]
  |  Branch (961:19): [True: 101k, False: 24.3k]
  ------------------
  962|   101k|    return 0;
  963|       |
  964|  24.3k|  DataBuf buf(pValue_->size());
  965|  24.3k|  pValue_->copy(buf.data(), byteOrder);
  966|  24.3k|  ioWrapper.write(buf.c_data(), buf.size());
  967|  24.3k|  return buf.size();
  968|   125k|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  9.54k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  9.54k|  size_t rc = 0;
  972|  9.54k|  switch (tiffType) {
  973|    925|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 925, False: 8.61k]
  ------------------
  974|  2.37k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 1.45k, False: 8.09k]
  ------------------
  975|  2.37k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 4, False: 2.37k]
  ------------------
  976|      4|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  2.37k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  2.37k|      break;
  979|  5.63k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 5.63k, False: 3.90k]
  ------------------
  980|  7.09k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 1.45k, False: 8.08k]
  ------------------
  981|  7.09k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  7.09k|      break;
  983|     75|    default:
  ------------------
  |  Branch (983:5): [True: 75, False: 9.46k]
  ------------------
  984|     75|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  9.54k|  }
  986|  9.46k|  return rc;
  987|  9.54k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  16.6k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  16.6k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  16.6k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 0, False: 16.6k]
  ------------------
 1012|      0|    o2 = Safe::add<size_t>(offset, dataIdx);
 1013|       |#ifdef EXIV2_DEBUG_MESSAGES
 1014|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1015|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1016|       |#endif
 1017|  16.6k|  DataBuf buf(strips_.size() * 4);
 1018|  16.6k|  size_t idx = 0;
 1019|  16.6k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 9.54k, False: 16.6k]
  ------------------
 1020|  9.54k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  9.54k|    const auto sz = Safe::add(off, off & 1);
 1023|  9.54k|    o2 = Safe::add(o2, sz);
 1024|  9.54k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 9.46k, False: 79]
  ------------------
 1025|  9.46k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  9.54k|  }
 1027|  16.6k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  16.6k|  return buf.size();
 1029|  16.6k|}  // TiffImageEntry::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|   145k|                                size_t& imageIdx) const {
 1135|   145k|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|   145k|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  4.11k|                                  size_t& imageIdx) const {
 1140|  4.11k|  size_t len = 0;
 1141|   141k|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 141k, False: 4.11k]
  ------------------
 1142|   141k|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|   141k|  }
 1144|  4.11k|  return len;
 1145|  4.11k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|   124k|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|   124k|  return 0;
 1150|   124k|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  16.5k|                                   size_t& /*imageIdx*/) const {
 1154|  16.5k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  16.5k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 0, False: 16.5k]
  ------------------
 1157|      0|    len = writeImage(ioWrapper, byteOrder);
 1158|      0|  }
 1159|  16.5k|  return len;
 1160|  16.5k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   145k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   145k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   145k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  4.11k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  4.11k|  size_t len = 0;
 1203|  4.11k|  const TiffComponent* pSubIfd = nullptr;
 1204|   141k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 141k, False: 4.11k]
  ------------------
 1205|   141k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 141k]
  ------------------
 1206|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1207|      0|#ifndef SUPPRESS_WARNINGS
 1208|      0|      if (pSubIfd) {
  ------------------
  |  Branch (1208:11): [True: 0, False: 0]
  ------------------
 1209|      0|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1210|      0|      }
 1211|      0|#endif
 1212|      0|      pSubIfd = component.get();
 1213|      0|      continue;
 1214|      0|    }
 1215|   141k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   141k|  }
 1217|  4.11k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 0, False: 4.11k]
  ------------------
 1218|      0|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|      0|  }
 1220|  4.11k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 0, False: 4.11k]
  ------------------
 1221|      0|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|      0|  }
 1223|  4.11k|  return len;
 1224|  4.11k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   124k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   124k|  return 0;
 1228|   124k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  16.5k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  16.5k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 0, False: 16.5k]
  ------------------
 1245|      0|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  16.5k|  size_t len = pValue()->sizeDataArea();
 1248|  16.5k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 1.86k, False: 14.6k]
  ------------------
 1249|       |#ifdef EXIV2_DEBUG_MESSAGES
 1250|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1251|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1252|       |#endif
 1253|  1.86k|    DataBuf buf = pValue()->dataArea();
 1254|  1.86k|    ioWrapper.write(buf.c_data(), buf.size());
 1255|  1.86k|    size_t align = len & 1;  // Align image data to word boundary
 1256|  1.86k|    if (align)
  ------------------
  |  Branch (1256:9): [True: 1.07k, False: 788]
  ------------------
 1257|  1.07k|      ioWrapper.putb(0x0);
 1258|  1.86k|    len += align;
 1259|  14.6k|  } else {
 1260|       |#ifdef EXIV2_DEBUG_MESSAGES
 1261|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1262|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1263|       |#endif
 1264|  14.6k|    len = 0;
 1265|  14.6k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 0, False: 14.6k]
  ------------------
 1266|      0|      ioWrapper.write(f, s);
 1267|      0|      len += s;
 1268|      0|      size_t align = s & 1;  // Align strip data to word boundary
 1269|      0|      if (align)
  ------------------
  |  Branch (1269:11): [True: 0, False: 0]
  ------------------
 1270|      0|        ioWrapper.putb(0x0);
 1271|      0|      len += align;
 1272|      0|    }
 1273|  14.6k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  16.5k|  return len;
 1278|  16.5k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|   578k|size_t TiffComponent::size() const {
 1281|   578k|  return doSize();
 1282|   578k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  1.68M|size_t TiffEntryBase::doSize() const {
 1311|  1.68M|  return size_;
 1312|  1.68M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|  66.9k|size_t TiffImageEntry::doSize() const {
 1315|  66.9k|  return strips_.size() * 4;
 1316|  66.9k|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|   426k|size_t TiffComponent::sizeData() const {
 1370|   426k|  return doSizeData();
 1371|   426k|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|   376k|size_t TiffEntryBase::doSizeData() const {
 1378|   376k|  return 0;
 1379|   376k|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  50.2k|size_t TiffImageEntry::doSizeData() const {
 1382|  50.2k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  50.2k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 0, False: 50.2k]
  ------------------
 1385|      0|    len = sizeImage();
 1386|      0|  }
 1387|  50.2k|  return len;
 1388|  50.2k|}
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  2.00M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  2.00M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  2.00M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 1.19k, False: 2.00M]
  ------------------
 1456|  1.19k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 533, False: 661]
  ------------------
 1457|    533|      ti = comment;
 1458|    533|    }
 1459|  1.19k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  2.00M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 1.10M, False: 899k]
  ------------------
 1463|  1.10M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 472, False: 1.10M]
  |  Branch (1463:26): [True: 12, False: 460]
  |  Branch (1463:58): [True: 183, False: 1.10M]
  |  Branch (1463:75): [True: 10, False: 173]
  ------------------
 1464|     22|    ti = Exiv2::signedByte;
 1465|     22|  }
 1466|  2.00M|  return ti;
 1467|  2.00M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  1.03M|TiffType toTiffType(TypeId typeId) {
 1470|  1.03M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 1.03M]
  ------------------
 1471|      0|#ifndef SUPPRESS_WARNINGS
 1472|      0|    EXV_ERROR << "'" << TypeInfo::typeName(typeId) << "' is not a valid Exif (TIFF) type; using type '"
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1473|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1474|      0|#endif
 1475|      0|    return ttUndefined;
 1476|      0|  }
 1477|  1.03M|  return static_cast<TiffType>(typeId);
 1478|  1.03M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  1.41M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  1.41M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 462k, False: 955k]
  ------------------
 1482|   462k|    return lhs->tag() < rhs->tag();
 1483|   955k|  return lhs->idx() < rhs->idx();
 1484|  1.41M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|   811k|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|   811k|  return std::make_unique<TiffEntry>(tag, group);
 1488|   811k|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  11.7k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  11.7k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  11.7k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|   389k|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|   389k|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|   389k|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|   142k|  auto atc = [&] {
  474|   142k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 142k, False: 0]
  |  Branch (474:33): [True: 0, False: 142k]
  ------------------
  475|      0|      return std::move(object);
  476|      0|    }
  477|   142k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   142k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|   142k|  tc = [&] {
  486|   142k|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 0, False: 142k]
  ------------------
  487|      0|      return this->addNext(std::move(atc));
  488|   142k|    return this->addChild(std::move(atc));
  489|   142k|  }();
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  8.69k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  8.69k|  const TagInfo* tags = [=] {
 1439|  8.69k|    if (group == IfdId::gpsId)
 1440|  8.69k|      return Internal::gpsTagList();
 1441|  8.69k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  8.69k|  }();
 1443|  8.69k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 1.46k, False: 7.23k]
  ------------------
 1444|  60.9k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 60.7k, False: 270]
  ------------------
 1445|  60.7k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 1.19k, False: 59.5k]
  ------------------
 1446|  1.19k|        return tags + idx;
 1447|  7.50k|  return nullptr;
 1448|  8.69k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  8.69k|  const TagInfo* tags = [=] {
 1439|  8.69k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 755, False: 7.94k]
  ------------------
 1440|    755|      return Internal::gpsTagList();
 1441|  7.94k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 709, False: 7.23k]
  ------------------
 1442|  8.69k|  }();

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|   285k|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|   285k|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|   428k|  [[nodiscard]] uint32_t extendedTag() const {
   86|   428k|    return extendedTag_;
   87|   428k|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|   142k|  [[nodiscard]] IfdId group() const {
   90|   142k|    return group_;
   91|   142k|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  1.43M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  1.43M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  1.27M|  void setStart(const byte* pStart) {
  217|  1.27M|    pStart_ = const_cast<byte*>(pStart);
  218|  1.27M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|  26.4M|  [[nodiscard]] uint16_t tag() const {
  241|  26.4M|    return tag_;
  242|  26.4M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  5.80M|  [[nodiscard]] IfdId group() const {
  245|  5.80M|    return group_;
  246|  5.80M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  1.32M|  [[nodiscard]] byte* start() const {
  249|  1.32M|    return pStart_;
  250|  1.32M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|   904k|  void setOffset(size_t offset) {
  417|   904k|    offset_ = offset;
  418|   904k|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|   165k|  [[nodiscard]] TiffType tiffType() const {
  459|   165k|    return tiffType_;
  460|   165k|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  10.6k|  [[nodiscard]] size_t offset() const {
  466|  10.6k|    return offset_;
  467|  10.6k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|   821k|  [[nodiscard]] const byte* pData() const {
  477|   821k|    return pData_;
  478|   821k|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  5.51M|  [[nodiscard]] const Value* pValue() const {
  481|  5.51M|    return pValue_.get();
  482|  5.51M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|   894k|  void setIdx(int idx) {
  502|   894k|    idx_ = idx;
  503|   894k|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|   384k|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|   384k|    return storage_;
  542|   384k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  49.6k|  [[nodiscard]] uint16_t szTag() const {
  624|  49.6k|    return szTag_;
  625|  49.6k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  49.6k|  [[nodiscard]] IfdId szGroup() const {
  628|  49.6k|    return szGroup_;
  629|  49.6k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  56.8k|  [[nodiscard]] uint16_t dtTag() const {
  790|  56.8k|    return dtTag_;
  791|  56.8k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  56.8k|  [[nodiscard]] IfdId dtGroup() const {
  794|  56.8k|    return dtGroup_;
  795|  56.8k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  16.9k|  [[nodiscard]] bool hasNext() const {
  843|  16.9k|    return hasNext_;
  844|  16.9k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  3.12k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  3.12k|    imageByteOrder_ = byteOrder;
 1108|  3.12k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|   969k|  bool operator==(size_t idx) const {
 1218|   969k|    return idx_ == idx;
 1219|   969k|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|   385k|  [[nodiscard]] size_t tagStep() const {
 1235|   385k|    return elDefaultDef_.size(0, group_);
 1236|   385k|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|   388k|  void setDecoded(bool decoded) {
 1311|   388k|    decoded_ = decoded;
 1312|   388k|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  1.54M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  1.54M|    return arrayCfg_;
 1320|  1.54M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|  1.08k|  [[nodiscard]] const ArrayDef* def() const {
 1323|  1.08k|    return arrayDef_;
 1324|  1.08k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  1.08k|  [[nodiscard]] size_t defSize() const {
 1327|  1.08k|    return defSize_;
 1328|  1.08k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|  5.29k|  [[nodiscard]] bool decoded() const {
 1331|  5.29k|    return decoded_;
 1332|  5.29k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|   384k|  void setElDef(const ArrayDef& def) {
 1405|   384k|    elDef_ = def;
 1406|   384k|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|   384k|  void setElByteOrder(ByteOrder byteOrder) {
 1411|   384k|    elByteOrder_ = byteOrder;
 1412|   384k|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|   389k|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|   389k|    return &elDef_;
 1422|   389k|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|   389k|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|   389k|    return elByteOrder_;
 1428|   389k|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  16.0k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  16.0k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  16.0k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    102|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    102|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    102|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     73|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     73|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     73|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    683|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    683|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    683|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    122|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    122|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    122|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    204|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    204|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    204|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    146|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    146|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    146|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  10.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  10.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  10.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  9.36k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  9.36k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  9.36k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.69k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.69k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.69k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.01k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.01k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.01k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.8k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.8k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.8k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  24.3k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  24.3k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  24.3k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  7.01k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  7.01k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  7.01k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  6.07k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  6.07k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  6.07k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.39k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.39k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.39k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.76k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.76k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.76k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.02k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.02k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.02k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    561|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    561|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    561|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  5.75k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  5.75k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  5.75k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  9.18k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  9.18k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  9.18k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    962|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    962|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    962|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    688|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    688|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    688|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    453|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    453|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    453|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    127|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    127|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    127|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    455|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    455|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    455|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    653|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    653|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    653|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.68k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.68k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.68k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.92k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.92k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.92k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    749|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    749|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    749|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    560|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    560|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    560|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.98k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.98k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.98k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.44k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.44k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.44k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.19k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.19k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.19k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.17k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.17k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.17k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    861|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    861|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    861|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    718|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    718|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    718|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.76k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.76k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.76k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  6.15k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  6.15k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  6.15k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    611|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    611|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    611|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    183|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    183|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    183|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    373|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    373|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    373|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    248|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    248|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    248|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    214|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    214|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    214|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    515|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    515|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    515|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    264|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    264|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    264|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     91|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     91|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     91|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    375|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    375|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    375|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    304|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    304|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    304|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    567|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    567|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    567|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    683|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    683|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    683|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    230|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    230|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    230|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     87|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     87|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     87|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    219|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    219|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    219|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    215|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    215|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    215|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    213|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    213|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    213|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    307|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    307|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    307|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    293|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    293|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    293|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     71|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     71|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     71|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    120|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    120|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    120|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    504|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    504|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    504|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    255|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    255|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    255|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    432|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    432|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    432|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     95|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     95|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     95|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     69|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     69|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     69|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     88|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     88|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     88|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    105|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    105|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    105|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    246|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    246|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    246|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    321|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    321|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    321|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    105|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    105|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    105|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  4.15k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  4.15k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  4.15k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  2.71k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  2.71k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  2.71k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    824|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    824|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    824|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    339|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    339|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    339|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    383|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    383|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    383|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.77k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.77k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.77k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  6.48k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  6.48k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  6.48k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    322|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    322|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    322|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    259|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    259|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    259|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     82|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     82|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     82|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    222|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    222|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    222|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     73|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     73|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     73|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     87|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     87|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     87|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    237|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    237|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    237|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    220|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    220|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    220|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     77|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     77|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     77|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     79|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     79|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     79|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    205|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    205|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    205|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     50|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     50|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     50|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    214|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    214|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    214|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     66|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     66|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     66|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     79|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     79|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     79|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    197|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    197|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    197|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    409|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    409|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    409|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     79|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     79|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     79|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     46|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     46|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     46|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    270|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    270|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    270|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     76|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     76|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     76|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     46|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     46|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     46|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     19|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     19|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     19|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     87|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     87|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     87|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     67|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     67|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     67|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     77|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     77|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     77|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    145|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    145|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    145|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    282|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    282|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    282|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     86|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     86|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     86|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    200|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    200|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    200|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     36|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     36|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     36|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    289|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    289|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    289|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    152|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    152|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    152|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     84|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     84|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     84|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    736|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    736|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    736|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     85|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     85|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     85|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    877|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    877|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    877|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    877|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    211|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    211|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    211|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    431|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    431|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    431|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     90|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     90|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     90|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    107|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    107|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    107|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    106|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    106|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    106|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    357|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    357|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    357|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    357|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    173|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    173|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    173|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    175|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    175|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    175|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     63|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     63|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     63|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     84|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     84|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     84|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    113|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    113|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    113|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    113|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     44|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     44|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     44|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     78|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     78|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     78|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     79|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     79|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     79|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     47|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     47|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     47|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     56|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     56|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     56|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    139|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    139|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    139|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     54|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     54|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     54|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     54|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     93|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     93|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     93|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    127|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    127|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    127|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    127|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     38|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     38|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     38|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     38|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    132|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    132|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    132|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    132|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    120|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    120|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    120|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    120|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    163|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    163|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    163|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    163|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    104|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    104|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    104|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    104|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     77|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     77|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     77|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     77|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     47|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     47|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     47|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     47|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     73|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     73|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     73|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     73|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     38|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     38|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     38|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     38|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     14|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     14|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     14|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     14|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     31|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     31|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     31|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     51|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     51|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     51|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     85|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     85|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     85|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     83|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     83|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     83|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     93|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     93|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     93|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     88|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     88|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     75|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     75|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     75|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     75|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     78|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     78|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     78|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    124|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    124|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    124|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    124|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    189|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    189|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    189|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    189|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    100|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    100|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    100|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    100|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    301|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    301|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    301|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    301|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     31|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     31|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     31|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     31|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    115|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    115|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    115|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    115|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    199|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    199|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    199|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    199|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     19|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     19|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     19|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    216|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    216|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    216|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    216|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    349|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    349|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    349|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    349|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     38|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     38|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     38|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     67|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     67|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     67|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     45|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     45|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     45|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     45|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    149|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    149|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    149|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  1.43M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  52.5k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  10.1k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  6.49k|  ~TiffBinaryArray() override = default;

_ZN5Exiv29TiffImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   44|  10.3k|    Image(ImageType::tiff, mdExif | mdIptc | mdXmp, std::move(io), params) {
   45|  10.3k|}  // TiffImage::TiffImage
_ZNK5Exiv29TiffImage8mimeTypeEv:
   61|  25.1k|std::string TiffImage::mimeType() const {
   62|  25.1k|  if (!mimeType_.empty())
  ------------------
  |  Branch (62:7): [True: 16.6k, False: 8.51k]
  ------------------
   63|  16.6k|    return mimeType_;
   64|       |
   65|  8.51k|  mimeType_ = std::string("image/tiff");
   66|  8.51k|  std::string key = "Exif." + primaryGroup() + ".Compression";
   67|  8.51k|  auto md = exifData_.findKey(ExifKey(key));
   68|  8.51k|  if (md != exifData_.end() && md->count() > 0) {
  ------------------
  |  Branch (68:7): [True: 183, False: 8.32k]
  |  Branch (68:7): [True: 133, False: 8.37k]
  |  Branch (68:32): [True: 133, False: 50]
  ------------------
   69|    133|    auto mt = Exiv2::find(mimeTypeList, static_cast<int>(md->toInt64()));
   70|    133|    if (mt)
  ------------------
  |  Branch (70:9): [True: 6, False: 127]
  ------------------
   71|      6|      mimeType_ = mt->type;
   72|    133|  }
   73|  8.51k|  return mimeType_;
   74|  25.1k|}
_ZNK5Exiv29TiffImage12primaryGroupEv:
   76|  10.9k|std::string TiffImage::primaryGroup() const {
   77|  10.9k|  if (!primaryGroup_.empty())
  ------------------
  |  Branch (77:7): [True: 1.23k, False: 9.75k]
  ------------------
   78|  1.23k|    return primaryGroup_;
   79|       |
   80|  9.75k|  static constexpr auto keys = std::array{
   81|  9.75k|      "Exif.Image.NewSubfileType",     "Exif.SubImage1.NewSubfileType", "Exif.SubImage2.NewSubfileType",
   82|  9.75k|      "Exif.SubImage3.NewSubfileType", "Exif.SubImage4.NewSubfileType", "Exif.SubImage5.NewSubfileType",
   83|  9.75k|      "Exif.SubImage6.NewSubfileType", "Exif.SubImage7.NewSubfileType", "Exif.SubImage8.NewSubfileType",
   84|  9.75k|      "Exif.SubImage9.NewSubfileType",
   85|  9.75k|  };
   86|       |  // Find the group of the primary image, default to "Image"
   87|  9.75k|  primaryGroup_ = std::string("Image");
   88|  96.6k|  for (auto i : keys) {
  ------------------
  |  Branch (88:15): [True: 96.6k, False: 9.64k]
  ------------------
   89|  96.6k|    auto md = exifData_.findKey(ExifKey(i));
   90|       |    // Is it the primary image?
   91|  96.6k|    if (md != exifData_.end() && md->count() > 0 && md->toInt64() == 0) {
  ------------------
  |  Branch (91:9): [True: 4.61k, False: 92.0k]
  |  Branch (91:9): [True: 156, False: 96.5k]
  |  Branch (91:34): [True: 4.31k, False: 297]
  |  Branch (91:53): [True: 156, False: 4.15k]
  ------------------
   92|       |      // Sometimes there is a JPEG primary image; that's not our first choice
   93|    156|      primaryGroup_ = md->groupName();
   94|    156|      std::string key = "Exif." + primaryGroup_ + ".JPEGInterchangeFormat";
   95|    156|      if (exifData_.findKey(ExifKey(key)) == exifData_.end())
  ------------------
  |  Branch (95:11): [True: 104, False: 52]
  ------------------
   96|    104|        break;
   97|    156|    }
   98|  96.6k|  }
   99|  9.75k|  return primaryGroup_;
  100|  10.9k|}
_ZNK5Exiv29TiffImage10pixelWidthEv:
  102|  1.24k|uint32_t TiffImage::pixelWidth() const {
  103|  1.24k|  if (pixelWidthPrimary_ != 0) {
  ------------------
  |  Branch (103:7): [True: 0, False: 1.24k]
  ------------------
  104|      0|    return pixelWidthPrimary_;
  105|      0|  }
  106|       |
  107|  1.24k|  ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageWidth"));
  108|  1.24k|  auto imageWidth = exifData_.findKey(key);
  109|  1.24k|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (109:7): [True: 165, False: 1.07k]
  |  Branch (109:7): [True: 46, False: 1.19k]
  |  Branch (109:40): [True: 46, False: 119]
  ------------------
  110|     46|    pixelWidthPrimary_ = imageWidth->toUint32();
  111|     46|  }
  112|  1.24k|  return pixelWidthPrimary_;
  113|  1.24k|}
_ZNK5Exiv29TiffImage11pixelHeightEv:
  115|  1.23k|uint32_t TiffImage::pixelHeight() const {
  116|  1.23k|  if (pixelHeightPrimary_ != 0) {
  ------------------
  |  Branch (116:7): [True: 0, False: 1.23k]
  ------------------
  117|      0|    return pixelHeightPrimary_;
  118|      0|  }
  119|       |
  120|  1.23k|  ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageLength"));
  121|  1.23k|  auto imageHeight = exifData_.findKey(key);
  122|  1.23k|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (122:7): [True: 77, False: 1.15k]
  |  Branch (122:7): [True: 31, False: 1.19k]
  |  Branch (122:41): [True: 31, False: 46]
  ------------------
  123|     31|    pixelHeightPrimary_ = imageHeight->toUint32();
  124|     31|  }
  125|  1.23k|  return pixelHeightPrimary_;
  126|  1.23k|}
_ZN5Exiv29TiffImage12readMetadataEv:
  133|  10.2k|void TiffImage::readMetadata() {
  134|       |#ifdef EXIV2_DEBUG_MESSAGES
  135|       |  std::cerr << "Reading TIFF file " << io_->path() << "\n";
  136|       |#endif
  137|  10.2k|  if (io_->open() != 0) {
  ------------------
  |  Branch (137:7): [True: 0, False: 10.2k]
  ------------------
  138|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  139|      0|  }
  140|       |
  141|  10.2k|  IoCloser closer(*io_);
  142|       |  // Ensure that this is the correct image type
  143|  10.2k|  if (!isTiffType(*io_, false)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 10.2k]
  ------------------
  144|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (144:9): [True: 0, False: 0]
  |  Branch (144:25): [True: 0, False: 0]
  ------------------
  145|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  146|      0|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
  147|      0|  }
  148|  10.2k|  clearMetadata();
  149|       |
  150|  10.2k|  const DecodeParams dp(max_recursion_depth_);
  151|  10.2k|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size(), dp);
  152|  10.2k|  setByteOrder(bo);
  153|       |
  154|       |  // read profile from the metadata
  155|  10.2k|  Exiv2::ExifKey key("Exif.Image.InterColorProfile");
  156|  10.2k|  auto pos = exifData_.findKey(key);
  157|  10.2k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (157:7): [True: 479, False: 9.80k]
  ------------------
  158|    479|    size_t size = pos->count() * pos->typeSize();
  159|    479|    if (size == 0) {
  ------------------
  |  Branch (159:9): [True: 387, False: 92]
  ------------------
  160|    387|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|    387|    }
  162|     92|    iccProfile_.alloc(size);
  163|     92|    pos->copy(iccProfile_.data(), bo);
  164|     92|  }
  165|  10.2k|}
_ZN5Exiv210TiffParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmRKNS_12DecodeParamsE:
  211|  11.4k|                             const DecodeParams& dp) {
  212|  11.4k|  uint32_t root = Tag::root;
  213|       |
  214|       |  // #1402  Fujifilm RAF. Change root when parsing embedded tiff
  215|  11.4k|  Exiv2::ExifKey key("Exif.Image.Make");
  216|  11.4k|  if (exifData.findKey(key) != exifData.end() && exifData.findKey(key)->toString() == "FUJIFILM") {
  ------------------
  |  Branch (216:7): [True: 28, False: 11.3k]
  |  Branch (216:7): [True: 0, False: 11.4k]
  |  Branch (216:50): [True: 0, False: 28]
  ------------------
  217|      0|    root = Tag::fuji;
  218|      0|  }
  219|       |
  220|  11.4k|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, root, TiffMapping::findDecoder, dp);
  221|  11.4k|}  // TiffParser::decode
_ZN5Exiv210TiffParser6encodeERNS_7BasicIoEPKhmNS_9ByteOrderERNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataE:
  224|  4.19k|                               const IptcData& iptcData, const XmpData& xmpData) {
  225|       |  // Delete IFDs which do not occur in TIFF images
  226|  4.19k|  static constexpr auto filteredIfds = std::array{
  227|  4.19k|      IfdId::panaRawId,
  228|  4.19k|  };
  229|  4.19k|  for (auto filteredIfd : filteredIfds) {
  ------------------
  |  Branch (229:25): [True: 4.19k, False: 4.19k]
  ------------------
  230|       |#ifdef EXIV2_DEBUG_MESSAGES
  231|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  232|       |#endif
  233|  4.19k|    exifData.erase(std::remove_if(exifData.begin(), exifData.end(), FindExifdatum(filteredIfd)), exifData.end());
  234|  4.19k|  }
  235|       |
  236|  4.19k|  TiffHeader header(byteOrder);
  237|  4.19k|  return TiffParserWorker::encode(io, pData, size, exifData, iptcData, xmpData, Tag::root, TiffMapping::findEncoder,
  238|  4.19k|                                  &header, nullptr);
  239|  4.19k|}  // TiffParser::encode
_ZN5Exiv215newTiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  243|  10.2k|Image::UniquePtr newTiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  244|  10.2k|  auto image = std::make_unique<TiffImage>(std::move(io), params);
  245|  10.2k|  if (!image->good()) {
  ------------------
  |  Branch (245:7): [True: 0, False: 10.2k]
  ------------------
  246|      0|    return nullptr;
  247|      0|  }
  248|  10.2k|  return image;
  249|  10.2k|}
_ZN5Exiv210isTiffTypeERNS_7BasicIoEb:
  251|   193k|bool isTiffType(BasicIo& iIo, bool advance) {
  252|   193k|  const int32_t len = 8;
  253|   193k|  byte buf[len];
  254|   193k|  iIo.read(buf, len);
  255|   193k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (255:7): [True: 0, False: 193k]
  |  Branch (255:22): [True: 1.10k, False: 192k]
  ------------------
  256|  1.10k|    return false;
  257|  1.10k|  }
  258|   192k|  TiffHeader tiffHeader;
  259|   192k|  bool rc = tiffHeader.read(buf, len);
  260|   192k|  if (!advance || !rc) {
  ------------------
  |  Branch (260:7): [True: 192k, False: 0]
  |  Branch (260:19): [True: 0, False: 0]
  ------------------
  261|   192k|    iIo.seek(-len, BasicIo::cur);
  262|   192k|  }
  263|   192k|  return rc;
  264|   193k|}
_ZNK5Exiv28mimeTypeeqEi:
   53|    786|  bool operator==(int c) const {
   54|    786|    return comp == c;
   55|    786|  }

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|   142k|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|   142k|  return ifdId_ == md.ifdId();
   31|   142k|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|   892k|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|   892k|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|   892k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 11.7k, False: 881k]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  11.7k|    decoderFct = td->decoderFct_;
 1996|  11.7k|  }
 1997|   892k|  return decoderFct;
 1998|   892k|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|   142k|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|   142k|  EncoderFct encoderFct = nullptr;
 2002|   142k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 142k]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|      0|    encoderFct = td->encoderFct_;
 2005|      0|  }
 2006|   142k|  return encoderFct;
 2007|   142k|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  1.40M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  1.40M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  1.40M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  1.40M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 1.20M, False: 206k]
  ------------------
 2014|  1.20M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  1.20M|  }
 2016|  1.40M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 1.40M, False: 258]
  |  Branch (2016:7): [True: 1.39M, False: 9.50k]
  |  Branch (2016:37): [True: 1.39M, False: 9.24k]
  ------------------
 2017|  1.39M|    return i->second(tag, group);
 2018|  1.39M|  }
 2019|       |#ifdef EXIV2_DEBUG_MESSAGES
 2020|       |  if (i == tiffGroupTable_.end())
 2021|       |    std::cerr << "Warning: No TIFF structure entry found for ";
 2022|       |  else
 2023|       |    std::cerr << "Warning: No TIFF component creator found for ";
 2024|       |  std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0') << std::hex << std::right << extendedTag
 2025|       |            << ", group " << groupName(group) << "\n";
 2026|       |#endif
 2027|  9.50k|  return nullptr;
 2028|  1.40M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|   142k|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|   142k|  TiffPath ret;
 2032|   285k|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 285k, Folded]
  ------------------
 2033|   285k|    ret.emplace(extendedTag, group);
 2034|   285k|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|   285k|    assert(ts != tiffTreeTable_.end());
 2036|   285k|    extendedTag = ts->second.second;
 2037|   285k|    group = ts->second.first;
 2038|   285k|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 142k, False: 142k]
  ------------------
 2039|   142k|      break;
 2040|   142k|    }
 2041|   285k|  }
 2042|   142k|  return ret;
 2043|   142k|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2047|  13.2k|                                   TiffHeaderBase* pHeader) {
 2048|       |  // Create standard TIFF header if necessary
 2049|  13.2k|  std::unique_ptr<TiffHeaderBase> ph;
 2050|  13.2k|  if (!pHeader) {
  ------------------
  |  Branch (2050:7): [True: 12.9k, False: 299]
  ------------------
 2051|  12.9k|    ph = std::make_unique<TiffHeader>();
 2052|  12.9k|    pHeader = ph.get();
 2053|  12.9k|  }
 2054|       |
 2055|  13.2k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2055:12): [True: 12.8k, False: 427]
  ------------------
 2056|  12.8k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2057|  12.8k|    rootDir->accept(decoder);
 2058|  12.8k|  }
 2059|  13.2k|  return pHeader->byteOrder();
 2060|       |
 2061|  13.2k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2066|  4.19k|                                     OffsetWriter* pOffsetWriter) {
 2067|       |  /*
 2068|       |     1) parse the binary image, if one is provided, and
 2069|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2070|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2071|       |        writing"). If there is a parsed tree, it is only used to access the
 2072|       |        image data in this case.
 2073|       |   */
 2074|  4.19k|  WriteMethod writeMethod = wmIntrusive;
 2075|  4.19k|  auto parsedTree = parse(pData, size, root, pHeader);
 2076|  4.19k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2077|  4.19k|  if (parsedTree) {
  ------------------
  |  Branch (2077:7): [True: 0, False: 4.19k]
  ------------------
 2078|       |    // Attempt to update existing TIFF components based on metadata entries
 2079|      0|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2080|      0|    parsedTree->accept(encoder);
 2081|      0|    if (!encoder.dirty())
  ------------------
  |  Branch (2081:9): [True: 0, False: 0]
  ------------------
 2082|      0|      writeMethod = wmNonIntrusive;
 2083|      0|  }
 2084|  4.19k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2084:7): [True: 4.19k, False: 0]
  ------------------
 2085|  4.19k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2086|  4.19k|    if (parsedTree) {
  ------------------
  |  Branch (2086:9): [True: 0, False: 4.19k]
  ------------------
 2087|       |      // Copy image tags from the original image to the composite
 2088|      0|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2089|      0|      parsedTree->accept(copier);
 2090|      0|    }
 2091|       |    // Add entries from metadata to composite
 2092|  4.19k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2093|  4.19k|                        findEncoderFct);
 2094|  4.19k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2095|       |    // Write binary representation from the composite tree
 2096|  4.19k|    DataBuf header = pHeader->write();
 2097|  4.19k|    auto tempIo = MemIo();
 2098|  4.19k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2099|  4.19k|    auto imageIdx(std::string::npos);
 2100|  4.19k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2101|  4.19k|    if (pOffsetWriter)
  ------------------
  |  Branch (2101:9): [True: 0, False: 4.19k]
  ------------------
 2102|      0|      pOffsetWriter->writeOffsets(tempIo);
 2103|  4.19k|    io.transfer(tempIo);  // may throw
 2104|  4.19k|#ifndef SUPPRESS_WARNINGS
 2105|  4.19k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  4.19k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.19k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.19k|  LogMsg(LogMsg::info).os()
  ------------------
 2106|  4.19k|#endif
 2107|  4.19k|  }
 2108|      0|#ifndef SUPPRESS_WARNINGS
 2109|      0|  else {
 2110|      0|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|      0|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 0]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|      0|  LogMsg(LogMsg::info).os()
  ------------------
 2111|      0|  }
 2112|  4.19k|#endif
 2113|  4.19k|  return writeMethod;
 2114|  4.19k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2117|  17.4k|                                                 TiffHeaderBase* pHeader) {
 2118|  17.4k|  TiffComponent::UniquePtr rootDir;
 2119|  17.4k|  if (!pData || size == 0)
  ------------------
  |  Branch (2119:7): [True: 4.36k, False: 13.0k]
  |  Branch (2119:17): [True: 0, False: 13.0k]
  ------------------
 2120|  4.36k|    return rootDir;
 2121|  13.0k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2121:7): [True: 132, False: 12.9k]
  |  Branch (2121:38): [True: 118, False: 12.8k]
  ------------------
 2122|    250|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2123|    250|  }
 2124|  12.8k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2125|  12.8k|  if (rootDir) {
  ------------------
  |  Branch (2125:7): [True: 12.8k, False: 0]
  ------------------
 2126|  12.8k|    rootDir->setStart(pData + pHeader->offset());
 2127|  12.8k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2128|  12.8k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2129|  12.8k|    rootDir->accept(reader);
 2130|  12.8k|    reader.postProcess();
 2131|  12.8k|  }
 2132|  12.8k|  return rootDir;
 2133|       |
 2134|  13.0k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2136|  4.19k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2137|  4.19k|  PrimaryGroups ret;
 2138|  4.19k|  if (!pSourceDir)
  ------------------
  |  Branch (2138:7): [True: 4.19k, False: 0]
  ------------------
 2139|  4.19k|    return ret;
 2140|       |
 2141|      0|  static constexpr auto imageGroups = std::array{
 2142|      0|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2143|      0|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2144|      0|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2145|      0|  };
 2146|       |
 2147|      0|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2147:24): [True: 0, False: 0]
  ------------------
 2148|      0|    TiffFinder finder(0x00fe, imageGroup);
 2149|      0|    pSourceDir->accept(finder);
 2150|      0|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2151|      0|    if (!te)
  ------------------
  |  Branch (2151:9): [True: 0, False: 0]
  ------------------
 2152|      0|      continue;
 2153|      0|    const Value* pV = te->pValue();
 2154|      0|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2154:9): [True: 0, False: 0]
  |  Branch (2154:15): [True: 0, False: 0]
  |  Branch (2154:47): [True: 0, False: 0]
  |  Branch (2154:67): [True: 0, False: 0]
  ------------------
 2155|      0|      ret.push_back(te->group());
 2156|      0|    }
 2157|      0|  }
 2158|      0|  return ret;
 2159|  4.19k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2162|   292k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2163|   292k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2165|   230k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2166|   230k|  if (!pData || size < 8)
  ------------------
  |  Branch (2166:7): [True: 0, False: 230k]
  |  Branch (2166:17): [True: 40, False: 230k]
  ------------------
 2167|     40|    return false;
 2168|       |
 2169|   230k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2169:7): [True: 16.3k, False: 213k]
  |  Branch (2169:26): [True: 16.0k, False: 277]
  ------------------
 2170|  16.0k|    byteOrder_ = littleEndian;
 2171|   214k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2171:14): [True: 31.5k, False: 182k]
  |  Branch (2171:33): [True: 31.2k, False: 315]
  ------------------
 2172|  31.2k|    byteOrder_ = bigEndian;
 2173|   183k|  } else {
 2174|   183k|    return false;
 2175|   183k|  }
 2176|  47.3k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2177|  47.3k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2177:7): [True: 47.3k, False: 22]
  |  Branch (2177:19): [True: 47.2k, False: 79]
  |  Branch (2177:33): [True: 2.15k, False: 45.0k]
  ------------------
 2178|  2.15k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2179|  45.1k|  tag_ = t;
 2180|  45.1k|  offset_ = getULong(pData + 4, byteOrder_);
 2181|       |
 2182|  45.1k|  return true;
 2183|  47.3k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2185|  4.19k|DataBuf TiffHeaderBase::write() const {
 2186|  4.19k|  DataBuf buf(8);
 2187|  4.19k|  switch (byteOrder_) {
  ------------------
  |  Branch (2187:11): [True: 4.19k, False: 0]
  ------------------
 2188|  4.19k|    case littleEndian:
  ------------------
  |  Branch (2188:5): [True: 4.19k, False: 0]
  ------------------
 2189|  4.19k|      buf.write_uint8(0, 'I');
 2190|  4.19k|      break;
 2191|      0|    case bigEndian:
  ------------------
  |  Branch (2191:5): [True: 0, False: 4.19k]
  ------------------
 2192|      0|      buf.write_uint8(0, 'M');
 2193|      0|      break;
 2194|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2194:5): [True: 0, False: 4.19k]
  ------------------
 2195|      0|      break;
 2196|  4.19k|  }
 2197|  4.19k|  buf.write_uint8(1, buf.read_uint8(0));
 2198|  4.19k|  buf.write_uint16(2, tag_, byteOrder_);
 2199|  4.19k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2200|  4.19k|  return buf;
 2201|  4.19k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2219|  57.6k|ByteOrder TiffHeaderBase::byteOrder() const {
 2220|  57.6k|  return byteOrder_;
 2221|  57.6k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2223|  11.8k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2224|  11.8k|  byteOrder_ = byteOrder;
 2225|  11.8k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2227|  26.2k|uint32_t TiffHeaderBase::offset() const {
 2228|  26.2k|  return offset_;
 2229|  26.2k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2231|  10.8k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2232|  10.8k|  offset_ = offset;
 2233|  10.8k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2239|  12.3k|uint16_t TiffHeaderBase::tag() const {
 2240|  12.3k|  return tag_;
 2241|  12.3k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2325|   218k|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2326|   218k|  const bool result = isTiffImageTagLookup(tag, group);
 2327|       |#ifdef EXIV2_DEBUG_MESSAGES
 2328|       |  if (result) {
 2329|       |    ExifKey key(tag, groupName(group));
 2330|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2331|       |  } else {
 2332|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2333|       |  }
 2334|       |#endif
 2335|   218k|  return result;
 2336|   218k|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2339|   211k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2340|   211k|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2247|   218k|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2248|   218k|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2248:7): [True: 0, False: 218k]
  ------------------
 2249|      0|    return false;
 2250|      0|  }
 2251|       |  //! List of TIFF image tags
 2252|   218k|  switch (tag) {
 2253|      0|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2253:5): [True: 0, False: 218k]
  ------------------
 2254|      0|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2254:5): [True: 0, False: 218k]
  ------------------
 2255|  8.56k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2255:5): [True: 8.56k, False: 209k]
  ------------------
 2256|  84.2k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2256:5): [True: 75.6k, False: 142k]
  ------------------
 2257|  89.4k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2257:5): [True: 5.18k, False: 213k]
  ------------------
 2258|  89.7k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2258:5): [True: 344, False: 218k]
  ------------------
 2259|  90.1k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2259:5): [True: 324, False: 218k]
  ------------------
 2260|  90.2k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2260:5): [True: 89, False: 218k]
  ------------------
 2261|  99.8k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2261:5): [True: 9.65k, False: 208k]
  ------------------
 2262|  99.9k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2262:5): [True: 124, False: 218k]
  ------------------
 2263|   100k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2263:5): [True: 130, False: 218k]
  ------------------
 2264|   108k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2264:5): [True: 8.64k, False: 209k]
  ------------------
 2265|   108k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2265:5): [True: 202, False: 218k]
  ------------------
 2266|   109k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2266:5): [True: 142, False: 218k]
  ------------------
 2267|   109k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2267:5): [True: 127, False: 218k]
  ------------------
 2268|   109k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2268:5): [True: 246, False: 218k]
  ------------------
 2269|   109k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2269:5): [True: 202, False: 218k]
  ------------------
 2270|   109k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2270:5): [True: 45, False: 218k]
  ------------------
 2271|   109k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2271:5): [True: 119, False: 218k]
  ------------------
 2272|   109k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2272:5): [True: 148, False: 218k]
  ------------------
 2273|   110k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2273:5): [True: 141, False: 218k]
  ------------------
 2274|   110k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2274:5): [True: 159, False: 218k]
  ------------------
 2275|   110k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2275:5): [True: 68, False: 218k]
  ------------------
 2276|   110k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2276:5): [True: 55, False: 218k]
  ------------------
 2277|   111k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2277:5): [True: 690, False: 217k]
  ------------------
 2278|   111k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2278:5): [True: 66, False: 218k]
  ------------------
 2279|   111k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2279:5): [True: 166, False: 218k]
  ------------------
 2280|   111k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2280:5): [True: 82, False: 218k]
  ------------------
 2281|   111k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2281:5): [True: 50, False: 218k]
  ------------------
 2282|   112k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2282:5): [True: 1.39k, False: 217k]
  ------------------
 2283|   113k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2283:5): [True: 828, False: 217k]
  ------------------
 2284|   113k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2284:5): [True: 58, False: 218k]
  ------------------
 2285|   115k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2285:5): [True: 1.36k, False: 217k]
  ------------------
 2286|   116k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2286:5): [True: 906, False: 217k]
  ------------------
 2287|   116k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2287:5): [True: 47, False: 218k]
  ------------------
 2288|   116k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2288:5): [True: 180, False: 218k]
  ------------------
 2289|   116k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2289:5): [True: 62, False: 218k]
  ------------------
 2290|   116k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2290:5): [True: 228, False: 218k]
  ------------------
 2291|   116k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2291:5): [True: 319, False: 218k]
  ------------------
 2292|   116k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2292:5): [True: 102, False: 218k]
  ------------------
 2293|   117k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2293:5): [True: 51, False: 218k]
  ------------------
 2294|   117k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2294:5): [True: 93, False: 218k]
  ------------------
 2295|   117k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 371, False: 218k]
  ------------------
 2296|   117k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2296:5): [True: 44, False: 218k]
  ------------------
 2297|   117k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2297:5): [True: 91, False: 218k]
  ------------------
 2298|   117k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2298:5): [True: 267, False: 218k]
  ------------------
 2299|   120k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2299:5): [True: 2.65k, False: 215k]
  ------------------
 2300|   126k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2300:5): [True: 6.23k, False: 212k]
  ------------------
 2301|   141k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2301:5): [True: 14.4k, False: 204k]
  ------------------
 2302|   141k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2302:5): [True: 118, False: 218k]
  ------------------
 2303|   141k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2303:5): [True: 139, False: 218k]
  ------------------
 2304|   141k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2304:5): [True: 382, False: 218k]
  ------------------
 2305|   142k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2305:5): [True: 198, False: 218k]
  ------------------
 2306|   142k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2306:5): [True: 106, False: 218k]
  ------------------
 2307|   142k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2307:5): [True: 86, False: 218k]
  ------------------
 2308|   142k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2308:5): [True: 312, False: 218k]
  ------------------
 2309|   142k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2309:5): [True: 160, False: 218k]
  ------------------
 2310|   142k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2310:5): [True: 246, False: 218k]
  ------------------
 2311|   143k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2311:5): [True: 227, False: 218k]
  ------------------
 2312|   143k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2312:5): [True: 70, False: 218k]
  ------------------
 2313|   143k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2313:5): [True: 74, False: 218k]
  ------------------
 2314|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2315|   143k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2315:5): [True: 10, False: 218k]
  ------------------
 2316|   143k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2316:5): [True: 71, False: 218k]
  ------------------
 2317|   143k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2317:5): [True: 81, False: 218k]
  ------------------
 2318|   143k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2318:5): [True: 73, False: 218k]
  ------------------
 2319|   143k|      return true;
 2320|  74.8k|    default:
  ------------------
  |  Branch (2320:5): [True: 74.8k, False: 143k]
  ------------------
 2321|  74.8k|      return false;
 2322|   218k|  }
 2323|   218k|}

_ZN5Exiv28Internal13FindExifdatumC2ENS_5IfdIdE:
  359|  4.19k|  explicit FindExifdatum(Exiv2::IfdId ifdId) : ifdId_(ifdId) {
  360|  4.19k|  }
_ZNK5Exiv28Internal17TiffGroupKey_hashclENSt3__14pairIjNS_5IfdIdEEE:
  151|  2.89M|  std::size_t operator()(TiffGroupKey pair) const noexcept {
  152|  2.89M|    return std::hash<uint64_t>{}(static_cast<uint64_t>(pair.first) << 32 | static_cast<uint64_t>(pair.second));
  153|  2.89M|  }
_ZN5Exiv28Internal14TiffHeaderBaseD2Ev:
   49|  12.9k|  virtual ~TiffHeaderBase() = default;

_ZN5Exiv28Internal11TiffVisitor5setGoENS1_7GoEventEb:
   61|   129k|void TiffVisitor::setGo(GoEvent event, bool go) {
   62|   129k|  go_[event] = go;
   63|   129k|}
_ZNK5Exiv28Internal11TiffVisitor2goENS1_7GoEventE:
   65|  43.9M|bool TiffVisitor::go(GoEvent event) const {
   66|  43.9M|  return go_[event];
   67|  43.9M|}
_ZN5Exiv28Internal11TiffVisitor18visitDirectoryNextEPNS0_13TiffDirectoryE:
   69|   494k|void TiffVisitor::visitDirectoryNext(TiffDirectory* /*object*/) {
   70|   494k|}
_ZN5Exiv28Internal11TiffVisitor17visitDirectoryEndEPNS0_13TiffDirectoryE:
   72|   480k|void TiffVisitor::visitDirectoryEnd(TiffDirectory* /*object*/) {
   73|   480k|}
_ZN5Exiv28Internal11TiffVisitor20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
   75|  5.44k|void TiffVisitor::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
   76|  5.44k|}
_ZN5Exiv28Internal11TiffVisitor19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
   78|  39.3k|void TiffVisitor::visitBinaryArrayEnd(TiffBinaryArray* /*object*/) {
   79|  39.3k|}
_ZN5Exiv28Internal10TiffFinder4initEtNS_5IfdIdE:
   81|     38|void TiffFinder::init(uint16_t tag, IfdId group) {
   82|     38|  tag_ = tag;
   83|     38|  group_ = group;
   84|     38|  tiffComponent_ = nullptr;
   85|     38|  setGo(geTraverse, true);
   86|     38|}
_ZN5Exiv28Internal10TiffFinder10findObjectEPNS0_13TiffComponentE:
   88|  18.7M|void TiffFinder::findObject(TiffComponent* object) {
   89|  18.7M|  if (object->tag() == tag_ && object->group() == group_) {
  ------------------
  |  Branch (89:7): [True: 560k, False: 18.1M]
  |  Branch (89:32): [True: 94.7k, False: 465k]
  ------------------
   90|  94.7k|    tiffComponent_ = object;
   91|  94.7k|    setGo(geTraverse, false);
   92|  94.7k|  }
   93|  18.7M|}
_ZN5Exiv28Internal10TiffFinder10visitEntryEPNS0_9TiffEntryE:
   95|  11.1M|void TiffFinder::visitEntry(TiffEntry* object) {
   96|  11.1M|  findObject(object);
   97|  11.1M|}
_ZN5Exiv28Internal10TiffFinder14visitDataEntryEPNS0_13TiffDataEntryE:
   99|   158k|void TiffFinder::visitDataEntry(TiffDataEntry* object) {
  100|   158k|  findObject(object);
  101|   158k|}
_ZN5Exiv28Internal10TiffFinder15visitImageEntryEPNS0_14TiffImageEntryE:
  103|  2.18M|void TiffFinder::visitImageEntry(TiffImageEntry* object) {
  104|  2.18M|  findObject(object);
  105|  2.18M|}
_ZN5Exiv28Internal10TiffFinder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  107|  2.75M|void TiffFinder::visitSizeEntry(TiffSizeEntry* object) {
  108|  2.75M|  findObject(object);
  109|  2.75M|}
_ZN5Exiv28Internal10TiffFinder14visitDirectoryEPNS0_13TiffDirectoryE:
  111|   554k|void TiffFinder::visitDirectory(TiffDirectory* object) {
  112|   554k|  findObject(object);
  113|   554k|}
_ZN5Exiv28Internal10TiffFinder11visitSubIfdEPNS0_10TiffSubIfdE:
  115|   128k|void TiffFinder::visitSubIfd(TiffSubIfd* object) {
  116|   128k|  findObject(object);
  117|   128k|}
_ZN5Exiv28Internal10TiffFinder12visitMnEntryEPNS0_11TiffMnEntryE:
  119|  32.6k|void TiffFinder::visitMnEntry(TiffMnEntry* object) {
  120|  32.6k|  findObject(object);
  121|  32.6k|}
_ZN5Exiv28Internal10TiffFinder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  123|  6.75k|void TiffFinder::visitIfdMakernote(TiffIfdMakernote* object) {
  124|  6.75k|  findObject(object);
  125|  6.75k|}
_ZN5Exiv28Internal10TiffFinder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  127|  26.5k|void TiffFinder::visitBinaryArray(TiffBinaryArray* object) {
  128|  26.5k|  findObject(object);
  129|  26.5k|}
_ZN5Exiv28Internal10TiffFinder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  131|  1.70M|void TiffFinder::visitBinaryElement(TiffBinaryElement* object) {
  132|  1.70M|  findObject(object);
  133|  1.70M|}
_ZN5Exiv28Internal11TiffDecoderC2ERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPNS0_13TiffComponentEPFMS1_FvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSF_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsE:
  195|  12.8k|    exifData_(exifData),
  196|  12.8k|    iptcData_(iptcData),
  197|  12.8k|    xmpData_(xmpData),
  198|  12.8k|    pRoot_(pRoot),
  199|  12.8k|    findDecoderFct_(findDecoderFct),
  200|  12.8k|    max_recursion_depth_(dp.max_recursion_depth()) {
  201|       |  // #1402 Fujifilm RAF. Search for the make
  202|       |  // Find camera make in existing metadata (read from the JPEG)
  203|  12.8k|  ExifKey key("Exif.Image.Make");
  204|  12.8k|  if (exifData_.findKey(key) != exifData_.end()) {
  ------------------
  |  Branch (204:7): [True: 106, False: 12.7k]
  ------------------
  205|    106|    make_ = exifData_.findKey(key)->toString();
  206|  12.7k|  } else {
  207|       |    // Find camera make by looking for tag 0x010f in IFD0
  208|  12.7k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  209|  12.7k|    pRoot_->accept(finder);
  210|  12.7k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  211|  12.7k|    if (te && te->pValue()) {
  ------------------
  |  Branch (211:9): [True: 1.95k, False: 10.7k]
  |  Branch (211:15): [True: 1.93k, False: 19]
  ------------------
  212|  1.93k|      make_ = te->pValue()->toString();
  213|  1.93k|    }
  214|  12.7k|  }
  215|  12.8k|}
_ZN5Exiv28Internal11TiffDecoder10visitEntryEPNS0_9TiffEntryE:
  217|   708k|void TiffDecoder::visitEntry(TiffEntry* object) {
  218|   708k|  decodeTiffEntry(object);
  219|   708k|}
_ZN5Exiv28Internal11TiffDecoder14visitDataEntryEPNS0_13TiffDataEntryE:
  221|  6.17k|void TiffDecoder::visitDataEntry(TiffDataEntry* object) {
  222|  6.17k|  decodeTiffEntry(object);
  223|  6.17k|}
_ZN5Exiv28Internal11TiffDecoder15visitImageEntryEPNS0_14TiffImageEntryE:
  225|  41.1k|void TiffDecoder::visitImageEntry(TiffImageEntry* object) {
  226|  41.1k|  decodeTiffEntry(object);
  227|  41.1k|}
_ZN5Exiv28Internal11TiffDecoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  229|  56.8k|void TiffDecoder::visitSizeEntry(TiffSizeEntry* object) {
  230|  56.8k|  decodeTiffEntry(object);
  231|  56.8k|}
_ZN5Exiv28Internal11TiffDecoder14visitDirectoryEPNS0_13TiffDirectoryE:
  233|  43.5k|void TiffDecoder::visitDirectory(TiffDirectory* /* object */) {
  234|       |  // Nothing to do
  235|  43.5k|}
_ZN5Exiv28Internal11TiffDecoder11visitSubIfdEPNS0_10TiffSubIfdE:
  237|  10.1k|void TiffDecoder::visitSubIfd(TiffSubIfd* object) {
  238|  10.1k|  decodeTiffEntry(object);
  239|  10.1k|}
_ZN5Exiv28Internal11TiffDecoder12visitMnEntryEPNS0_11TiffMnEntryE:
  241|  11.7k|void TiffDecoder::visitMnEntry(TiffMnEntry* object) {
  242|       |  // Always decode binary makernote tag
  243|  11.7k|  decodeTiffEntry(object);
  244|  11.7k|}
_ZN5Exiv28Internal11TiffDecoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  246|  2.76k|void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
  247|  2.76k|  exifData_["Exif.MakerNote.Offset"] = static_cast<uint32_t>(object->mnOffset());
  248|  2.76k|  switch (object->byteOrder()) {
  ------------------
  |  Branch (248:11): [True: 2.76k, False: 0]
  ------------------
  249|  2.62k|    case littleEndian:
  ------------------
  |  Branch (249:5): [True: 2.62k, False: 141]
  ------------------
  250|  2.62k|      exifData_["Exif.MakerNote.ByteOrder"] = "II";
  251|  2.62k|      break;
  252|    141|    case bigEndian:
  ------------------
  |  Branch (252:5): [True: 141, False: 2.62k]
  ------------------
  253|    141|      exifData_["Exif.MakerNote.ByteOrder"] = "MM";
  254|    141|      break;
  255|      0|    case invalidByteOrder:
  ------------------
  |  Branch (255:5): [True: 0, False: 2.76k]
  ------------------
  256|      0|      break;
  257|  2.76k|  }
  258|  2.76k|}
_ZN5Exiv28Internal11TiffDecoder10getObjDataERPKhRmtNS_5IfdIdEPKNS0_13TiffEntryBaseE:
  260|  9.79k|void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
  261|  9.79k|  if (object && object->tag() == tag && object->group() == group) {
  ------------------
  |  Branch (261:7): [True: 9.79k, False: 0]
  |  Branch (261:17): [True: 9.66k, False: 136]
  |  Branch (261:41): [True: 9.66k, False: 0]
  ------------------
  262|  9.66k|    pData = object->pData();
  263|  9.66k|    size = object->size();
  264|  9.66k|    return;
  265|  9.66k|  }
  266|    136|  TiffFinder finder(tag, group);
  267|    136|  pRoot_->accept(finder);
  268|    136|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (268:12): [True: 23, False: 113]
  ------------------
  269|     23|    pData = te->pData();
  270|     23|    size = te->size();
  271|     23|    return;
  272|     23|  }
  273|    136|}
_ZN5Exiv28Internal11TiffDecoder9decodeXmpEPKNS0_13TiffEntryBaseE:
  275|  9.35k|void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
  276|       |  // add Exif tag anyway
  277|  9.35k|  decodeStdTiffEntry(object);
  278|       |
  279|  9.35k|  const byte* pData = nullptr;
  280|  9.35k|  size_t size = 0;
  281|  9.35k|  getObjData(pData, size, 0x02bc, IfdId::ifd0Id, object);
  282|  9.35k|  if (pData) {
  ------------------
  |  Branch (282:7): [True: 9.35k, False: 0]
  ------------------
  283|  9.35k|    std::string xmpPacket;
  284|  9.35k|    xmpPacket.assign(reinterpret_cast<const char*>(pData), size);
  285|  9.35k|    std::string::size_type idx = xmpPacket.find_first_of('<');
  286|  9.35k|    if (idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (286:9): [True: 8.24k, False: 1.11k]
  |  Branch (286:37): [True: 8.20k, False: 39]
  ------------------
  287|  8.20k|#ifndef SUPPRESS_WARNINGS
  288|  8.20k|      EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|  8.20k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.20k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.20k|  LogMsg(LogMsg::warn).os()
  ------------------
  289|  8.20k|#endif
  290|  8.20k|      xmpPacket = xmpPacket.substr(idx);
  291|  8.20k|    }
  292|  9.35k|    const DecodeParams dp(max_recursion_depth_);
  293|  9.35k|    if (XmpParser::decode(xmpData_, xmpPacket, dp)) {
  ------------------
  |  Branch (293:9): [True: 2.86k, False: 6.49k]
  ------------------
  294|  2.86k|#ifndef SUPPRESS_WARNINGS
  295|  2.86k|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  2.86k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.86k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.86k|  LogMsg(LogMsg::warn).os()
  ------------------
  296|  2.86k|#endif
  297|  2.86k|    }
  298|  9.35k|  }
  299|  9.35k|}  // TiffDecoder::decodeXmp
_ZN5Exiv28Internal11TiffDecoder10decodeIptcEPKNS0_13TiffEntryBaseE:
  301|    459|void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
  302|       |  // add Exif tag anyway
  303|    459|  decodeStdTiffEntry(object);
  304|       |
  305|       |  // All tags are read at this point, so the first time we come here,
  306|       |  // find the relevant IPTC tag and decode IPTC if found
  307|    459|  if (decodedIptc_) {
  ------------------
  |  Branch (307:7): [True: 149, False: 310]
  ------------------
  308|    149|    return;
  309|    149|  }
  310|    310|  decodedIptc_ = true;
  311|       |  // 1st choice: IPTCNAA
  312|    310|  const byte* pData = nullptr;
  313|    310|  size_t size = 0;
  314|    310|  getObjData(pData, size, 0x83bb, IfdId::ifd0Id, object);
  315|    310|  if (pData) {
  ------------------
  |  Branch (315:7): [True: 272, False: 38]
  ------------------
  316|    272|    if (0 == IptcParser::decode(iptcData_, pData, size)) {
  ------------------
  |  Branch (316:9): [True: 180, False: 92]
  ------------------
  317|    180|      return;
  318|    180|    }
  319|     92|#ifndef SUPPRESS_WARNINGS
  320|     92|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x83bb\n";
  ------------------
  |  |  138|     92|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 92]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     92|  LogMsg(LogMsg::warn).os()
  ------------------
  321|       |
  322|     92|#endif
  323|     92|  }
  324|       |
  325|       |  // 2nd choice if no IPTCNAA record found or failed to decode it:
  326|       |  // ImageResources
  327|    130|  pData = nullptr;
  328|    130|  size = 0;
  329|    130|  getObjData(pData, size, 0x8649, IfdId::ifd0Id, object);
  330|    130|  if (pData) {
  ------------------
  |  Branch (330:7): [True: 45, False: 85]
  ------------------
  331|     45|    const byte* record = nullptr;
  332|     45|    uint32_t sizeHdr = 0;
  333|     45|    uint32_t sizeData = 0;
  334|     45|    if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {
  ------------------
  |  Branch (334:9): [True: 45, False: 0]
  ------------------
  335|     45|      return;
  336|     45|    }
  337|      0|    if (0 == IptcParser::decode(iptcData_, record + sizeHdr, sizeData)) {
  ------------------
  |  Branch (337:9): [True: 0, False: 0]
  ------------------
  338|      0|      return;
  339|      0|    }
  340|      0|#ifndef SUPPRESS_WARNINGS
  341|      0|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x8649\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  342|       |
  343|      0|#endif
  344|      0|  }
  345|    130|}  // TiffMetadataDecoder::decodeIptc
_ZN5Exiv28Internal11TiffDecoder17decodeCanonAFInfoEPKNS0_13TiffEntryBaseE:
  353|  1.92k|void TiffDecoder::decodeCanonAFInfo(const TiffEntryBase* object) {
  354|       |  // report Exif.Canon.AFInfo as usual
  355|  1.92k|  TiffDecoder::decodeStdTiffEntry(object);
  356|  1.92k|  if (object->pValue()->count() < 3 || object->pValue()->typeId() != unsignedShort)
  ------------------
  |  Branch (356:7): [True: 314, False: 1.61k]
  |  Branch (356:40): [True: 138, False: 1.47k]
  ------------------
  357|    452|    return;  // insufficient data
  358|       |
  359|       |  // create vector of signedShorts from unsignedShorts in Exif.Canon.AFInfo
  360|  1.47k|  std::vector<int16_t> ints;
  361|  1.47k|  std::vector<uint16_t> uint;
  362|   975k|  for (size_t i = 0; i < object->pValue()->count(); i++) {
  ------------------
  |  Branch (362:22): [True: 973k, False: 1.47k]
  ------------------
  363|   973k|    ints.push_back(object->pValue()->toInt64(i));
  364|   973k|    uint.push_back(object->pValue()->toUint32(i));
  365|   973k|  }
  366|       |  // Check this is AFInfo2 (ints[0] = bytes in object)
  367|  1.47k|  if (ints.front() != static_cast<int16_t>(object->pValue()->count()) * 2)
  ------------------
  |  Branch (367:7): [True: 173, False: 1.30k]
  ------------------
  368|    173|    return;
  369|       |
  370|  1.30k|  std::string familyGroup(std::string("Exif.") + groupName(object->group()) + ".");
  371|       |
  372|  1.30k|  const uint16_t nPoints = uint.at(2);
  373|  1.30k|  const uint16_t nMasks = (nPoints + 15) / (sizeof(uint16_t) * 8);
  374|  1.30k|  int nStart = 0;
  375|       |
  376|  1.30k|  const std::tuple<uint16_t, uint16_t, bool> records[] = {
  377|  1.30k|      {0x2600, 1, true},        // AFInfoSize
  378|  1.30k|      {0x2601, 1, true},        // AFAreaMode
  379|  1.30k|      {0x2602, 1, true},        // AFNumPoints
  380|  1.30k|      {0x2603, 1, true},        // AFValidPoints
  381|  1.30k|      {0x2604, 1, true},        // AFCanonImageWidth
  382|  1.30k|      {0x2605, 1, true},        // AFCanonImageHeight
  383|  1.30k|      {0x2606, 1, true},        // AFImageWidth"
  384|  1.30k|      {0x2607, 1, true},        // AFImageHeight
  385|  1.30k|      {0x2608, nPoints, true},  // AFAreaWidths
  386|  1.30k|      {0x2609, nPoints, true},  // AFAreaHeights
  387|  1.30k|      {0x260a, nPoints, true},  // AFXPositions
  388|  1.30k|      {0x260b, nPoints, true},  // AFYPositions
  389|  1.30k|      {0x260c, nMasks, false},  // AFPointsInFocus
  390|  1.30k|      {0x260d, nMasks, false},  // AFPointsSelected
  391|  1.30k|      {0x260e, nMasks, false},  // AFPointsUnusable
  392|  1.30k|  };
  393|       |  // check we have enough data!
  394|  1.30k|  uint16_t count = 0;
  395|  17.5k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (395:41): [True: 17.5k, False: 764]
  ------------------
  396|  17.5k|    count += size;
  397|  17.5k|    if (count > ints.size())
  ------------------
  |  Branch (397:9): [True: 537, False: 17.0k]
  ------------------
  398|    537|      return;
  399|  17.5k|  }
  400|       |
  401|  11.4k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (401:41): [True: 11.4k, False: 764]
  ------------------
  402|  11.4k|    auto pTags = ExifTags::tagList("Canon");
  403|  11.4k|    if (auto pTag = findTag(pTags, tag)) {
  ------------------
  |  Branch (403:14): [True: 11.4k, False: 0]
  ------------------
  404|  11.4k|      auto v = Exiv2::Value::create(bSigned ? Exiv2::signedShort : Exiv2::unsignedShort);
  ------------------
  |  Branch (404:37): [True: 9.16k, False: 2.28k]
  ------------------
  405|  11.4k|      std::string s;
  406|  11.4k|      if (bSigned) {
  ------------------
  |  Branch (406:11): [True: 9.16k, False: 2.28k]
  ------------------
  407|   262k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (407:30): [True: 253k, False: 9.16k]
  ------------------
  408|   253k|          s += stringFormat(" {}", ints.at(nStart++));
  ------------------
  |  |   18|   253k|#define stringFormat std::format
  ------------------
  409|  9.16k|      } else {
  410|  5.24k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (410:30): [True: 2.96k, False: 2.28k]
  ------------------
  411|  2.96k|          s += stringFormat(" {}", uint.at(nStart++));
  ------------------
  |  |   18|  2.96k|#define stringFormat std::format
  ------------------
  412|  2.28k|      }
  413|       |
  414|  11.4k|      v->read(s);
  415|  11.4k|      exifData_[familyGroup + pTag->name_] = *v;
  416|  11.4k|    }
  417|  11.4k|  }
  418|    764|}
_ZN5Exiv28Internal11TiffDecoder15decodeTiffEntryEPKNS0_13TiffEntryBaseE:
  420|  1.23M|void TiffDecoder::decodeTiffEntry(const TiffEntryBase* object) {
  421|       |  // Don't decode the entry if value is not set
  422|  1.23M|  if (!object->pValue())
  ------------------
  |  Branch (422:7): [True: 337k, False: 892k]
  ------------------
  423|   337k|    return;
  424|       |
  425|       |  // skip decoding if decoderFct == 0
  426|   892k|  if (auto decoderFct = findDecoderFct_(make_, object->tag(), object->group()))
  ------------------
  |  Branch (426:12): [True: 892k, False: 0]
  ------------------
  427|   892k|    std::invoke(decoderFct, *this, object);
  428|   892k|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder18decodeStdTiffEntryEPKNS0_13TiffEntryBaseE:
  430|   892k|void TiffDecoder::decodeStdTiffEntry(const TiffEntryBase* object) {
  431|   892k|  ExifKey key(object->tag(), groupName(object->group()));
  432|   892k|  key.setIdx(object->idx());
  433|   892k|  exifData_.add(key, object->pValue());
  434|       |
  435|   892k|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  437|  6.49k|void TiffDecoder::visitBinaryArray(TiffBinaryArray* object) {
  438|  6.49k|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (438:7): [True: 1.20k, False: 5.29k]
  |  Branch (438:25): [True: 4.20k, False: 1.08k]
  ------------------
  439|  5.40k|    decodeTiffEntry(object);
  440|  5.40k|  }
  441|  6.49k|}
_ZN5Exiv28Internal11TiffDecoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  443|   389k|void TiffDecoder::visitBinaryElement(TiffBinaryElement* object) {
  444|   389k|  decodeTiffEntry(object);
  445|   389k|}
_ZN5Exiv28Internal11TiffEncoderC2ENS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEPNS0_13TiffComponentEbNSt3__16vectorINS_5IfdIdENSB_9allocatorISD_EEEEPKNS0_14TiffHeaderBaseEPFMS1_FvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSB_17basic_string_viewIcNSB_11char_traitsIcEEEEjSD_E:
  450|  4.19k|    exifData_(std::move(exifData)),
  451|  4.19k|    iptcData_(iptcData),
  452|  4.19k|    xmpData_(xmpData),
  453|  4.19k|    pHeader_(pHeader),
  454|  4.19k|    pRoot_(pRoot),
  455|  4.19k|    isNewImage_(isNewImage),
  456|  4.19k|    pPrimaryGroups_(std::move(pPrimaryGroups)),
  457|  4.19k|    byteOrder_(pHeader->byteOrder()),
  458|  4.19k|    origByteOrder_(byteOrder_),
  459|  4.19k|    findEncoderFct_(findEncoderFct) {
  460|  4.19k|  encodeIptc();
  461|  4.19k|  encodeXmp();
  462|       |
  463|       |  // Find camera make
  464|  4.19k|  ExifKey key("Exif.Image.Make");
  465|  4.19k|  if (auto pos = exifData_.findKey(key); pos != exifData_.end()) {
  ------------------
  |  Branch (465:42): [True: 0, False: 4.19k]
  ------------------
  466|      0|    make_ = pos->toString();
  467|      0|  }
  468|  4.19k|  if (make_.empty() && pRoot_) {
  ------------------
  |  Branch (468:7): [True: 4.19k, False: 0]
  |  Branch (468:24): [True: 4.19k, False: 0]
  ------------------
  469|  4.19k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  470|  4.19k|    pRoot_->accept(finder);
  471|  4.19k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  472|  4.19k|    if (te && te->pValue()) {
  ------------------
  |  Branch (472:9): [True: 0, False: 4.19k]
  |  Branch (472:15): [True: 0, False: 0]
  ------------------
  473|      0|      make_ = te->pValue()->toString();
  474|      0|    }
  475|  4.19k|  }
  476|  4.19k|}
_ZN5Exiv28Internal11TiffEncoder10encodeIptcEv:
  478|  4.19k|void TiffEncoder::encodeIptc() {
  479|       |  // Update IPTCNAA Exif tag, if it exists. Delete the tag if there
  480|       |  // is no IPTC data anymore.
  481|       |  // If there is new IPTC data and Exif.Image.ImageResources does
  482|       |  // not exist, create a new IPTCNAA Exif tag.
  483|  4.19k|  bool del = false;
  484|  4.19k|  ExifKey iptcNaaKey("Exif.Image.IPTCNAA");
  485|  4.19k|  auto pos = exifData_.findKey(iptcNaaKey);
  486|  4.19k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (486:7): [True: 0, False: 4.19k]
  ------------------
  487|      0|    iptcNaaKey.setIdx(pos->idx());
  488|      0|    exifData_.erase(pos);
  489|      0|    del = true;
  490|      0|  }
  491|  4.19k|  DataBuf rawIptc = IptcParser::encode(iptcData_);
  492|  4.19k|  ExifKey irbKey("Exif.Image.ImageResources");
  493|  4.19k|  pos = exifData_.findKey(irbKey);
  494|  4.19k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (494:7): [True: 0, False: 4.19k]
  ------------------
  495|      0|    irbKey.setIdx(pos->idx());
  496|      0|  }
  497|  4.19k|  if (!rawIptc.empty() && (del || pos == exifData_.end())) {
  ------------------
  |  Branch (497:7): [True: 0, False: 4.19k]
  |  Branch (497:7): [True: 0, False: 4.19k]
  |  Branch (497:28): [True: 0, False: 0]
  |  Branch (497:35): [True: 0, False: 0]
  ------------------
  498|      0|    auto value = Value::create(unsignedLong);
  499|      0|    DataBuf buf;
  500|      0|    if (rawIptc.size() % 4 != 0) {
  ------------------
  |  Branch (500:9): [True: 0, False: 0]
  ------------------
  501|       |      // Pad the last unsignedLong value with 0s
  502|      0|      buf.alloc(((rawIptc.size() / 4) * 4) + 4);
  503|      0|      std::move(rawIptc.begin(), rawIptc.end(), buf.begin());
  504|      0|    } else {
  505|      0|      buf = std::move(rawIptc);  // Note: This resets rawIptc
  506|      0|    }
  507|      0|    value->read(buf.data(), buf.size(), byteOrder_);
  508|      0|    Exifdatum iptcDatum(iptcNaaKey, value.get());
  509|      0|    exifData_.add(iptcDatum);
  510|      0|    pos = exifData_.findKey(irbKey);  // needed after add()
  511|      0|  }
  512|       |  // Also update IPTC IRB in Exif.Image.ImageResources if it exists,
  513|       |  // but don't create it if not.
  514|  4.19k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (514:7): [True: 0, False: 4.19k]
  ------------------
  515|      0|    DataBuf irbBuf(pos->value().size());
  516|      0|    pos->value().copy(irbBuf.data(), invalidByteOrder);
  517|      0|    irbBuf = Photoshop::setIptcIrb(irbBuf.c_data(), irbBuf.size(), iptcData_);
  518|      0|    exifData_.erase(pos);
  519|      0|    if (!irbBuf.empty()) {
  ------------------
  |  Branch (519:9): [True: 0, False: 0]
  ------------------
  520|      0|      auto value = Value::create(unsignedByte);
  521|      0|      value->read(irbBuf.data(), irbBuf.size(), invalidByteOrder);
  522|      0|      Exifdatum iptcDatum(irbKey, value.get());
  523|      0|      exifData_.add(iptcDatum);
  524|      0|    }
  525|      0|  }
  526|  4.19k|}  // TiffEncoder::encodeIptc
_ZN5Exiv28Internal11TiffEncoder9encodeXmpEv:
  528|  4.19k|void TiffEncoder::encodeXmp() {
  529|  4.19k|#ifdef EXV_HAVE_XMP_TOOLKIT
  530|  4.19k|  ExifKey xmpKey("Exif.Image.XMLPacket");
  531|       |  // Remove any existing XMP Exif tag
  532|  4.19k|  if (auto pos = exifData_.findKey(xmpKey); pos != exifData_.end()) {
  ------------------
  |  Branch (532:45): [True: 0, False: 4.19k]
  ------------------
  533|      0|    xmpKey.setIdx(pos->idx());
  534|      0|    exifData_.erase(pos);
  535|      0|  }
  536|  4.19k|  std::string xmpPacket;
  537|  4.19k|  if (xmpData_.usePacket()) {
  ------------------
  |  Branch (537:7): [True: 0, False: 4.19k]
  ------------------
  538|      0|    xmpPacket = xmpData_.xmpPacket();
  539|  4.19k|  } else {
  540|  4.19k|    if (XmpParser::encode(xmpPacket, xmpData_) > 1) {
  ------------------
  |  Branch (540:9): [True: 0, False: 4.19k]
  ------------------
  541|      0|#ifndef SUPPRESS_WARNINGS
  542|      0|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  543|      0|#endif
  544|      0|    }
  545|  4.19k|  }
  546|  4.19k|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (546:7): [True: 0, False: 4.19k]
  ------------------
  547|       |    // Set the XMP Exif tag to the new value
  548|      0|    auto value = Value::create(unsignedByte);
  549|      0|    value->read(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size(), invalidByteOrder);
  550|      0|    Exifdatum xmpDatum(xmpKey, value.get());
  551|      0|    exifData_.add(xmpDatum);
  552|      0|  }
  553|  4.19k|#endif
  554|  4.19k|}  // TiffEncoder::encodeXmp
_ZN5Exiv28Internal11TiffEncoder8setDirtyEb:
  556|  34.0k|void TiffEncoder::setDirty(bool flag) {
  557|  34.0k|  dirty_ = flag;
  558|  34.0k|  setGo(geTraverse, !flag);
  559|  34.0k|}
_ZNK5Exiv28Internal11TiffEncoder10isImageTagEtNS_5IfdIdE:
  703|   285k|bool TiffEncoder::isImageTag(uint16_t tag, IfdId group) const {
  704|   285k|  return !isNewImage_ && pHeader_->isImageTag(tag, group, pPrimaryGroups_);
  ------------------
  |  Branch (704:10): [True: 0, False: 285k]
  |  Branch (704:26): [True: 0, False: 0]
  ------------------
  705|   285k|}
_ZN5Exiv28Internal11TiffEncoder19encodeTiffComponentEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  707|   142k|void TiffEncoder::encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum) {
  708|   142k|  auto pos = exifData_.end();
  709|   142k|  const Exifdatum* ed = datum;
  710|   142k|  if (!ed) {
  ------------------
  |  Branch (710:7): [True: 0, False: 142k]
  ------------------
  711|       |    // Non-intrusive writing: find matching tag
  712|      0|    ExifKey key(object->tag(), groupName(object->group()));
  713|      0|    pos = exifData_.findKey(key);
  714|      0|    if (pos != exifData_.end()) {
  ------------------
  |  Branch (714:9): [True: 0, False: 0]
  ------------------
  715|      0|      ed = &(*pos);
  716|      0|      if (object->idx() != pos->idx()) {
  ------------------
  |  Branch (716:11): [True: 0, False: 0]
  ------------------
  717|       |        // Try to find exact match (in case of duplicate tags)
  718|      0|        auto pos2 = std::find_if(exifData_.begin(), exifData_.end(), FindExifdatum2(object->group(), object->idx()));
  719|      0|        if (pos2 != exifData_.end() && pos2->key() == key.key()) {
  ------------------
  |  Branch (719:13): [True: 0, False: 0]
  |  Branch (719:13): [True: 0, False: 0]
  |  Branch (719:40): [True: 0, False: 0]
  ------------------
  720|      0|          ed = &(*pos2);
  721|      0|          pos = pos2;  // make sure we delete the correct tag below
  722|      0|        }
  723|      0|      }
  724|      0|    } else {
  725|      0|      setDirty();
  726|       |#ifdef EXIV2_DEBUG_MESSAGES
  727|       |      std::cerr << "DELETING          " << key << ", idx = " << object->idx() << "\n";
  728|       |#endif
  729|      0|    }
  730|   142k|  } else {
  731|       |    // For intrusive writing, the index is used to preserve the order of
  732|       |    // duplicate tags
  733|   142k|    object->idx_ = ed->idx();
  734|   142k|  }
  735|       |  // Skip encoding image tags of existing TIFF image - they were copied earlier -
  736|       |  // but encode image tags of new images (creation)
  737|   142k|  if (ed && !isImageTag(object->tag(), object->group())) {
  ------------------
  |  Branch (737:7): [True: 142k, False: 0]
  |  Branch (737:13): [True: 142k, False: 0]
  ------------------
  738|   142k|    if (auto fct = findEncoderFct_(make_, object->tag(), object->group())) {
  ------------------
  |  Branch (738:14): [True: 0, False: 142k]
  ------------------
  739|       |      // If an encoding function is registered for the tag, use it
  740|      0|      std::invoke(fct, *this, object, ed);
  741|   142k|    } else {
  742|       |      // Else use the encode function at the object (results in a double-dispatch
  743|       |      // to the appropriate encoding function of the encoder.
  744|   142k|      object->encode(*this, ed);
  745|   142k|    }
  746|   142k|  }
  747|   142k|  if (del_ && pos != exifData_.end()) {
  ------------------
  |  Branch (747:7): [True: 0, False: 142k]
  |  Branch (747:7): [True: 0, False: 142k]
  |  Branch (747:15): [True: 0, False: 0]
  ------------------
  748|      0|    exifData_.erase(pos);
  749|      0|  }
  750|       |#ifdef EXIV2_DEBUG_MESSAGES
  751|       |  std::cerr << "\n";
  752|       |#endif
  753|   142k|}  // TiffEncoder::encodeTiffComponent
_ZN5Exiv28Internal11TiffEncoder15encodeTiffEntryEPNS0_9TiffEntryEPKNS_9ExifdatumE:
  791|   101k|void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) {
  792|   101k|  encodeTiffEntryBase(object, datum);
  793|   101k|}  // TiffEncoder::encodeTiffEntry
_ZN5Exiv28Internal11TiffEncoder16encodeImageEntryEPNS0_14TiffImageEntryEPKNS_9ExifdatumE:
  795|  17.1k|void TiffEncoder::encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum) {
  796|  17.1k|  encodeOffsetEntry(object, datum);
  797|       |
  798|  17.1k|  size_t sizeDataArea = object->pValue()->sizeDataArea();
  799|       |
  800|  17.1k|  if (sizeDataArea > 0 && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (800:7): [True: 2.29k, False: 14.8k]
  |  Branch (800:27): [True: 0, False: 2.29k]
  ------------------
  801|       |#ifdef EXIV2_DEBUG_MESSAGES
  802|       |    std::cerr << "\t DATAAREA IS SET (NON-INTRUSIVE WRITING)";
  803|       |#endif
  804|      0|    setDirty();
  805|      0|  }
  806|       |
  807|  17.1k|  if (sizeDataArea > 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (807:7): [True: 2.29k, False: 14.8k]
  |  Branch (807:27): [True: 2.29k, False: 0]
  ------------------
  808|       |#ifdef EXIV2_DEBUG_MESSAGES
  809|       |    std::cerr << "\t DATAAREA IS SET (INTRUSIVE WRITING)";
  810|       |#endif
  811|       |    // Set pseudo strips (without a data pointer) from the size tag
  812|  2.29k|    ExifKey key(object->szTag(), groupName(object->szGroup()));
  813|  2.29k|    auto pos = exifData_.findKey(key);
  814|  2.29k|    const byte* zero = nullptr;
  815|  2.29k|    if (pos == exifData_.end()) {
  ------------------
  |  Branch (815:9): [True: 0, False: 2.29k]
  ------------------
  816|      0|#ifndef SUPPRESS_WARNINGS
  817|      0|      EXV_ERROR << "Size tag " << key << " not found. Writing only one strip.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  818|      0|#endif
  819|      0|      object->strips_.clear();
  820|      0|      object->strips_.emplace_back(zero, sizeDataArea);
  821|  2.29k|    } else {
  822|  2.29k|      size_t sizeTotal = 0;
  823|  2.29k|      object->strips_.clear();
  824|  14.8k|      for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (824:26): [True: 12.5k, False: 2.29k]
  ------------------
  825|  12.5k|        uint32_t len = pos->toUint32(i);
  826|  12.5k|        object->strips_.emplace_back(zero, len);
  827|  12.5k|        sizeTotal += len;
  828|  12.5k|      }
  829|  2.29k|      if (sizeTotal != sizeDataArea) {
  ------------------
  |  Branch (829:11): [True: 50, False: 2.24k]
  ------------------
  830|     50|#ifndef SUPPRESS_WARNINGS
  831|     50|        ExifKey key2(object->tag(), groupName(object->group()));
  832|     50|        EXV_ERROR << "Sum of all sizes of " << key << " != data size of " << key2 << ". "
  ------------------
  |  |  142|     50|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 50]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     50|  LogMsg(LogMsg::error).os()
  ------------------
  833|      0|                  << "This results in an invalid image.\n";
  834|     50|#endif
  835|       |        // Todo: How to fix? Write only one strip?
  836|     50|      }
  837|  2.29k|    }
  838|  2.29k|  }
  839|       |
  840|  17.1k|  if (sizeDataArea == 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (840:7): [True: 14.8k, False: 2.29k]
  |  Branch (840:28): [True: 14.8k, False: 0]
  ------------------
  841|       |#ifdef EXIV2_DEBUG_MESSAGES
  842|       |    std::cerr << "\t USE STRIPS FROM SOURCE TREE IMAGE ENTRY";
  843|       |#endif
  844|       |    // Set strips from source tree
  845|  14.8k|    if (pSourceTree_) {
  ------------------
  |  Branch (845:9): [True: 0, False: 14.8k]
  ------------------
  846|      0|      TiffFinder finder(object->tag(), object->group());
  847|      0|      pSourceTree_->accept(finder);
  848|      0|      if (auto ti = dynamic_cast<const TiffImageEntry*>(finder.result())) {
  ------------------
  |  Branch (848:16): [True: 0, False: 0]
  ------------------
  849|      0|        object->strips_ = ti->strips_;
  850|      0|      }
  851|      0|    }
  852|  14.8k|#ifndef SUPPRESS_WARNINGS
  853|  14.8k|    else {
  854|  14.8k|      ExifKey key2(object->tag(), groupName(object->group()));
  855|  14.8k|      EXV_WARNING << "No image data to encode " << key2 << ".\n";
  ------------------
  |  |  138|  14.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 14.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  14.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  856|  14.8k|    }
  857|  14.8k|#endif
  858|  14.8k|  }
  859|       |
  860|  17.1k|}  // TiffEncoder::encodeImageEntry
_ZN5Exiv28Internal11TiffEncoder15encodeSizeEntryEPNS0_13TiffSizeEntryEPKNS_9ExifdatumE:
  868|  23.7k|void TiffEncoder::encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum) {
  869|  23.7k|  encodeTiffEntryBase(object, datum);
  870|  23.7k|}  // TiffEncoder::encodeSizeEntry
_ZN5Exiv28Internal11TiffEncoder19encodeTiffEntryBaseEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  876|   125k|void TiffEncoder::encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum) {
  877|       |#ifdef EXIV2_DEBUG_MESSAGES
  878|       |  bool tooLarge = false;
  879|       |#endif
  880|   125k|  if (datum->size() > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (880:7): [True: 24.5k, False: 101k]
  ------------------
  881|  24.5k|    setDirty();
  882|       |#ifdef EXIV2_DEBUG_MESSAGES
  883|       |    tooLarge = true;
  884|       |#endif
  885|  24.5k|  }
  886|   125k|  object->updateValue(datum->getValue(), byteOrder());  // clones the value
  887|       |#ifdef EXIV2_DEBUG_MESSAGES
  888|       |  ExifKey key(object->tag(), groupName(object->group()));
  889|       |  std::cerr << "UPDATING DATA     " << key;
  890|       |  if (tooLarge) {
  891|       |    std::cerr << "\t\t\t ALLOCATED " << std::dec << object->size_ << " BYTES";
  892|       |  }
  893|       |#endif
  894|   125k|}
_ZN5Exiv28Internal11TiffEncoder17encodeOffsetEntryEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  896|  17.1k|void TiffEncoder::encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum) {
  897|  17.1k|  size_t newSize = datum->size();
  898|  17.1k|  if (newSize > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (898:7): [True: 9.50k, False: 7.61k]
  ------------------
  899|  9.50k|    setDirty();
  900|  9.50k|    object->updateValue(datum->getValue(), byteOrder());  // clones the value
  901|       |#ifdef EXIV2_DEBUG_MESSAGES
  902|       |    ExifKey key(object->tag(), groupName(object->group()));
  903|       |    std::cerr << "UPDATING DATA     " << key;
  904|       |    std::cerr << "\t\t\t ALLOCATED " << object->size() << " BYTES";
  905|       |#endif
  906|  9.50k|  } else {
  907|  7.61k|    object->setValue(datum->getValue());  // clones the value
  908|       |#ifdef EXIV2_DEBUG_MESSAGES
  909|       |    ExifKey key(object->tag(), groupName(object->group()));
  910|       |    std::cerr << "NOT UPDATING      " << key;
  911|       |    std::cerr << "\t\t\t PRESERVE VALUE DATA";
  912|       |#endif
  913|  7.61k|  }
  914|  17.1k|}
_ZN5Exiv28Internal11TiffEncoder3addEPNS0_13TiffComponentENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEEj:
  916|  4.19k|void TiffEncoder::add(TiffComponent* pRootDir, TiffComponent::UniquePtr pSourceDir, uint32_t root) {
  917|  4.19k|  writeMethod_ = wmIntrusive;
  918|  4.19k|  pSourceTree_ = std::move(pSourceDir);
  919|       |
  920|       |  // Ensure that the exifData_ entries are not deleted, to be able to
  921|       |  // iterate over all remaining entries.
  922|  4.19k|  del_ = false;
  923|       |
  924|  4.19k|  auto posBo = exifData_.end();
  925|   147k|  for (auto i = exifData_.begin(); i != exifData_.end(); ++i) {
  ------------------
  |  Branch (925:36): [True: 142k, False: 4.19k]
  ------------------
  926|   142k|    IfdId group = groupId(i->groupName());
  927|       |    // Skip synthesized info tags
  928|   142k|    if (group == IfdId::mnId) {
  ------------------
  |  Branch (928:9): [True: 0, False: 142k]
  ------------------
  929|      0|      if (i->tag() == 0x0002) {
  ------------------
  |  Branch (929:11): [True: 0, False: 0]
  ------------------
  930|      0|        posBo = i;
  931|      0|      }
  932|      0|      continue;
  933|      0|    }
  934|       |
  935|       |    // Skip image tags of existing TIFF image - they were copied earlier -
  936|       |    // but add and encode image tags of new images (creation)
  937|   142k|    if (isImageTag(i->tag(), group))
  ------------------
  |  Branch (937:9): [True: 0, False: 142k]
  ------------------
  938|      0|      continue;
  939|       |
  940|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  941|   142k|    auto tiffPath = TiffCreator::getPath(i->tag(), group, root);
  942|   142k|    TiffComponent* tc = pRootDir->addPath(i->tag(), tiffPath, pRootDir);
  943|   142k|    auto object = dynamic_cast<TiffEntryBase*>(tc);
  944|       |#ifdef EXIV2_DEBUG_MESSAGES
  945|       |    if (!object) {
  946|       |      std::cerr << "Warning: addPath() didn't add an entry for " << i->groupName() << " tag 0x" << std::setw(4)
  947|       |                << std::setfill('0') << std::hex << i->tag() << "\n";
  948|       |    }
  949|       |#endif
  950|   142k|    if (object) {
  ------------------
  |  Branch (950:9): [True: 142k, False: 0]
  ------------------
  951|   142k|      encodeTiffComponent(object, &(*i));
  952|   142k|    }
  953|   142k|  }
  954|       |
  955|       |  /*
  956|       |    What follows is a hack. I can't think of a better way to set
  957|       |    the makernote byte order (and other properties maybe) in the
  958|       |    makernote header during intrusive writing. The thing is that
  959|       |    visit/encodeIfdMakernote is not called in this case and there
  960|       |    can't be an Exif tag which corresponds to this component.
  961|       |   */
  962|  4.19k|  if (posBo == exifData_.end())
  ------------------
  |  Branch (962:7): [True: 4.19k, False: 3]
  ------------------
  963|  4.19k|    return;
  964|       |
  965|      3|  TiffFinder finder(0x927c, IfdId::exifId);
  966|      3|  pRootDir->accept(finder);
  967|      3|  if (auto te = dynamic_cast<const TiffMnEntry*>(finder.result())) {
  ------------------
  |  Branch (967:12): [True: 0, False: 3]
  ------------------
  968|      0|    if (const auto& mn = te->mn_) {
  ------------------
  |  Branch (968:21): [True: 0, False: 0]
  ------------------
  969|       |      // Set Makernote byte order
  970|      0|      ByteOrder bo = stringToByteOrder(posBo->toString());
  971|      0|      if (bo != invalidByteOrder)
  ------------------
  |  Branch (971:11): [True: 0, False: 0]
  ------------------
  972|      0|        mn->setByteOrder(bo);
  973|      0|    }
  974|      0|  }
  975|       |
  976|      3|}  // TiffEncoder::add
_ZN5Exiv28Internal10TiffReaderC2EPKhmPNS0_13TiffComponentENS0_11TiffRwStateE:
  979|  12.8k|    pData_(pData), size_(size), pLast_(pData + size), pRoot_(pRoot), origState_(state), mnState_(state) {
  980|  12.8k|  pState_ = &origState_;
  981|       |
  982|  12.8k|}  // TiffReader::TiffReader
_ZN5Exiv28Internal10TiffReader12setOrigStateEv:
  984|  15.6k|void TiffReader::setOrigState() {
  985|  15.6k|  pState_ = &origState_;
  986|  15.6k|}
_ZN5Exiv28Internal10TiffReader10setMnStateEPKNS0_11TiffRwStateE:
  988|  15.6k|void TiffReader::setMnState(const TiffRwState* state) {
  989|  15.6k|  if (state) {
  ------------------
  |  Branch (989:7): [True: 2.82k, False: 12.8k]
  ------------------
  990|       |    // invalidByteOrder indicates 'no change'
  991|  2.82k|    if (state->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.82k]
  ------------------
  992|      0|      mnState_ = TiffRwState{origState_.byteOrder(), state->baseOffset()};
  993|  2.82k|    } else {
  994|  2.82k|      mnState_ = *state;
  995|  2.82k|    }
  996|  2.82k|  }
  997|  15.6k|  pState_ = &mnState_;
  998|  15.6k|}
_ZNK5Exiv28Internal10TiffReader9byteOrderEv:
 1000|  3.93M|ByteOrder TiffReader::byteOrder() const {
 1001|  3.93M|  return pState_->byteOrder();
 1002|  3.93M|}
_ZNK5Exiv28Internal10TiffReader10baseOffsetEv:
 1004|   676k|size_t TiffReader::baseOffset() const {
 1005|   676k|  return pState_->baseOffset();
 1006|   676k|}
_ZN5Exiv28Internal10TiffReader17readDataEntryBaseEPNS0_17TiffDataEntryBaseE:
 1008|  47.3k|void TiffReader::readDataEntryBase(TiffDataEntryBase* object) {
 1009|  47.3k|  readTiffEntry(object);
 1010|  47.3k|  TiffFinder finder(object->szTag(), object->szGroup());
 1011|  47.3k|  pRoot_->accept(finder);
 1012|  47.3k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1013|  47.3k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1013:7): [True: 35.2k, False: 12.0k]
  |  Branch (1013:13): [True: 27.3k, False: 7.96k]
  ------------------
 1014|  27.3k|    object->setStrips(te->pValue(), pData_, size_, baseOffset());
 1015|  27.3k|  }
 1016|  47.3k|}
_ZN5Exiv28Internal10TiffReader10visitEntryEPNS0_9TiffEntryE:
 1018|   709k|void TiffReader::visitEntry(TiffEntry* object) {
 1019|   709k|  readTiffEntry(object);
 1020|   709k|}
_ZN5Exiv28Internal10TiffReader14visitDataEntryEPNS0_13TiffDataEntryE:
 1022|  6.17k|void TiffReader::visitDataEntry(TiffDataEntry* object) {
 1023|  6.17k|  readDataEntryBase(object);
 1024|  6.17k|}
_ZN5Exiv28Internal10TiffReader15visitImageEntryEPNS0_14TiffImageEntryE:
 1026|  41.1k|void TiffReader::visitImageEntry(TiffImageEntry* object) {
 1027|  41.1k|  readDataEntryBase(object);
 1028|  41.1k|}
_ZN5Exiv28Internal10TiffReader14visitSizeEntryEPNS0_13TiffSizeEntryE:
 1030|  56.8k|void TiffReader::visitSizeEntry(TiffSizeEntry* object) {
 1031|  56.8k|  readTiffEntry(object);
 1032|  56.8k|  TiffFinder finder(object->dtTag(), object->dtGroup());
 1033|  56.8k|  pRoot_->accept(finder);
 1034|  56.8k|  auto te = dynamic_cast<TiffDataEntryBase*>(finder.result());
 1035|  56.8k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1035:7): [True: 38.9k, False: 17.8k]
  |  Branch (1035:13): [True: 20.4k, False: 18.5k]
  ------------------
 1036|  20.4k|    te->setStrips(object->pValue(), pData_, size_, baseOffset());
 1037|  20.4k|  }
 1038|  56.8k|}
_ZN5Exiv28Internal10TiffReader17circularReferenceEPKhNS_5IfdIdE:
 1040|  43.5k|bool TiffReader::circularReference(const byte* start, IfdId group) {
 1041|  43.5k|  if (auto pos = dirList_.find(start); pos != dirList_.end()) {
  ------------------
  |  Branch (1041:40): [True: 4.23k, False: 39.3k]
  ------------------
 1042|  4.23k|#ifndef SUPPRESS_WARNINGS
 1043|  4.23k|    EXV_ERROR << groupName(group) << " pointer references previously read " << groupName(pos->second)
  ------------------
  |  |  142|  4.23k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.23k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.23k|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|              << " directory; ignored.\n";
 1045|  4.23k|#endif
 1046|  4.23k|    return true;
 1047|  4.23k|  }
 1048|  39.3k|  dirList_[start] = group;
 1049|  39.3k|  return false;
 1050|  43.5k|}
_ZN5Exiv28Internal10TiffReader7nextIdxENS_5IfdIdE:
 1052|   894k|int TiffReader::nextIdx(IfdId group) {
 1053|   894k|  return ++idxSeq_[group];
 1054|   894k|}
_ZN5Exiv28Internal10TiffReader11postProcessEv:
 1056|  12.8k|void TiffReader::postProcess() {
 1057|  12.8k|  setMnState();  // All components to be post-processed must be from the Makernote
 1058|  12.8k|  postProc_ = true;
 1059|  12.8k|  for (auto pos : postList_) {
  ------------------
  |  Branch (1059:17): [True: 6.49k, False: 12.8k]
  ------------------
 1060|  6.49k|    pos->accept(*this);
 1061|  6.49k|  }
 1062|  12.8k|  postProc_ = false;
 1063|  12.8k|  setOrigState();
 1064|  12.8k|}
_ZN5Exiv28Internal10TiffReader14visitDirectoryEPNS0_13TiffDirectoryE:
 1066|  43.5k|void TiffReader::visitDirectory(TiffDirectory* object) {
 1067|  43.5k|  const byte* p = object->start();
 1068|       |
 1069|  43.5k|  if (circularReference(object->start(), object->group()))
  ------------------
  |  Branch (1069:7): [True: 4.23k, False: 39.3k]
  ------------------
 1070|  4.23k|    return;
 1071|       |
 1072|  39.3k|  if (p + 2 > pLast_) {
  ------------------
  |  Branch (1072:7): [True: 72, False: 39.2k]
  ------------------
 1073|     72|#ifndef SUPPRESS_WARNINGS
 1074|     72|    EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD exceeds data buffer, cannot read entry count.\n";
  ------------------
  |  |  142|     72|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 72]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     72|  LogMsg(LogMsg::error).os()
  ------------------
 1075|     72|#endif
 1076|     72|    return;
 1077|     72|  }
 1078|  39.2k|  const uint16_t n = getUShort(p, byteOrder());
 1079|  39.2k|  p += 2;
 1080|       |  // Sanity check with an "unreasonably" large number
 1081|  39.2k|  if (n > 256) {
  ------------------
  |  Branch (1081:7): [True: 4.13k, False: 35.1k]
  ------------------
 1082|  4.13k|#ifndef SUPPRESS_WARNINGS
 1083|  4.13k|    EXV_ERROR << "Directory " << groupName(object->group()) << " with " << n
  ------------------
  |  |  142|  4.13k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.13k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.13k|  LogMsg(LogMsg::error).os()
  ------------------
 1084|      0|              << " entries considered invalid; not read.\n";
 1085|  4.13k|#endif
 1086|  4.13k|    return;
 1087|  4.13k|  }
 1088|   883k|  for (uint16_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (1088:24): [True: 866k, False: 16.9k]
  ------------------
 1089|   866k|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1089:9): [True: 18.2k, False: 848k]
  ------------------
 1090|  18.2k|#ifndef SUPPRESS_WARNINGS
 1091|  18.2k|      EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD entry " << i
  ------------------
  |  |  142|  18.2k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 18.2k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  18.2k|  LogMsg(LogMsg::error).os()
  ------------------
 1092|      0|                << " lies outside of the data buffer.\n";
 1093|  18.2k|#endif
 1094|  18.2k|      return;
 1095|  18.2k|    }
 1096|   848k|    uint16_t tag = getUShort(p, byteOrder());
 1097|   848k|    if (auto tc = TiffCreator::create(tag, object->group())) {
  ------------------
  |  Branch (1097:14): [True: 847k, False: 251]
  ------------------
 1098|   847k|      tc->setStart(p);
 1099|   847k|      object->addChild(std::move(tc));
 1100|   847k|    } else {
 1101|    251|#ifndef SUPPRESS_WARNINGS
 1102|    251|      EXV_WARNING << "Unable to handle tag " << tag << ".\n";
  ------------------
  |  |  138|    251|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 251]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    251|  LogMsg(LogMsg::warn).os()
  ------------------
 1103|    251|#endif
 1104|    251|    }
 1105|   848k|    p += 12;
 1106|   848k|  }
 1107|       |
 1108|  16.9k|  if (object->hasNext()) {
  ------------------
  |  Branch (1108:7): [True: 16.9k, False: 16]
  ------------------
 1109|  16.9k|    if (p + 4 > pLast_) {
  ------------------
  |  Branch (1109:9): [True: 163, False: 16.7k]
  ------------------
 1110|    163|#ifndef SUPPRESS_WARNINGS
 1111|    163|      EXV_ERROR << "Directory " << groupName(object->group())
  ------------------
  |  |  142|    163|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 163]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    163|  LogMsg(LogMsg::error).os()
  ------------------
 1112|      0|                << ": IFD exceeds data buffer, cannot read next pointer.\n";
 1113|    163|#endif
 1114|    163|      return;
 1115|    163|    }
 1116|  16.7k|    TiffComponent::UniquePtr tc;
 1117|  16.7k|    uint32_t next = getULong(p, byteOrder());
 1118|  16.7k|    if (next) {
  ------------------
  |  Branch (1118:9): [True: 15.8k, False: 936]
  ------------------
 1119|  15.8k|      tc = TiffCreator::create(Tag::next, object->group());
 1120|  15.8k|#ifndef SUPPRESS_WARNINGS
 1121|  15.8k|      if (!tc) {
  ------------------
  |  Branch (1121:11): [True: 9.25k, False: 6.56k]
  ------------------
 1122|  9.25k|        EXV_WARNING << "Directory " << groupName(object->group()) << " has an unexpected next pointer; ignored.\n";
  ------------------
  |  |  138|  9.25k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9.25k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  9.25k|  LogMsg(LogMsg::warn).os()
  ------------------
 1123|  9.25k|      }
 1124|  15.8k|#endif
 1125|  15.8k|    }
 1126|  16.7k|    if (tc) {
  ------------------
  |  Branch (1126:9): [True: 6.56k, False: 10.1k]
  ------------------
 1127|  6.56k|      if (next > size_ || baseOffset() > size_ - next) {
  ------------------
  |  Branch (1127:11): [True: 4.47k, False: 2.08k]
  |  Branch (1127:27): [True: 7, False: 2.07k]
  ------------------
 1128|  4.48k|#ifndef SUPPRESS_WARNINGS
 1129|  4.48k|        EXV_ERROR << "Directory " << groupName(object->group()) << ": Next pointer is out of bounds; ignored.\n";
  ------------------
  |  |  142|  4.48k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.48k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.48k|  LogMsg(LogMsg::error).os()
  ------------------
 1130|  4.48k|#endif
 1131|  4.48k|        return;
 1132|  4.48k|      }
 1133|  2.07k|      tc->setStart(pData_ + baseOffset() + next);
 1134|  2.07k|      object->addNext(std::move(tc));
 1135|  2.07k|    }
 1136|  16.7k|  }  // object->hasNext()
 1137|       |
 1138|  16.9k|}  // TiffReader::visitDirectory
_ZN5Exiv28Internal10TiffReader11visitSubIfdEPNS0_10TiffSubIfdE:
 1140|  10.1k|void TiffReader::visitSubIfd(TiffSubIfd* object) {
 1141|  10.1k|  readTiffEntry(object);
 1142|  10.1k|  if ((object->tiffType() == ttUnsignedLong || object->tiffType() == ttSignedLong || object->tiffType() == ttTiffIfd) &&
  ------------------
  |  Branch (1142:8): [True: 8.20k, False: 1.94k]
  |  Branch (1142:48): [True: 394, False: 1.55k]
  |  Branch (1142:86): [True: 546, False: 1.00k]
  ------------------
 1143|  9.14k|      object->count() >= 1) {
  ------------------
  |  Branch (1143:7): [True: 6.86k, False: 2.28k]
  ------------------
 1144|       |    // Todo: Fix hack
 1145|  6.86k|    uint32_t maxi = 9;
 1146|  6.86k|    if (object->group() == IfdId::ifd1Id)
  ------------------
  |  Branch (1146:9): [True: 199, False: 6.66k]
  ------------------
 1147|    199|      maxi = 1;
 1148|  32.7k|    for (uint32_t i = 0; i < object->count(); ++i) {
  ------------------
  |  Branch (1148:26): [True: 31.9k, False: 811]
  ------------------
 1149|  31.9k|      const uint32_t offset = getULong(object->pData() + (4 * i), byteOrder());
 1150|  31.9k|      if (offset > size_ || baseOffset() > size_ - offset) {
  ------------------
  |  Branch (1150:11): [True: 5.73k, False: 26.2k]
  |  Branch (1150:29): [True: 17, False: 26.2k]
  ------------------
 1151|  5.75k|#ifndef SUPPRESS_WARNINGS
 1152|  5.75k|        EXV_ERROR << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  142|  5.75k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 5.75k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  5.75k|  LogMsg(LogMsg::error).os()
  ------------------
 1153|      0|                  << std::hex << object->tag() << " Sub-IFD pointer " << i << " is out of bounds; ignoring it.\n";
 1154|  5.75k|#endif
 1155|  5.75k|        return;
 1156|  5.75k|      }
 1157|  26.2k|      if (i >= maxi) {
  ------------------
  |  Branch (1157:11): [True: 300, False: 25.9k]
  ------------------
 1158|    300|#ifndef SUPPRESS_WARNINGS
 1159|    300|        EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|    300|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 300]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    300|  LogMsg(LogMsg::warn).os()
  ------------------
 1160|      0|                    << std::hex << object->tag() << ": Skipping sub-IFDs beyond the first " << i << ".\n";
 1161|    300|#endif
 1162|    300|        break;
 1163|    300|      }
 1164|       |      // If there are multiple dirs, group is incremented for each
 1165|  25.9k|      auto td = std::make_unique<TiffDirectory>(object->tag(),
 1166|  25.9k|                                                static_cast<IfdId>(static_cast<uint32_t>(object->newGroup_) + i));
 1167|  25.9k|      td->setStart(pData_ + baseOffset() + offset);
 1168|  25.9k|      object->addChild(std::move(td));
 1169|  25.9k|    }
 1170|  6.86k|  }
 1171|  3.28k|#ifndef SUPPRESS_WARNINGS
 1172|  3.28k|  else {
 1173|  3.28k|    EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|  3.28k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.28k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.28k|  LogMsg(LogMsg::warn).os()
  ------------------
 1174|      0|                << std::hex << object->tag() << " doesn't look like a sub-IFD.\n";
 1175|  3.28k|  }
 1176|  10.1k|#endif
 1177|       |
 1178|  10.1k|}  // TiffReader::visitSubIfd
_ZN5Exiv28Internal10TiffReader12visitMnEntryEPNS0_11TiffMnEntryE:
 1180|  11.7k|void TiffReader::visitMnEntry(TiffMnEntry* object) {
 1181|  11.7k|  readTiffEntry(object);
 1182|       |  // Find camera make
 1183|  11.7k|  TiffFinder finder(0x010f, IfdId::ifd0Id);
 1184|  11.7k|  pRoot_->accept(finder);
 1185|  11.7k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1186|  11.7k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1186:7): [True: 11.4k, False: 242]
  |  Branch (1186:13): [True: 11.2k, False: 242]
  ------------------
 1187|  11.2k|    auto make = te->pValue()->toString();
 1188|       |    // create concrete makernote, based on make and makernote contents
 1189|  11.2k|    object->mn_ =
 1190|  11.2k|        TiffMnCreator::create(object->tag(), object->mnGroup_, make, object->pData_, object->size_, byteOrder());
 1191|  11.2k|  }
 1192|  11.7k|  if (object->mn_)
  ------------------
  |  Branch (1192:7): [True: 3.12k, False: 8.61k]
  ------------------
 1193|  3.12k|    object->mn_->setStart(object->pData());
 1194|       |
 1195|  11.7k|}  // TiffReader::visitMnEntry
_ZN5Exiv28Internal10TiffReader17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
 1197|  3.12k|void TiffReader::visitIfdMakernote(TiffIfdMakernote* object) {
 1198|  3.12k|  object->setImageByteOrder(byteOrder());  // set the byte order for the image
 1199|       |
 1200|  3.12k|  if (!object->readHeader(object->start(), pLast_ - object->start(), byteOrder())) {
  ------------------
  |  Branch (1200:7): [True: 296, False: 2.83k]
  ------------------
 1201|    296|#ifndef SUPPRESS_WARNINGS
 1202|    296|    EXV_ERROR << "Failed to read " << groupName(object->ifd_.group()) << " IFD Makernote header.\n";
  ------------------
  |  |  142|    296|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 296]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    296|  LogMsg(LogMsg::error).os()
  ------------------
 1203|       |#ifdef EXIV2_DEBUG_MESSAGES
 1204|       |    if (pLast_ - object->start() >= 16u) {
 1205|       |      hexdump(std::cerr, object->start(), 16u);
 1206|       |    }
 1207|       |#endif  // EXIV2_DEBUG_MESSAGES
 1208|    296|#endif  // SUPPRESS_WARNINGS
 1209|    296|    setGo(geKnownMakernote, false);
 1210|    296|    return;
 1211|    296|  }
 1212|       |
 1213|  2.83k|  auto start = object->start();
 1214|  2.83k|  auto offset = object->ifdOffset();
 1215|  2.83k|  enforce(pData_ <= start, ErrorCode::kerCorruptedMetadata);
 1216|  2.83k|  enforce(start <= pLast_, ErrorCode::kerCorruptedMetadata);
 1217|  2.83k|  enforce(offset <= static_cast<size_t>(pLast_ - start), ErrorCode::kerCorruptedMetadata);
 1218|  2.83k|  object->ifd_.setStart(start + offset);
 1219|       |
 1220|       |  // Modify reader for Makernote peculiarities, byte order and offset
 1221|  2.83k|  object->mnOffset_ = start - pData_;
 1222|  2.83k|  auto state = TiffRwState{object->byteOrder(), object->baseOffset()};
 1223|  2.83k|  setMnState(&state);
 1224|       |
 1225|  2.83k|}  // TiffReader::visitIfdMakernote
_ZN5Exiv28Internal10TiffReader20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
 1227|  2.76k|void TiffReader::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
 1228|       |  // Reset state (byte order, create function, offset) back to that for the image
 1229|  2.76k|  setOrigState();
 1230|  2.76k|}  // TiffReader::visitIfdMakernoteEnd
_ZN5Exiv28Internal10TiffReader13readTiffEntryEPNS0_13TiffEntryBaseE:
 1232|   842k|void TiffReader::readTiffEntry(TiffEntryBase* object) {
 1233|   842k|  try {
 1234|   842k|    byte* p = object->start();
 1235|       |
 1236|   842k|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1236:9): [True: 6, False: 842k]
  ------------------
 1237|      6|#ifndef SUPPRESS_WARNINGS
 1238|      6|      EXV_ERROR << "Entry in directory " << groupName(object->group())
  ------------------
  |  |  142|      6|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 6]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      6|  LogMsg(LogMsg::error).os()
  ------------------
 1239|      0|                << "requests access to memory beyond the data buffer. " << "Skipping entry.\n";
 1240|      6|#endif
 1241|      6|      return;
 1242|      6|    }
 1243|       |    // Component already has tag
 1244|   842k|    p += 2;
 1245|   842k|    auto tiffType = static_cast<TiffType>(getUShort(p, byteOrder()));
 1246|   842k|    TypeId typeId = toTypeId(tiffType, object->tag(), object->group());
 1247|   842k|    size_t typeSize = TypeInfo::typeSize(typeId);
 1248|   842k|    if (0 == typeSize) {
  ------------------
  |  Branch (1248:9): [True: 742k, False: 100k]
  ------------------
 1249|   742k|#ifndef SUPPRESS_WARNINGS
 1250|   742k|      EXV_WARNING << stringFormat(
  ------------------
  |  |  138|   742k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 742k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|   742k|  LogMsg(LogMsg::warn).os()
  ------------------
                    EXV_WARNING << stringFormat(
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1251|      0|          "Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
 1252|      0|          groupName(object->group()), object->tag(), static_cast<uint16_t>(tiffType));
 1253|   742k|#endif
 1254|   742k|      typeSize = 1;
 1255|   742k|    }
 1256|   842k|    p += 2;
 1257|   842k|    uint32_t count = getULong(p, byteOrder());
 1258|   842k|    if (count >= 0x10000000) {
  ------------------
  |  Branch (1258:9): [True: 338k, False: 504k]
  ------------------
 1259|   338k|#ifndef SUPPRESS_WARNINGS
 1260|   338k|      EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |  142|   338k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 338k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   338k|  LogMsg(LogMsg::error).os()
  ------------------
                    EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1261|      0|                                groupName(object->group()), object->tag(), count, typeSize);
 1262|   338k|#endif
 1263|   338k|      return;
 1264|   338k|    }
 1265|   504k|    p += 4;
 1266|       |
 1267|   504k|    if (count > std::numeric_limits<size_t>::max() / typeSize) {
  ------------------
  |  Branch (1267:9): [True: 0, False: 504k]
  ------------------
 1268|      0|      throw Error(ErrorCode::kerArithmeticOverflow);
 1269|      0|    }
 1270|   504k|    size_t size = typeSize * count;
 1271|   504k|    size_t offset = getULong(p, byteOrder());
 1272|   504k|    byte* pData = p;
 1273|   504k|    if (size > 4 && Safe::add<size_t>(baseOffset(), offset) >= size_) {
  ------------------
  |  Branch (1273:9): [True: 390k, False: 113k]
  |  Branch (1273:21): [True: 299k, False: 90.7k]
  ------------------
 1274|       |      // #1143
 1275|   299k|      if (object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1") {
  ------------------
  |  Branch (1275:11): [True: 450, False: 299k]
  |  Branch (1275:11): [True: 36, False: 299k]
  |  Branch (1275:38): [True: 36, False: 414]
  ------------------
 1276|       |        // This tag is Exif.Sony1.PreviewImage, which refers to a preview image which is
 1277|       |        // not stored in the metadata. Instead it is stored at the end of the file, after
 1278|       |        // the main image. The value of `size` refers to the size of the preview image, not
 1279|       |        // the size of the tag's payload, so we set it to zero here so that we don't attempt
 1280|       |        // to read those bytes from the metadata. We currently leave this tag as "undefined",
 1281|       |        // although we may attempt to handle it better in the future. More discussion of
 1282|       |        // this issue can be found here:
 1283|       |        //
 1284|       |        //   https://github.com/Exiv2/exiv2/issues/2001
 1285|       |        //   https://github.com/Exiv2/exiv2/pull/2008
 1286|       |        //   https://github.com/Exiv2/exiv2/pull/2013
 1287|     36|        typeId = undefined;
 1288|     36|        size = 0;
 1289|   299k|      } else {
 1290|   299k|#ifndef SUPPRESS_WARNINGS
 1291|   299k|        EXV_ERROR << "Offset of directory " << groupName(object->group()) << ", entry 0x" << std::setw(4)
  ------------------
  |  |  142|   299k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 299k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   299k|  LogMsg(LogMsg::error).os()
  ------------------
 1292|      0|                  << std::setfill('0') << std::hex << object->tag() << " is out of bounds: " << "Offset = 0x"
 1293|      0|                  << std::setw(8) << std::setfill('0') << std::hex << offset << "; truncating the entry\n";
 1294|   299k|#endif
 1295|   299k|      }
 1296|   299k|      size = 0;
 1297|   299k|    }
 1298|   504k|    if (size > 4) {
  ------------------
  |  Branch (1298:9): [True: 90.7k, False: 413k]
  ------------------
 1299|       |      // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
 1300|       |      // as offset can be arbitrarily large
 1301|  90.7k|      if (Safe::add<size_t>(baseOffset(), offset) > static_cast<size_t>(pLast_ - pData_)) {
  ------------------
  |  Branch (1301:11): [True: 0, False: 90.7k]
  ------------------
 1302|      0|        throw Error(ErrorCode::kerCorruptedMetadata);
 1303|      0|      }
 1304|  90.7k|      pData = const_cast<byte*>(pData_) + baseOffset() + offset;
 1305|       |
 1306|       |      // check for size being invalid
 1307|  90.7k|      if (size > static_cast<size_t>(pLast_ - pData)) {
  ------------------
  |  Branch (1307:11): [True: 29.8k, False: 60.9k]
  ------------------
 1308|  29.8k|#ifndef SUPPRESS_WARNINGS
 1309|  29.8k|        EXV_ERROR << "Upper boundary of data for " << "directory " << groupName(object->group()) << ", entry 0x"
  ------------------
  |  |  142|  29.8k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 29.8k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  29.8k|  LogMsg(LogMsg::error).os()
  ------------------
 1310|      0|                  << std::setw(4) << std::setfill('0') << std::hex << object->tag()
 1311|      0|                  << " is out of bounds: " << "Offset = 0x" << std::setw(8) << std::setfill('0') << std::hex << offset
 1312|      0|                  << ", size = " << std::dec << size
 1313|      0|                  << ", exceeds buffer size by "
 1314|       |                  // cast to make MSVC happy
 1315|      0|                  << size - static_cast<size_t>(pLast_ - pData) << " Bytes; truncating the entry\n";
 1316|  29.8k|#endif
 1317|  29.8k|        size = 0;
 1318|  29.8k|      }
 1319|  90.7k|    }
 1320|   504k|    auto v = Value::create(typeId);
 1321|   504k|    enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1322|   504k|    v->read(pData, size, byteOrder());
 1323|       |
 1324|   504k|    object->setValue(std::move(v));
 1325|   504k|    auto d = std::make_shared<DataBuf>();
 1326|   504k|    object->setData(pData, size, std::move(d));
 1327|   504k|    object->setOffset(offset);
 1328|   504k|    object->setIdx(nextIdx(object->group()));
 1329|   504k|  } catch (std::overflow_error&) {
 1330|      0|    throw Error(ErrorCode::kerCorruptedMetadata);  // #562 don't throw std::overflow_error
 1331|      0|  }
 1332|   842k|}  // TiffReader::readTiffEntry
_ZN5Exiv28Internal10TiffReader16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
 1334|  12.9k|void TiffReader::visitBinaryArray(TiffBinaryArray* object) {
 1335|  12.9k|  if (!postProc_) {
  ------------------
  |  Branch (1335:7): [True: 6.49k, False: 6.49k]
  ------------------
 1336|       |    // Defer reading children until after all other components are read, but
 1337|       |    // since state (offset) is not set during post-processing, read entry here
 1338|  6.49k|    readTiffEntry(object);
 1339|  6.49k|    object->iniOrigDataBuf();
 1340|  6.49k|    postList_.push_back(object);
 1341|  6.49k|    return;
 1342|  6.49k|  }
 1343|       |  // Check duplicates
 1344|  6.49k|  TiffFinder finder(object->tag(), object->group());
 1345|  6.49k|  pRoot_->accept(finder);
 1346|  6.49k|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (1346:12): [True: 6.49k, False: 0]
  ------------------
 1347|  6.49k|    if (te->idx() != object->idx()) {
  ------------------
  |  Branch (1347:9): [True: 3.47k, False: 3.02k]
  ------------------
 1348|  3.47k|#ifndef SUPPRESS_WARNINGS
 1349|  3.47k|      EXV_WARNING << "Not decoding duplicate binary array tag 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  3.47k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.47k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.47k|  LogMsg(LogMsg::warn).os()
  ------------------
 1350|      0|                  << object->tag() << std::dec << ", group " << groupName(object->group()) << ", idx " << object->idx()
 1351|      0|                  << "\n";
 1352|  3.47k|#endif
 1353|  3.47k|      object->setDecoded(false);
 1354|  3.47k|      return;
 1355|  3.47k|    }
 1356|  6.49k|  }
 1357|       |
 1358|  3.02k|  if (object->TiffEntryBase::doSize() == 0)
  ------------------
  |  Branch (1358:7): [True: 1.58k, False: 1.43k]
  ------------------
 1359|  1.58k|    return;
 1360|  1.43k|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (1360:7): [True: 351, False: 1.08k]
  ------------------
 1361|    351|    return;
 1362|  1.08k|  const ArrayCfg* cfg = object->cfg();
 1363|  1.08k|  if (!cfg)
  ------------------
  |  Branch (1363:7): [True: 0, False: 1.08k]
  ------------------
 1364|      0|    return;
 1365|       |
 1366|  1.08k|  if (auto cryptFct = cfg->cryptFct_) {
  ------------------
  |  Branch (1366:12): [True: 402, False: 686]
  ------------------
 1367|    402|    const byte* pData = object->pData();
 1368|    402|    size_t size = object->TiffEntryBase::doSize();
 1369|    402|    auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
 1370|    402|    if (!buf->empty())
  ------------------
  |  Branch (1370:9): [True: 301, False: 101]
  ------------------
 1371|    301|      object->setData(std::move(buf));
 1372|    402|  }
 1373|       |
 1374|  1.08k|  const ArrayDef* defs = object->def();
 1375|  1.08k|  const ArrayDef* defsEnd = defs + object->defSize();
 1376|  1.08k|  const ArrayDef* def = &cfg->elDefaultDef_;
 1377|  1.08k|  ArrayDef gap = *def;
 1378|       |
 1379|   385k|  for (size_t idx = 0; idx < object->TiffEntryBase::doSize();) {
  ------------------
  |  Branch (1379:24): [True: 384k, False: 1.08k]
  ------------------
 1380|   384k|    if (defs) {
  ------------------
  |  Branch (1380:9): [True: 368k, False: 15.9k]
  ------------------
 1381|   368k|      def = std::find(defs, defsEnd, idx);
 1382|   368k|      if (def == defsEnd) {
  ------------------
  |  Branch (1382:11): [True: 366k, False: 2.04k]
  ------------------
 1383|   366k|        if (cfg->concat_) {
  ------------------
  |  Branch (1383:13): [True: 386, False: 366k]
  ------------------
 1384|       |          // Determine gap-size
 1385|    386|          const ArrayDef* xdef = defs;
 1386|  1.97k|          for (; xdef != defsEnd && xdef->idx_ <= idx; ++xdef) {
  ------------------
  |  Branch (1386:18): [True: 1.88k, False: 96]
  |  Branch (1386:37): [True: 1.59k, False: 290]
  ------------------
 1387|  1.59k|          }
 1388|    386|          size_t gapSize = 0;
 1389|    386|          if (xdef != defsEnd && xdef->idx_ > idx) {
  ------------------
  |  Branch (1389:15): [True: 290, False: 96]
  |  Branch (1389:34): [True: 290, False: 0]
  ------------------
 1390|    290|            gapSize = xdef->idx_ - idx;
 1391|    290|          } else {
 1392|     96|            gapSize = object->TiffEntryBase::doSize() - idx;
 1393|     96|          }
 1394|    386|          gap.idx_ = idx;
 1395|    386|          gap.tiffType_ = cfg->elDefaultDef_.tiffType_;
 1396|    386|          gap.count_ = gapSize / cfg->tagStep();
 1397|    386|          if (gap.count_ * cfg->tagStep() != gapSize) {
  ------------------
  |  Branch (1397:15): [True: 16, False: 370]
  ------------------
 1398|     16|            gap.tiffType_ = ttUndefined;
 1399|     16|            gap.count_ = gapSize;
 1400|     16|          }
 1401|    386|          def = &gap;
 1402|   366k|        } else {
 1403|   366k|          def = &cfg->elDefaultDef_;
 1404|   366k|        }
 1405|   366k|      }
 1406|   368k|    }
 1407|   384k|    idx += object->addElement(idx, *def);  // idx may be different from def->idx_
 1408|   384k|  }
 1409|       |
 1410|  1.08k|}  // TiffReader::visitBinaryArray
_ZN5Exiv28Internal10TiffReader18visitBinaryElementEPNS0_17TiffBinaryElementE:
 1412|   389k|void TiffReader::visitBinaryElement(TiffBinaryElement* object) {
 1413|   389k|  auto pData = object->start();
 1414|   389k|  size_t size = object->TiffEntryBase::doSize();
 1415|   389k|  ByteOrder bo = object->elByteOrder();
 1416|   389k|  if (bo == invalidByteOrder)
  ------------------
  |  Branch (1416:7): [True: 287k, False: 101k]
  ------------------
 1417|   287k|    bo = byteOrder();
 1418|   389k|  TypeId typeId = toTypeId(object->elDef()->tiffType_, object->tag(), object->group());
 1419|   389k|  auto v = Value::create(typeId);
 1420|   389k|  enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1421|   389k|  v->read(pData, size, bo);
 1422|       |
 1423|   389k|  object->setValue(std::move(v));
 1424|   389k|  object->setOffset(0);
 1425|   389k|  object->setIdx(nextIdx(object->group()));
 1426|   389k|}
tiffvisitor_int.cpp:_ZN5Exiv28InternalL7findTagEPKNS_7TagInfoEt:
  347|  11.4k|static const TagInfo* findTag(const TagInfo* pList, uint16_t tag) {
  348|   801k|  while (pList->tag_ != 0xffff && pList->tag_ != tag)
  ------------------
  |  Branch (348:10): [True: 801k, False: 0]
  |  Branch (348:35): [True: 789k, False: 11.4k]
  ------------------
  349|   789k|    pList++;
  350|  11.4k|  return pList->tag_ != 0xffff ? pList : nullptr;
  ------------------
  |  Branch (350:10): [True: 11.4k, False: 0]
  ------------------
  351|  11.4k|}

_ZN5Exiv28Internal11TiffVisitorD2Ev:
   64|  29.8k|  virtual ~TiffVisitor() = default;
_ZN5Exiv28Internal11TiffEncoderD2Ev:
  355|  4.19k|  ~TiffEncoder() override = default;
_ZN5Exiv28Internal11TiffRwStateC2ENS_9ByteOrderEm:
  538|  15.6k|  constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
  539|  15.6k|  }
_ZN5Exiv28Internal10TiffFinderC2EtNS_5IfdIdE:
  141|   140k|  constexpr TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  142|   140k|  }
_ZN5Exiv28Internal11TiffVisitorC2Ev:
   62|   170k|  TiffVisitor() = default;
_ZNK5Exiv28Internal10TiffFinder6resultEv:
  180|   140k|  [[nodiscard]] TiffComponent* result() const {
  181|   140k|    return tiffComponent_;
  182|   140k|  }
_ZNK5Exiv28Internal11TiffEncoder9byteOrderEv:
  458|   135k|  [[nodiscard]] ByteOrder byteOrder() const {
  459|   135k|    return byteOrder_;
  460|   135k|  }
_ZNK5Exiv28Internal11TiffEncoder11writeMethodEv:
  467|  19.4k|  [[nodiscard]] WriteMethod writeMethod() const {
  468|  19.4k|    return writeMethod_;
  469|  19.4k|  }
_ZNK5Exiv28Internal11TiffRwState9byteOrderEv:
  548|  3.93M|  [[nodiscard]] ByteOrder byteOrder() const {
  549|  3.93M|    return byteOrder_;
  550|  3.93M|  }
_ZNK5Exiv28Internal11TiffRwState10baseOffsetEv:
  562|   676k|  [[nodiscard]] size_t baseOffset() const {
  563|   676k|    return baseOffset_;
  564|   676k|  }

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   96|  1.77M|size_t TypeInfo::typeSize(TypeId typeId) {
   97|  1.77M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (97:12): [True: 1.02M, False: 742k]
  ------------------
   98|  1.02M|    return tit->size_;
   99|   742k|  return 0;
  100|  1.77M|}
_ZN5Exiv27DataBufC2Em:
  102|   513k|DataBuf::DataBuf(size_t size) : pData_(size) {
  103|   513k|}
_ZN5Exiv27DataBufC2EPKhm:
  105|  53.4k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
  106|  53.4k|}
_ZN5Exiv27DataBuf5allocEm:
  108|  14.6k|void DataBuf::alloc(size_t size) {
  109|  14.6k|  pData_.resize(size);
  110|  14.6k|}
_ZN5Exiv27DataBuf6resizeEm:
  112|  80.2k|void DataBuf::resize(size_t size) {
  113|  80.2k|  pData_.resize(size);
  114|  80.2k|}
_ZN5Exiv27DataBuf5resetEv:
  116|  31.2k|void DataBuf::reset() {
  117|  31.2k|  pData_.clear();
  118|  31.2k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  120|  2.96M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  121|  2.96M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (121:7): [True: 0, False: 2.96M]
  ------------------
  122|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  123|      0|  }
  124|  2.96M|  return pData_[offset];
  125|  2.96M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  127|  4.10M|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  128|  4.10M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 4.10M]
  ------------------
  129|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  130|      0|  }
  131|  4.10M|  pData_[offset] = x;
  132|  4.10M|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  134|   312k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  135|   312k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 312k]
  |  Branch (135:28): [True: 1, False: 312k]
  ------------------
  136|      1|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  137|      1|  }
  138|   312k|  return getUShort(&pData_[offset], byteOrder);
  139|   312k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  141|  4.19k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  142|  4.19k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 4.19k]
  |  Branch (142:28): [True: 0, False: 4.19k]
  ------------------
  143|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  144|      0|  }
  145|  4.19k|  us2Data(&pData_[offset], x, byteOrder);
  146|  4.19k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  148|   297k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  149|   297k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (149:7): [True: 1, False: 297k]
  |  Branch (149:28): [True: 2, False: 297k]
  ------------------
  150|      3|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  151|      3|  }
  152|   297k|  return getULong(&pData_[offset], byteOrder);
  153|   297k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  155|  4.19k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  156|  4.19k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.19k]
  |  Branch (156:28): [True: 0, False: 4.19k]
  ------------------
  157|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  158|      0|  }
  159|  4.19k|  ul2Data(&pData_[offset], x, byteOrder);
  160|  4.19k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  162|  4.87k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  163|  4.87k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (163:7): [True: 0, False: 4.87k]
  |  Branch (163:28): [True: 0, False: 4.87k]
  ------------------
  164|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  165|      0|  }
  166|  4.87k|  return getULongLong(&pData_[offset], byteOrder);
  167|  4.87k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  176|   227k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  177|   227k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (177:7): [True: 0, False: 227k]
  |  Branch (177:34): [True: 0, False: 227k]
  ------------------
  178|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  179|      0|  }
  180|   227k|  return memcmp(&pData_[offset], buf, bufsize);
  181|   227k|}
_ZN5Exiv27DataBuf4dataEm:
  183|  3.21M|byte* Exiv2::DataBuf::data(size_t offset) {
  184|  3.21M|  return const_cast<byte*>(c_data(offset));
  185|  3.21M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  187|  3.41M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  188|  3.41M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (188:7): [True: 17.0k, False: 3.39M]
  |  Branch (188:25): [True: 1.02k, False: 3.39M]
  ------------------
  189|  18.1k|    return nullptr;
  190|  18.1k|  }
  191|  3.39M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (191:7): [True: 0, False: 3.39M]
  ------------------
  192|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  193|      0|  }
  194|  3.39M|  return &pData_[offset];
  195|  3.39M|}
_ZNK5Exiv27DataBuf5c_strEm:
  197|  52.4k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  198|  52.4k|  return reinterpret_cast<const char*>(c_data(offset));
  199|  52.4k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  220|  3.27k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  221|  3.27k|  return os << r.first << "/" << r.second;
  222|  3.27k|}
_ZN5Exiv2rsERNSt3__113basic_istreamIcNS0_11char_traitsIcEEEERNS0_4pairIiiEE:
  245|    326|std::istream& operator>>(std::istream& is, Rational& r) {
  246|    326|  return fromStreamToRational(is, r);
  247|    326|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  249|  9.06k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  250|  9.06k|  return os << r.first << "/" << r.second;
  251|  9.06k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  257|  3.72M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  258|  3.72M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  259|  3.72M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  261|  3.69M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  262|  3.69M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (262:7): [True: 1.20M, False: 2.49M]
  ------------------
  263|  1.20M|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  264|  1.20M|  }
  265|  2.49M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  266|  3.69M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  268|  33.1k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  269|  33.1k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (269:7): [True: 4.56k, False: 28.6k]
  ------------------
  270|  4.56k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  271|  4.56k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  272|  4.56k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  273|  4.56k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  274|  4.56k|  }
  275|  28.6k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  276|  28.6k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  277|  28.6k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  278|  28.6k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  279|  33.1k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  281|   558k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  282|   558k|  uint32_t nominator = getULong(buf, byteOrder);
  283|   558k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  284|   558k|  return {nominator, denominator};
  285|   558k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  287|   676k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  288|   676k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (288:7): [True: 658k, False: 18.2k]
  ------------------
  289|   658k|    return buf[1] << 8 | buf[0];
  290|   658k|  }
  291|  18.2k|  return buf[0] << 8 | buf[1];
  292|   676k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  294|   307k|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  295|   307k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (295:7): [True: 20.0k, False: 287k]
  ------------------
  296|  20.0k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  297|  20.0k|  }
  298|   287k|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  299|   307k|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  301|  43.8k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  302|  43.8k|  int32_t nominator = getLong(buf, byteOrder);
  303|  43.8k|  int32_t denominator = getLong(buf + 4, byteOrder);
  304|  43.8k|  return {nominator, denominator};
  305|  43.8k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  307|   184k|float getFloat(const byte* buf, ByteOrder byteOrder) {
  308|       |  // This algorithm assumes that the internal representation of the float
  309|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  310|       |  // required by the C++ standard.
  311|   184k|#ifdef __cpp_lib_bit_cast
  312|   184k|  return std::bit_cast<float>(getULong(buf, byteOrder));
  313|       |#else
  314|       |  union {
  315|       |    uint32_t ul_;
  316|       |    float f_;
  317|       |  } u;
  318|       |  u.ul_ = getULong(buf, byteOrder);
  319|       |  return u.f_;
  320|       |#endif
  321|   184k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  323|   116k|double getDouble(const byte* buf, ByteOrder byteOrder) {
  324|       |  // This algorithm assumes that the internal representation of the double
  325|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  326|       |  // required by the C++ standard.
  327|   116k|#ifdef __cpp_lib_bit_cast
  328|   116k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (328:7): [True: 64.2k, False: 52.5k]
  ------------------
  329|  64.2k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  330|  64.2k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  331|  64.2k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  332|  64.2k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  333|  52.5k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  334|  52.5k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  335|  52.5k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  336|  52.5k|                               static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]));
  337|       |#else
  338|       |  union {
  339|       |    uint64_t ull_;
  340|       |    double d_;
  341|       |  } u;
  342|       |  u.ull_ = 0;
  343|       |  if (byteOrder == littleEndian) {
  344|       |    u.ull_ = static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  345|       |             static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  346|       |             static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  347|       |             static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  348|       |  } else {
  349|       |    u.ull_ = static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  350|       |             static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  351|       |             static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  352|       |             static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  353|       |  }
  354|       |  return u.d_;
  355|       |#endif
  356|   116k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  358|   522k|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  359|   522k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (359:7): [True: 522k, False: 424]
  ------------------
  360|   522k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  361|   522k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  362|   522k|  } else {
  363|    424|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  364|    424|    buf[1] = static_cast<byte>(s & 0x00ffU);
  365|    424|  }
  366|   522k|  return 2;
  367|   522k|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  369|   429k|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  370|   429k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (370:7): [True: 428k, False: 760]
  ------------------
  371|   428k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  372|   428k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  373|   428k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  374|   428k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  375|   428k|  } else {
  376|    760|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  377|    760|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  378|    760|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  379|    760|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  380|    760|  }
  381|   429k|  return 4;
  382|   429k|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  399|  57.7k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  400|  57.7k|  size_t o = ul2Data(buf, l.first, byteOrder);
  401|  57.7k|  o += ul2Data(buf + o, l.second, byteOrder);
  402|  57.7k|  return o;
  403|  57.7k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  405|  15.5k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  406|  15.5k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (406:7): [True: 15.2k, False: 248]
  ------------------
  407|  15.2k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  408|  15.2k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  409|  15.2k|  } else {
  410|    248|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  411|    248|    buf[1] = static_cast<byte>(s & 0x00ffU);
  412|    248|  }
  413|  15.5k|  return 2;
  414|  15.5k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  416|   237k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  417|   237k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (417:7): [True: 236k, False: 740]
  ------------------
  418|   236k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  419|   236k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  420|   236k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  421|   236k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  422|   236k|  } else {
  423|    740|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  424|    740|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  425|    740|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  426|    740|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  427|    740|  }
  428|   237k|  return 4;
  429|   237k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  431|  41.9k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  432|  41.9k|  size_t o = l2Data(buf, l.first, byteOrder);
  433|  41.9k|  o += l2Data(buf + o, l.second, byteOrder);
  434|  41.9k|  return o;
  435|  41.9k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  437|  18.1k|size_t f2Data(byte* buf, float f, ByteOrder byteOrder) {
  438|       |  // This algorithm assumes that the internal representation of the float
  439|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  440|       |  // required by the C++ standard.
  441|  18.1k|#ifdef __cpp_lib_bit_cast
  442|  18.1k|  return ul2Data(buf, std::bit_cast<uint32_t>(f), byteOrder);
  443|       |#else
  444|       |  union {
  445|       |    uint32_t ul_;
  446|       |    float f_;
  447|       |  } u;
  448|       |  u.f_ = f;
  449|       |  return ul2Data(buf, u.ul_, byteOrder);
  450|       |#endif
  451|  18.1k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  453|  3.50k|size_t d2Data(byte* buf, double d, ByteOrder byteOrder) {
  454|       |  // This algorithm assumes that the internal representation of the double
  455|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  456|       |  // required by the C++ standard.
  457|  3.50k|  union {
  458|  3.50k|    uint64_t ull_;
  459|  3.50k|    double d_;
  460|  3.50k|  } u;
  461|  3.50k|  u.d_ = d;
  462|  3.50k|  uint64_t m = 0xff;
  463|  3.50k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (463:7): [True: 3.30k, False: 204]
  ------------------
  464|  3.30k|    buf[0] = static_cast<byte>(u.ull_ & m);
  465|  3.30k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  466|  3.30k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  467|  3.30k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|  3.30k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  469|  3.30k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  470|  3.30k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  471|  3.30k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  472|  3.30k|  } else {
  473|    204|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  474|    204|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  475|    204|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  476|    204|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  477|    204|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  478|    204|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  479|    204|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  480|    204|    buf[7] = static_cast<byte>(u.ull_ & m);
  481|    204|  }
  482|  3.50k|  return 8;
  483|  3.50k|}
_ZN5Exiv28stringToIbEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  567|    297|bool stringTo<bool>(const std::string& s, bool& ok) {
  568|    297|  if (s.empty())
  ------------------
  |  Branch (568:7): [True: 3, False: 294]
  ------------------
  569|      3|    return false;
  570|    294|  auto lcs = Internal::lower(s); /* lowercase string */
  571|       |  /* handle the same values as xmp sdk */
  572|    294|  if (lcs == "false" || lcs == "f" || lcs == "0") {
  ------------------
  |  Branch (572:7): [True: 0, False: 294]
  |  Branch (572:25): [True: 1, False: 293]
  |  Branch (572:39): [True: 0, False: 293]
  ------------------
  573|      1|    ok = true;
  574|      1|    return false;
  575|      1|  }
  576|    293|  if (lcs == "true" || lcs == "t" || lcs == "1") {
  ------------------
  |  Branch (576:7): [True: 2, False: 291]
  |  Branch (576:24): [True: 5, False: 286]
  |  Branch (576:38): [True: 0, False: 286]
  ------------------
  577|      7|    ok = true;
  578|      7|    return true;
  579|      7|  }
  580|    286|  ok = false;
  581|    286|  return false;
  582|    293|}
_ZN5Exiv210parseInt64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERb:
  584|    338|int64_t parseInt64(const std::string& s, bool& ok) {
  585|    338|  auto ret = stringTo<int64_t>(s, ok);
  586|    338|  if (ok)
  ------------------
  |  Branch (586:7): [True: 9, False: 329]
  ------------------
  587|      9|    return ret;
  588|       |
  589|    329|  auto d = stringTo<double>(s, ok);
  590|    329|  if (ok) {
  ------------------
  |  Branch (590:7): [True: 3, False: 326]
  ------------------
  591|      3|    std::feclearexcept(FE_ALL_EXCEPT);
  592|      3|    auto ll = std::llround(d);
  593|      3|    if (!std::fetestexcept(FE_INVALID) && std::numeric_limits<int64_t>::min() <= ll &&
  ------------------
  |  Branch (593:9): [True: 3, False: 0]
  |  Branch (593:43): [True: 3, False: 0]
  ------------------
  594|      3|        ll <= std::numeric_limits<int64_t>::max()) {
  ------------------
  |  Branch (594:9): [True: 3, False: 0]
  ------------------
  595|      3|      return static_cast<int64_t>(ll);
  596|      3|    }
  597|      3|  }
  598|       |
  599|    326|  auto [r, st] = stringTo<Rational>(s, ok);
  600|    326|  if (ok) {
  ------------------
  |  Branch (600:7): [True: 29, False: 297]
  ------------------
  601|     29|    if (st <= 0) {
  ------------------
  |  Branch (601:9): [True: 4, False: 25]
  ------------------
  602|      4|      ok = false;
  603|      4|      return 0;
  604|      4|    }
  605|     25|    return static_cast<int64_t>(static_cast<float>(r) / st);
  606|     29|  }
  607|       |
  608|    297|  bool b = stringTo<bool>(s, ok);
  609|    297|  if (ok)
  ------------------
  |  Branch (609:7): [True: 8, False: 289]
  ------------------
  610|      8|    return b ? 1 : 0;
  ------------------
  |  Branch (610:12): [True: 7, False: 1]
  ------------------
  611|       |
  612|       |  // everything failed, return from stringTo<int64_t> is probably the best fit
  613|    289|  return ret;
  614|    297|}
_ZN5Exiv219floatToRationalCastEf:
  667|     55|Rational floatToRationalCast(float f) {
  668|       |  // Convert f to double because it simplifies the range checks
  669|       |  // below. (All int values can be losslessly converted to double, but
  670|       |  // sometimes get rounded when converted to float.)
  671|     55|  const double d = f;
  672|       |  // Beware: primitive conversion algorithm
  673|     55|  int32_t den;
  674|     55|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (674:7): [True: 49, False: 6]
  ------------------
  675|     49|    den = 1000000;
  676|     49|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (676:14): [True: 0, False: 6]
  ------------------
  677|      0|    den = 10000;
  678|      6|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (678:14): [True: 0, False: 6]
  ------------------
  679|      0|    den = 100;
  680|      6|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (680:14): [True: 0, False: 6]
  ------------------
  681|      0|    den = 1;
  682|      6|  } else {
  683|      6|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (683:13): [True: 0, False: 6]
  ------------------
  684|      6|  }
  685|     49|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  686|     49|  const int32_t g = std::gcd(nom, den);
  687|       |
  688|     49|  return {nom / g, den / g};
  689|     55|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   44|  21.1M|  bool operator==(Exiv2::TypeId typeId) const {
   45|  21.1M|    return typeId_ == typeId;
   46|  21.1M|  }
types.cpp:_ZN5Exiv2L20fromStreamToRationalINSt3__14pairIiiEEEERNS1_13basic_istreamIcNS1_11char_traitsIcEEEES8_RT_:
  224|    326|static std::istream& fromStreamToRational(std::istream& is, auto& r) {
  225|       |  // http://dev.exiv2.org/boards/3/topics/1912?r=1915
  226|    326|  if (std::tolower(is.peek()) == 'f') {
  ------------------
  |  Branch (226:7): [True: 34, False: 292]
  ------------------
  227|     34|    char F = 0;
  228|     34|    float f = 0.F;
  229|     34|    is >> F >> f;
  230|     34|    f = 2.0F * std::log2(f);
  231|     34|    r = Exiv2::floatToRationalCast(f);
  232|    292|  } else {
  233|    292|    int32_t nominator = 0;
  234|    292|    int32_t denominator = 0;
  235|    292|    char c('\0');
  236|    292|    is >> nominator >> c >> denominator;
  237|    292|    if (c != '/')
  ------------------
  |  Branch (237:9): [True: 154, False: 138]
  ------------------
  238|    154|      is.setstate(std::ios::failbit);
  239|    292|    if (is)
  ------------------
  |  Branch (239:9): [True: 128, False: 164]
  ------------------
  240|    128|      r = {nominator, denominator};
  241|    292|  }
  242|    326|  return is;
  243|    326|}

_ZN5Exiv28Internal5upperENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
    8|  43.0k|std::string upper(std::string_view str) {
    9|  43.0k|  std::string result;
   10|  43.0k|  result.reserve(str.size());
   11|  43.0k|  for (auto c : str)
  ------------------
  |  Branch (11:15): [True: 172k, False: 43.0k]
  ------------------
   12|   172k|    result.push_back(std::toupper(static_cast<unsigned char>(c)));
   13|  43.0k|  return result;
   14|  43.0k|}
_ZN5Exiv28Internal5lowerENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   16|    294|std::string lower(std::string_view a) {
   17|    294|  std::string b;
   18|    294|  b.reserve(a.size());
   19|    294|  for (auto c : a)
  ------------------
  |  Branch (19:15): [True: 9.00k, False: 294]
  ------------------
   20|  9.00k|    b.push_back(std::tolower(static_cast<unsigned char>(c)));
   21|    294|  return b;
   22|    294|}

_ZN5Exiv28Internal8containsIPKcEEbNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEET_:
    9|  97.8k|constexpr bool contains(std::string_view s, auto c) {
   10|       |#ifdef __cpp_lib_string_contains
   11|       |  return s.contains(c);
   12|       |#else
   13|  97.8k|  return s.find(c) != std::string_view::npos;
   14|  97.8k|#endif
   15|  97.8k|}

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  1.44M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  1.44M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  1.03M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  1.03M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 1.03M]
  ------------------
   25|  2.60k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 2.60k, False: 1.02M]
  ------------------
   26|   373k|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 370k, False: 660k]
  ------------------
   27|   373k|      return std::make_unique<DataValue>(typeId);
   28|  13.6k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 13.6k, False: 1.01M]
  ------------------
   29|  13.6k|      return std::make_unique<AsciiValue>();
   30|  29.6k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 29.6k, False: 1.00M]
  ------------------
   31|  29.6k|      return std::make_unique<ValueType<uint16_t>>();
   32|  26.3k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 26.3k, False: 1.00M]
  ------------------
   33|  29.2k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 2.89k, False: 1.02M]
  ------------------
   34|  29.2k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  6.69k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 6.69k, False: 1.02M]
  ------------------
   36|  6.69k|      return std::make_unique<ValueType<URational>>();
   37|  8.10k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 8.10k, False: 1.02M]
  ------------------
   38|  8.10k|      return std::make_unique<DataValue>();
   39|  13.7k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 13.7k, False: 1.01M]
  ------------------
   40|  13.7k|      return std::make_unique<ValueType<int16_t>>();
   41|  8.45k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 8.45k, False: 1.02M]
  ------------------
   42|  8.45k|      return std::make_unique<ValueType<int32_t>>();
   43|  2.78k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 2.78k, False: 1.02M]
  ------------------
   44|  2.78k|      return std::make_unique<ValueType<Rational>>();
   45|  3.18k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 3.18k, False: 1.02M]
  ------------------
   46|  3.18k|      return std::make_unique<ValueType<float>>();
   47|  5.17k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 5.17k, False: 1.02M]
  ------------------
   48|  5.17k|      return std::make_unique<ValueType<double>>();
   49|  40.2k|    case string:
  ------------------
  |  Branch (49:5): [True: 40.2k, False: 991k]
  ------------------
   50|  40.2k|      return std::make_unique<StringValue>();
   51|  6.75k|    case date:
  ------------------
  |  Branch (51:5): [True: 6.75k, False: 1.02M]
  ------------------
   52|  6.75k|      return std::make_unique<DateValue>();
   53|  21.6k|    case time:
  ------------------
  |  Branch (53:5): [True: 21.6k, False: 1.00M]
  ------------------
   54|  21.6k|      return std::make_unique<TimeValue>();
   55|    530|    case comment:
  ------------------
  |  Branch (55:5): [True: 530, False: 1.03M]
  ------------------
   56|    530|      return std::make_unique<CommentValue>();
   57|  46.2k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 46.2k, False: 985k]
  ------------------
   58|  46.2k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 1.03M]
  ------------------
   60|  7.67k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 7.67k, False: 1.02M]
  ------------------
   61|  7.67k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 1.03M]
  ------------------
   62|  7.67k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 1.03M]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|   414k|    default:
  ------------------
  |  Branch (65:5): [True: 414k, False: 617k]
  ------------------
   66|   414k|      return std::make_unique<DataValue>(typeId);
   67|  1.03M|  }
   68|  1.03M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|  1.95k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|  1.95k|  return -1;
   72|  1.95k|}
_ZNK5Exiv25Value8toStringEv:
   74|  34.7k|std::string Value::toString() const {
   75|  34.7k|  std::ostringstream os;
   76|  34.7k|  write(os);
   77|  34.7k|  ok_ = !os.fail();
   78|  34.7k|  return os.str();
   79|  34.7k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  18.3k|size_t Value::sizeDataArea() const {
   86|  18.3k|  return 0;
   87|  18.3k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|    155|DataBuf Value::dataArea() const {
   90|    155|  return {nullptr, 0};
   91|    155|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|   795k|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|   795k|}
_ZNK5Exiv29DataValue5countEv:
  100|  1.10M|size_t DataValue::count() const {
  101|  1.10M|  return size();
  102|  1.10M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|   795k|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|   795k|  value_.assign(buf, buf + len);
  107|   795k|  return 0;
  108|   795k|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|   125k|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|   125k|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|   125k|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  1.45M|size_t DataValue::size() const {
  128|  1.45M|  return value_.size();
  129|  1.45M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  2.06M|DataValue* DataValue::clone_() const {
  132|  2.06M|  return new DataValue(*this);
  133|  2.06M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.07k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.07k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.77k, False: 302]
  ------------------
  137|  1.77k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.77k|    os << static_cast<int>(value_.back());
  139|  1.77k|  }
  140|  2.07k|  return os;
  141|  2.07k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  41.8k|int64_t DataValue::toInt64(size_t n) const {
  149|  41.8k|  ok_ = true;
  150|  41.8k|  return value_.at(n);
  151|  41.8k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|   100k|uint32_t DataValue::toUint32(size_t n) const {
  154|   100k|  ok_ = true;
  155|   100k|  return value_.at(n);
  156|   100k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  4.97k|int StringValueBase::read(const std::string& buf) {
  173|  4.97k|  value_ = buf;
  174|  4.97k|  return 0;
  175|  4.97k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  47.8k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  47.8k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 47.8k, False: 0]
  ------------------
  180|  47.8k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  47.8k|  return 0;
  182|  47.8k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  1.64k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  1.64k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 1.09k, False: 551]
  ------------------
  186|  1.09k|    return 0;
  187|       |  // byteOrder not needed
  188|    551|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  1.64k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|  23.1k|size_t StringValueBase::count() const {
  192|  23.1k|  return size();
  193|  23.1k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|  27.5k|size_t StringValueBase::size() const {
  196|  27.5k|  return value_.size();
  197|  27.5k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|    642|int64_t StringValueBase::toInt64(size_t n) const {
  204|    642|  ok_ = true;
  205|    642|  return static_cast<signed char>(value_.at(n));
  206|    642|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  7.59k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  7.59k|  ok_ = true;
  210|  7.59k|  return static_cast<unsigned char>(value_.at(n));
  211|  7.59k|}
_ZN5Exiv211StringValueC2Ev:
  223|  40.2k|StringValue::StringValue() : StringValueBase(string) {
  224|  40.2k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|  67.6k|StringValue* StringValue::clone_() const {
  230|  67.6k|  return new StringValue(*this);
  231|  67.6k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  13.7k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  13.7k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  3.20k|int AsciiValue::read(const std::string& buf) {
  240|  3.20k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  3.20k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 29, False: 3.17k]
  |  Branch (242:25): [True: 3.17k, False: 0]
  ------------------
  243|  3.20k|    value_ += '\0';
  244|  3.20k|  }
  245|  3.20k|  return 0;
  246|  3.20k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|  30.2k|AsciiValue* AsciiValue::clone_() const {
  249|  30.2k|  return new AsciiValue(*this);
  250|  30.2k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  8.86k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  8.86k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  8.86k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 2.14k, False: 6.71k]
  ------------------
  256|  2.14k|    pos = value_.size();
  257|  8.86k|  return os << value_.substr(0, pos);
  258|  8.86k|}
_ZN5Exiv212CommentValueC2Ev:
  292|    530|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|    530|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|    530|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|    530|  byteOrder_ = byteOrder;
  331|    530|  return StringValueBase::read(buf, len, byteOrder);
  332|    530|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|  1.06k|CommentValue* CommentValue::clone_() const {
  411|  1.06k|  return new CommentValue(*this);
  412|  1.06k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  32.6k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  32.6k|  xmpArrayType_ = xmpArrayType;
  416|  32.6k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  22.5k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  22.5k|  xmpStruct_ = xmpStruct;
  420|  22.5k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|  16.2k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|  16.2k|  return xmpArrayType_;
  424|  16.2k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  32.4k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  32.4k|  XmpArrayType xa = xaNone;
  428|  32.4k|  switch (typeId) {
  429|    967|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 967, False: 31.4k]
  ------------------
  430|    967|      xa = xaAlt;
  431|    967|      break;
  432|    620|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 620, False: 31.8k]
  ------------------
  433|    620|      xa = xaBag;
  434|    620|      break;
  435|  9.83k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 9.83k, False: 22.6k]
  ------------------
  436|  9.83k|      xa = xaSeq;
  437|  9.83k|      break;
  438|  21.0k|    default:
  ------------------
  |  Branch (438:5): [True: 21.0k, False: 11.4k]
  ------------------
  439|  21.0k|      break;
  440|  32.4k|  }
  441|  32.4k|  return xa;
  442|  32.4k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|  16.1k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|  16.1k|  return xmpStruct_;
  446|  16.1k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   172k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   172k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   624k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   624k|  std::string b = buf;
  478|   624k|  std::string type;
  479|   624k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 1.44k, False: 622k]
  ------------------
  480|  1.44k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  1.44k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  1.44k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 1.39k, False: 42]
  |  Branch (483:26): [True: 896, False: 503]
  ------------------
  484|    896|      type = type.substr(1);
  485|  1.44k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 1.32k, False: 118]
  |  Branch (485:26): [True: 75, False: 1.24k]
  ------------------
  486|     75|      type.pop_back();
  487|  1.44k|    b.clear();
  488|  1.44k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 822, False: 619]
  ------------------
  489|    822|      b = buf.substr(pos + 1);
  490|  1.44k|  }
  491|   624k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 1.32k, False: 622k]
  ------------------
  492|  1.32k|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 52, False: 1.27k]
  ------------------
  493|     52|      setXmpArrayType(XmpValue::xaAlt);
  494|  1.27k|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 37, False: 1.23k]
  ------------------
  495|     37|      setXmpArrayType(XmpValue::xaBag);
  496|  1.23k|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 79, False: 1.15k]
  ------------------
  497|     79|      setXmpArrayType(XmpValue::xaSeq);
  498|  1.15k|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 600, False: 555]
  ------------------
  499|    600|      setXmpStruct();
  500|    600|    } else {
  501|    555|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    555|    }
  503|  1.32k|  }
  504|   623k|  value_ = std::move(b);
  505|   623k|  return 0;
  506|   624k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|  16.1k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|  16.1k|  bool del = false;
  524|  16.1k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 39, False: 16.1k]
  ------------------
  525|     39|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 39, False: 0]
  ------------------
  526|     35|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 35, False: 4]
  ------------------
  527|     35|        os << "type=\"Alt\"";
  528|     35|        break;
  529|      0|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 0, False: 39]
  ------------------
  530|      0|        os << "type=\"Bag\"";
  531|      0|        break;
  532|      4|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 4, False: 35]
  ------------------
  533|      4|        os << "type=\"Seq\"";
  534|      4|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 39]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|     39|    }
  538|     39|    del = true;
  539|  16.1k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 2, False: 16.1k]
  ------------------
  540|      2|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 2, False: 0]
  ------------------
  541|      2|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 2, False: 0]
  ------------------
  542|      2|        os << "type=\"Struct\"";
  543|      2|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 2]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|      2|    }
  547|      2|    del = true;
  548|      2|  }
  549|  16.1k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 41, False: 16.1k]
  |  Branch (549:14): [True: 2, False: 39]
  ------------------
  550|      2|    os << " ";
  551|  16.1k|  return os << value_;
  552|  16.1k|}
_ZNK5Exiv212XmpTextValue7toInt64Em:
  554|    338|int64_t XmpTextValue::toInt64(size_t /*n*/) const {
  555|    338|  return parseInt64(value_, ok_);
  556|    338|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   345k|XmpTextValue* XmpTextValue::clone_() const {
  571|   345k|  return new XmpTextValue(*this);
  572|   345k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  10.4k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  10.4k|  setXmpArrayType(xmpArrayType(typeId));
  576|  10.4k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|  51.8k|int XmpArrayValue::read(const std::string& buf) {
  579|  51.8k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 39.9k, False: 11.8k]
  ------------------
  580|  39.9k|    value_.push_back(buf);
  581|  51.8k|  return 0;
  582|  51.8k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|    208|size_t XmpArrayValue::count() const {
  589|    208|  return value_.size();
  590|    208|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    201|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    201|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 183, False: 18]
  ------------------
  594|    183|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    183|    os << value_.back();
  596|    183|  }
  597|    201|  return os;
  598|    201|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|  4.22k|std::string XmpArrayValue::toString(size_t n) const {
  601|  4.22k|  ok_ = true;
  602|  4.22k|  return value_.at(n);
  603|  4.22k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  20.6k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  20.6k|  return new XmpArrayValue(*this);
  623|  20.6k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|    916|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|    916|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    172|size_t LangAltValue::count() const {
  680|    172|  return value_.size();
  681|    172|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|     69|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|     69|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|     69|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 69]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|     69|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 69, False: 69]
  ------------------
  694|     69|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 69, False: 0]
  ------------------
  695|     69|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 69]
  ------------------
  696|      0|        os << ", ";
  697|     69|      os << "lang=\"" << lang << "\" " << s;
  698|     69|      first = false;
  699|     69|    }
  700|     69|  }
  701|     69|  return os;
  702|     69|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    265|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    265|  return toString("x-default");
  706|    265|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    265|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    265|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 93, False: 172]
  ------------------
  710|     93|    ok_ = true;
  711|     93|    return i->second;
  712|     93|  }
  713|    172|  ok_ = false;
  714|    172|  return "";
  715|    265|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  1.44k|LangAltValue* LangAltValue::clone_() const {
  738|  1.44k|  return new LangAltValue(*this);
  739|  1.44k|}
_ZN5Exiv29DateValueC2Ev:
  741|  6.75k|DateValue::DateValue() : Value(date) {
  742|  6.75k|  date_ = {};
  743|  6.75k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  6.75k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  6.75k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  6.75k|  return read(str);
  752|  6.75k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  6.75k|int DateValue::read(const std::string& buf) {
  755|       |  // ISO 8601 date formats:
  756|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  757|  6.75k|  size_t monthPos = 0;
  758|  6.75k|  size_t dayPos = 0;
  759|       |
  760|  6.75k|  auto printWarning = [] {
  761|  6.75k|#ifndef SUPPRESS_WARNINGS
  762|  6.75k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  6.75k|#endif
  764|  6.75k|  };
  765|       |
  766|  6.75k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 489, False: 6.27k]
  ------------------
  767|    489|    printWarning();
  768|    489|    return 1;
  769|    489|  }
  770|       |
  771|  6.27k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 1.77k, False: 4.49k]
  |  Branch (771:28): [True: 1.29k, False: 472]
  |  Branch (771:45): [True: 519, False: 780]
  |  Branch (771:63): [True: 4.48k, False: 1.26k]
  ------------------
  772|  5.00k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 519, False: 4.48k]
  ------------------
  773|    519|      monthPos = 5;
  774|    519|      dayPos = 8;
  775|  4.48k|    } else {
  776|  4.48k|      monthPos = 4;
  777|  4.48k|      dayPos = 6;
  778|  4.48k|    }
  779|       |
  780|  5.00k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  5.00k|      for (size_t i = start; i < start + count; ++i) {
  782|  5.00k|        if (!std::isdigit(buf[i])) {
  783|  5.00k|          printWarning();
  784|  5.00k|          return 1;
  785|  5.00k|        }
  786|  5.00k|      }
  787|  5.00k|      dest = std::stoul(buf.substr(start, count));
  788|  5.00k|      return 0;
  789|  5.00k|    };
  790|       |
  791|  5.00k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 1.49k, False: 3.50k]
  |  Branch (791:42): [True: 1.14k, False: 2.36k]
  |  Branch (791:83): [True: 663, False: 1.70k]
  ------------------
  792|  3.30k|      printWarning();
  793|  3.30k|      return 1;
  794|  3.30k|    }
  795|       |
  796|  1.70k|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 352, False: 1.35k]
  |  Branch (796:29): [True: 600, False: 750]
  ------------------
  797|    952|      date_.month = 0;
  798|    952|      date_.day = 0;
  799|    952|      printWarning();
  800|    952|      return 1;
  801|    952|    }
  802|    750|    return 0;
  803|  1.70k|  }
  804|  1.26k|  printWarning();
  805|  1.26k|  return 1;
  806|  6.27k|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|    865|DateValue* DateValue::clone_() const {
  835|    865|  return new DateValue(*this);
  836|    865|}
_ZN5Exiv29TimeValueC2Ev:
  877|  21.6k|TimeValue::TimeValue() : Value(time) {
  878|  21.6k|  time_ = {};
  879|  21.6k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  21.6k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  21.6k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  21.6k|  return read(str);
  888|  21.6k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  21.6k|int TimeValue::read(const std::string& buf) {
  891|       |  // ISO 8601 time formats:
  892|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  893|       |  // Not supported formats:
  894|       |  // 4.2.2.4 Representations with decimal fraction: 232050,5
  895|  21.6k|  auto printWarning = [] {
  896|  21.6k|#ifndef SUPPRESS_WARNINGS
  897|  21.6k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  21.6k|#endif
  899|  21.6k|    return 1;
  900|  21.6k|  };
  901|       |
  902|  21.6k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 290, False: 21.3k]
  ------------------
  903|    290|    return printWarning();
  904|       |
  905|  21.3k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 336k, False: 13.2k]
  ------------------
  906|   336k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 329k, False: 6.33k]
  |  Branch (906:21): [True: 325k, False: 4.23k]
  |  Branch (906:33): [True: 296k, False: 29.4k]
  |  Branch (906:45): [True: 294k, False: 1.44k]
  |  Branch (906:57): [True: 8.09k, False: 286k]
  ------------------
  907|  8.09k|      return printWarning();
  908|       |
  909|  13.2k|  size_t mpos;
  910|  13.2k|  size_t spos;
  911|  13.2k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 5.40k, False: 7.86k]
  ------------------
  912|  5.40k|    mpos = 3;
  913|  5.40k|    spos = 6;
  914|  7.86k|  } else {
  915|  7.86k|    mpos = 2;
  916|  7.86k|    spos = 4;
  917|  7.86k|  }
  918|       |
  919|  13.2k|  try {
  920|  13.2k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  13.2k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 535, False: 12.7k]
  |  Branch (921:19): [True: 174, False: 12.5k]
  ------------------
  922|    579|      return printWarning();
  923|  12.6k|    time_.hour = hi;
  924|  12.6k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 12.4k, False: 255]
  ------------------
  925|  12.4k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  12.4k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 446, False: 11.9k]
  |  Branch (926:21): [True: 254, False: 11.7k]
  ------------------
  927|    647|        return printWarning();
  928|  11.7k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  11.7k|    } else {
  930|    255|      time_.minute = 0;
  931|    255|    }
  932|  12.0k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 9.04k, False: 2.99k]
  ------------------
  933|  9.04k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  9.04k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 424, False: 8.62k]
  |  Branch (934:21): [True: 270, False: 8.35k]
  ------------------
  935|    461|        return printWarning();
  936|  8.58k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  8.58k|    } else {
  938|  2.99k|      time_.second = 0;
  939|  2.99k|    }
  940|       |
  941|  11.5k|    auto fpos = buf.find('+');
  942|  11.5k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 9.14k, False: 2.43k]
  ------------------
  943|  9.14k|      fpos = buf.find('-');
  944|       |
  945|  11.5k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 10.3k, False: 1.18k]
  ------------------
  946|  10.3k|      auto format = buf.substr(fpos, buf.size());
  947|       |      // Use the sign of the raw offset string rather than of the parsed
  948|       |      // tzHour: when the hour magnitude is 0 (e.g. "-00:30"), std::stoi
  949|       |      // returns 0, which loses the '-' sign that std::stoi("-00") cannot
  950|       |      // preserve. format always starts with '+' or '-' (see fpos above).
  951|  10.3k|      const bool negative = format.at(0) == '-';
  952|  10.3k|      auto posColon = format.find(':');
  953|  10.3k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (953:11): [True: 6.09k, False: 4.29k]
  ------------------
  954|       |        // Extended format
  955|  6.09k|        auto tzhi = std::stoi(format.substr(0, 3));
  956|  6.09k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (956:13): [True: 75, False: 6.02k]
  |  Branch (956:27): [True: 185, False: 5.83k]
  ------------------
  957|    232|          return printWarning();
  958|  5.86k|        time_.tzHour = tzhi;
  959|  5.86k|        if (format.size() > 3) {
  ------------------
  |  Branch (959:13): [True: 5.40k, False: 462]
  ------------------
  960|  5.40k|          int minute = std::stoi(format.substr(3));
  961|  5.40k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (961:15): [True: 4.35k, False: 1.05k]
  |  Branch (961:29): [True: 177, False: 874]
  ------------------
  962|  1.21k|            return printWarning();
  963|  4.19k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (963:28): [True: 677, False: 3.51k]
  ------------------
  964|  4.19k|        }
  965|  5.86k|      } else {
  966|       |        // Basic format
  967|  4.29k|        auto tzhi = std::stoi(format.substr(0, posColon));
  968|  4.29k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (968:13): [True: 986, False: 3.31k]
  |  Branch (968:27): [True: 154, False: 3.15k]
  ------------------
  969|    478|          return printWarning();
  970|  3.82k|        time_.tzHour = tzhi;
  971|  3.82k|        int minute = std::stoi(format.substr(posColon + 1));
  972|  3.82k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (972:13): [True: 1.86k, False: 1.95k]
  |  Branch (972:27): [True: 612, False: 1.34k]
  ------------------
  973|  1.51k|          return printWarning();
  974|  2.31k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (974:26): [True: 1.20k, False: 1.10k]
  ------------------
  975|  2.31k|      }
  976|  10.3k|    }
  977|  11.5k|  } catch (std::exception&) {
  978|       |    // std::stoi might throw an exception if the syntax is invalid.
  979|  4.73k|    return printWarning();
  980|  4.73k|  }
  981|  3.42k|  return 0;
  982|  13.2k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1017|  3.74k|TimeValue* TimeValue::clone_() const {
 1018|  3.74k|  return new TimeValue(*this);
 1019|  3.74k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  9.31k|  auto printWarning = [] {
  761|  9.31k|#ifndef SUPPRESS_WARNINGS
  762|  9.31k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  9.31k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9.31k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  9.31k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  9.31k|#endif
  764|  9.31k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  10.8k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  35.9k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 28.3k, False: 7.57k]
  ------------------
  782|  28.3k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 3.30k, False: 25.0k]
  ------------------
  783|  3.30k|          printWarning();
  784|  3.30k|          return 1;
  785|  3.30k|        }
  786|  28.3k|      }
  787|  7.57k|      dest = std::stoul(buf.substr(start, count));
  788|  7.57k|      return 0;
  789|  10.8k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  18.2k|  auto printWarning = [] {
  896|  18.2k|#ifndef SUPPRESS_WARNINGS
  897|  18.2k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  18.2k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18.2k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  18.2k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  18.2k|#endif
  899|  18.2k|    return 1;
  900|  18.2k|  };

_ZN5Exiv29WebPImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   78|    472|    Image(ImageType::webp, mdNone, std::move(io), params) {
   79|    472|}  // WebPImage::WebPImage
_ZNK5Exiv29WebPImage8mimeTypeEv:
   81|     78|std::string WebPImage::mimeType() const {
   82|     78|  return "image/webp";
   83|     78|}
_ZN5Exiv29WebPImage12readMetadataEv:
  476|    472|void WebPImage::readMetadata() {
  477|    472|  if (io_->open() != 0)
  ------------------
  |  Branch (477:7): [True: 0, False: 472]
  ------------------
  478|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  479|    472|  IoCloser closer(*io_);
  480|       |  // Ensure that this is the correct image type
  481|    472|  if (!isWebPType(*io_, true)) {
  ------------------
  |  Branch (481:7): [True: 0, False: 472]
  ------------------
  482|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (482:9): [True: 0, False: 0]
  |  Branch (482:25): [True: 0, False: 0]
  ------------------
  483|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  484|      0|    throw Error(ErrorCode::kerNotAJpeg);
  485|      0|  }
  486|    472|  clearMetadata();
  487|       |
  488|    472|  byte data[12];
  489|    472|  DataBuf chunkId(5);
  490|    472|  chunkId.write_uint8(4, '\0');
  491|       |
  492|    472|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  493|       |
  494|    472|  const uint32_t filesize = Safe::add(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian), 8U);
  495|    472|  Internal::enforce(filesize <= io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  496|       |
  497|    472|  WebPImage::decodeChunks(filesize);
  498|       |
  499|    472|}  // WebPImage::readMetadata
_ZN5Exiv29WebPImage12decodeChunksEj:
  501|    441|void WebPImage::decodeChunks(uint32_t filesize) {
  502|    441|  DataBuf chunkId(5);
  503|    441|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  504|    441|  bool has_canvas_data = false;
  505|       |
  506|       |#ifdef EXIV2_DEBUG_MESSAGES
  507|       |  std::cout << "Reading metadata" << '\n';
  508|       |#endif
  509|       |
  510|    441|  chunkId.write_uint8(4, '\0');
  511|  2.21k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (511:10): [True: 1.83k, False: 376]
  |  Branch (511:25): [True: 1.77k, False: 65]
  ------------------
  512|  1.77k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  513|  1.77k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  514|       |
  515|  1.77k|    const uint32_t size = Exiv2::getULong(size_buff.data(), littleEndian);
  516|       |
  517|       |    // Check that `size` is within bounds.
  518|  1.77k|    Internal::enforce(io_->tell() <= filesize, Exiv2::ErrorCode::kerCorruptedMetadata);
  519|  1.77k|    Internal::enforce(size <= (filesize - io_->tell()), Exiv2::ErrorCode::kerCorruptedMetadata);
  520|       |
  521|  1.77k|    if (DataBuf payload(size); payload.empty()) {
  ------------------
  |  Branch (521:32): [True: 756, False: 1.01k]
  ------------------
  522|    756|      io_->seek(size, BasicIo::cur);
  523|  1.01k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_canvas_data) {
  ------------------
  |  Branch (523:16): [True: 41, False: 974]
  |  Branch (523:66): [True: 35, False: 6]
  ------------------
  524|     35|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  525|       |
  526|     35|      has_canvas_data = true;
  527|     35|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  528|       |
  529|     35|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  530|       |
  531|       |      // Fetch width
  532|     35|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  533|     35|      size_buf.back() = 0;
  534|     35|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  535|       |
  536|       |      // Fetch height
  537|     35|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  538|     35|      size_buf.back() = 0;
  539|     35|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  540|    980|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_canvas_data) {
  ------------------
  |  Branch (540:16): [True: 30, False: 950]
  |  Branch (540:65): [True: 20, False: 10]
  ------------------
  541|     20|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  542|       |
  543|     20|      has_canvas_data = true;
  544|     20|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  545|     20|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  546|       |
  547|       |      // Fetch width""
  548|     20|      std::copy_n(payload.begin() + 6, 2, size_buf.begin());
  549|     20|      size_buf[2] = 0;
  550|     20|      size_buf[3] = 0;
  551|     20|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  552|       |
  553|       |      // Fetch height
  554|     20|      std::copy_n(payload.begin() + 8, 2, size_buf.begin());
  555|     20|      size_buf[2] = 0;
  556|     20|      size_buf[3] = 0;
  557|     20|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  558|    960|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_canvas_data) {
  ------------------
  |  Branch (558:16): [True: 26, False: 934]
  |  Branch (558:66): [True: 23, False: 3]
  ------------------
  559|     23|      Internal::enforce(size >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  560|       |
  561|     23|      has_canvas_data = true;
  562|     23|      std::array<byte, 2> size_buf_w;
  563|     23|      std::array<byte, 3> size_buf_h;
  564|       |
  565|     23|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  566|       |
  567|       |      // Fetch width
  568|     23|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  569|     23|      size_buf_w.back() &= 0x3F;
  570|     23|      pixelWidth_ = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  571|       |
  572|       |      // Fetch height
  573|     23|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  574|     23|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  575|     23|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  576|     23|      pixelHeight_ = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  577|    937|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_canvas_data) {
  ------------------
  |  Branch (577:16): [True: 20, False: 917]
  |  Branch (577:66): [True: 10, False: 10]
  ------------------
  578|     10|      Internal::enforce(size >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  579|       |
  580|     10|      has_canvas_data = true;
  581|     10|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  582|       |
  583|     10|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  584|       |
  585|       |      // Fetch width
  586|     10|      std::copy_n(payload.begin() + 6, 3, size_buf.begin());
  587|     10|      size_buf.back() = 0;
  588|     10|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  589|       |
  590|       |      // Fetch height
  591|     10|      std::copy_n(payload.begin() + 9, 3, size_buf.begin());
  592|     10|      size_buf.back() = 0;
  593|     10|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  594|    927|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (594:16): [True: 37, False: 890]
  ------------------
  595|     37|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  596|     37|      this->setIccProfile(std::move(payload));
  597|    890|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (597:16): [True: 348, False: 542]
  ------------------
  598|    348|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  599|       |
  600|    348|      std::array<byte, 2> size_buff2;
  601|       |      // 4 meaningful bytes + 2 padding bytes
  602|    348|      auto exifLongHeader = std::array<byte, 6>{0xFF, 0x01, 0xFF, 0xE1, 0x00, 0x00};
  603|    348|      auto exifShortHeader = std::array<byte, 6>{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  604|    348|      const byte exifTiffLEHeader[] = {0x49, 0x49, 0x2A};        // "MM*"
  605|    348|      const byte exifTiffBEHeader[] = {0x4D, 0x4D, 0x00, 0x2A};  // "II\0*"
  606|    348|      size_t offset = 0;
  607|    348|      bool s_header = false;
  608|    348|      bool le_header = false;
  609|    348|      bool be_header = false;
  610|    348|      size_t pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 4);
  611|       |
  612|    348|      if (pos == std::string::npos) {
  ------------------
  |  Branch (612:11): [True: 323, False: 25]
  ------------------
  613|    323|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 6);
  614|    323|        if (pos != std::string::npos) {
  ------------------
  |  Branch (614:13): [True: 0, False: 323]
  ------------------
  615|      0|          s_header = true;
  616|      0|        }
  617|    323|      }
  618|    348|      if (pos == std::string::npos) {
  ------------------
  |  Branch (618:11): [True: 323, False: 25]
  ------------------
  619|    323|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffLEHeader, 3);
  620|    323|        if (pos != std::string::npos) {
  ------------------
  |  Branch (620:13): [True: 87, False: 236]
  ------------------
  621|     87|          le_header = true;
  622|     87|        }
  623|    323|      }
  624|    348|      if (pos == std::string::npos) {
  ------------------
  |  Branch (624:11): [True: 236, False: 112]
  ------------------
  625|    236|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffBEHeader, 4);
  626|    236|        if (pos != std::string::npos) {
  ------------------
  |  Branch (626:13): [True: 80, False: 156]
  ------------------
  627|     80|          be_header = true;
  628|     80|        }
  629|    236|      }
  630|       |
  631|    348|      if (s_header) {
  ------------------
  |  Branch (631:11): [True: 0, False: 348]
  ------------------
  632|      0|        offset += 6;
  633|      0|      }
  634|    348|      if (be_header || le_header) {
  ------------------
  |  Branch (634:11): [True: 80, False: 268]
  |  Branch (634:24): [True: 87, False: 181]
  ------------------
  635|    167|        offset += 12;
  636|    167|      }
  637|       |
  638|    348|      const size_t sizePayload = Safe::add(payload.size(), offset);
  639|    348|      DataBuf rawExifData(sizePayload);
  640|       |
  641|    348|      if (s_header) {
  ------------------
  |  Branch (641:11): [True: 0, False: 348]
  ------------------
  642|      0|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  643|      0|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  644|      0|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  645|      0|      }
  646|       |
  647|    348|      if (be_header || le_header) {
  ------------------
  |  Branch (647:11): [True: 80, False: 268]
  |  Branch (647:24): [True: 87, False: 181]
  ------------------
  648|    167|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  649|    167|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  650|    167|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  651|    167|        std::copy(exifShortHeader.begin(), exifShortHeader.end(), rawExifData.begin() + 6);
  652|    167|      }
  653|       |
  654|    348|      std::copy(payload.begin(), payload.end(), rawExifData.begin() + offset);
  655|       |
  656|       |#ifdef EXIV2_DEBUG_MESSAGES
  657|       |      std::cout << "Display Hex Dump [size:" << sizePayload << "]" << '\n';
  658|       |      std::cout << binaryToHex(rawExifData.c_data(), sizePayload);
  659|       |#endif
  660|       |
  661|    348|      if (pos != std::string::npos) {
  ------------------
  |  Branch (661:11): [True: 192, False: 156]
  ------------------
  662|    192|        XmpData xmpData;
  663|    192|        const DecodeParams dp(max_recursion_depth_);
  664|    192|        ByteOrder bo = ExifParser::decode(exifData_, payload.c_data(pos), payload.size() - pos, dp);
  665|    192|        setByteOrder(bo);
  666|    192|      } else {
  667|    156|#ifndef SUPPRESS_WARNINGS
  668|    156|        EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    156|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 156]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    156|  LogMsg(LogMsg::warn).os()
  ------------------
  669|    156|#endif
  670|    156|        exifData_.clear();
  671|    156|      }
  672|    542|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (672:16): [True: 21, False: 521]
  ------------------
  673|     21|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  674|     21|      xmpPacket_.assign(payload.c_str(), payload.size());
  675|     21|      const DecodeParams dp(max_recursion_depth_);
  676|     21|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (676:11): [True: 21, False: 0]
  |  Branch (676:34): [True: 21, False: 0]
  ------------------
  677|     21|#ifndef SUPPRESS_WARNINGS
  678|     21|        EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|     21|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 21]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     21|  LogMsg(LogMsg::warn).os()
  ------------------
  679|     21|#endif
  680|     21|      } else {
  681|       |#ifdef EXIV2_DEBUG_MESSAGES
  682|       |        std::cout << "Display Hex Dump [size:" << payload.size() << "]" << '\n';
  683|       |        std::cout << binaryToHex(payload.c_data(), payload.size());
  684|       |#endif
  685|      0|      }
  686|    521|    } else {
  687|    521|      io_->seek(size, BasicIo::cur);
  688|    521|    }
  689|       |
  690|  1.77k|    if (io_->tell() % 2)
  ------------------
  |  Branch (690:9): [True: 200, False: 1.57k]
  ------------------
  691|    200|      io_->seek(+1, BasicIo::cur);
  692|  1.77k|  }
  693|    441|}
_ZN5Exiv215newWebPInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  697|    472|Image::UniquePtr newWebPInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  698|    472|  auto image = std::make_unique<WebPImage>(std::move(io), params);
  699|    472|  if (!image->good()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 472]
  ------------------
  700|      0|    return nullptr;
  701|      0|  }
  702|    472|  return image;
  703|    472|}
_ZN5Exiv210isWebPTypeERNS_7BasicIoEb:
  705|  24.7k|bool isWebPType(BasicIo& iIo, bool /*advance*/) {
  706|  24.7k|  if (iIo.size() < 12) {
  ------------------
  |  Branch (706:7): [True: 131, False: 24.5k]
  ------------------
  707|    131|    return false;
  708|    131|  }
  709|  24.5k|  const int32_t len = 4;
  710|  24.5k|  constexpr std::array<byte, len> RiffImageId{'R', 'I', 'F', 'F'};
  711|  24.5k|  constexpr std::array<byte, len> WebPImageId{'W', 'E', 'B', 'P'};
  712|  24.5k|  std::array<byte, len> webp;
  713|  24.5k|  std::array<byte, len> data;
  714|  24.5k|  std::array<byte, len> riff;
  715|  24.5k|  iIo.readOrThrow(riff.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  716|  24.5k|  iIo.readOrThrow(data.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  717|  24.5k|  iIo.readOrThrow(webp.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  718|  24.5k|  bool matched_riff = riff == RiffImageId;
  719|  24.5k|  bool matched_webp = webp == WebPImageId;
  720|  24.5k|  iIo.seek(-12, BasicIo::cur);
  721|  24.5k|  return matched_riff && matched_webp;
  ------------------
  |  Branch (721:10): [True: 2.30k, False: 22.2k]
  |  Branch (721:26): [True: 1.41k, False: 884]
  ------------------
  722|  24.7k|}
_ZN5Exiv29WebPImage13equalsWebPTagERKNS_7DataBufEPKc:
  731|  4.55k|bool WebPImage::equalsWebPTag(const Exiv2::DataBuf& buf, const char* str) {
  732|  7.44k|  for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (732:19): [True: 6.92k, False: 523]
  ------------------
  733|  6.92k|    if (toupper(buf.read_uint8(i)) != str[i])
  ------------------
  |  Branch (733:9): [True: 4.03k, False: 2.88k]
  ------------------
  734|  4.03k|      return false;
  735|    523|  return true;
  736|  4.55k|}
_ZN5Exiv29WebPImage15getHeaderOffsetEPKhmS2_m:
  799|  1.23k|size_t WebPImage::getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size) {
  800|  1.23k|  size_t pos = std::string::npos;  // error value
  801|  1.23k|  if (data_size < header_size) {
  ------------------
  |  Branch (801:7): [True: 202, False: 1.02k]
  ------------------
  802|    202|    return pos;
  803|    202|  }
  804|   951k|  for (size_t i = 0; i < data_size - header_size; i++) {
  ------------------
  |  Branch (804:22): [True: 950k, False: 836]
  ------------------
  805|   950k|    if (memcmp(header, &data[i], header_size) == 0) {
  ------------------
  |  Branch (805:9): [True: 192, False: 950k]
  ------------------
  806|    192|      pos = i;
  807|    192|      break;
  808|    192|    }
  809|   950k|  }
  810|  1.02k|  return pos;
  811|  1.23k|}

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  253|   183k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  254|   183k|  if (pValue)
  ------------------
  |  Branch (254:7): [True: 137k, False: 46.2k]
  ------------------
  255|   137k|    value_ = pValue->clone();
  256|   183k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  258|   229k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  259|   229k|  if (rhs.key_)
  ------------------
  |  Branch (259:7): [True: 229k, False: 0]
  ------------------
  260|   229k|    key_ = rhs.key_->clone();  // deep copy
  261|   229k|  if (rhs.value_)
  ------------------
  |  Branch (261:7): [True: 229k, False: 0]
  ------------------
  262|   229k|    value_ = rhs.value_->clone();  // deep copy
  263|   229k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  277|   183k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  278|   183k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  280|   229k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  281|   229k|}
_ZN5Exiv28XmpdatumD2Ev:
  290|   413k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  292|  16.7M|std::string Xmpdatum::key() const {
  293|  16.7M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (293:10): [True: 16.7M, False: 0]
  ------------------
  294|  16.7M|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  320|  1.70k|TypeId Xmpdatum::typeId() const {
  321|  1.70k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 1.70k, False: 0]
  ------------------
  322|  1.70k|}
_ZNK5Exiv28Xmpdatum5countEv:
  332|    380|size_t Xmpdatum::count() const {
  333|    380|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 380, False: 0]
  ------------------
  334|    380|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  340|  2.30k|std::string Xmpdatum::toString() const {
  341|  2.30k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 2.30k, False: 0]
  ------------------
  342|  2.30k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  344|  4.49k|std::string Xmpdatum::toString(size_t n) const {
  345|  4.49k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (345:10): [True: 4.49k, False: 0]
  ------------------
  346|  4.49k|}
_ZNK5Exiv28Xmpdatum7toInt64Em:
  348|    338|int64_t Xmpdatum::toInt64(size_t n) const {
  349|    338|  return p_->value_ ? p_->value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 338, False: 0]
  ------------------
  350|    338|}
_ZNK5Exiv28Xmpdatum5valueEv:
  364|  19.6k|const Value& Xmpdatum::value() const {
  365|  19.6k|  if (!p_->value_)
  ------------------
  |  Branch (365:7): [True: 0, False: 19.6k]
  ------------------
  366|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  367|  19.6k|  return *p_->value_;
  368|  19.6k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  384|   520k|int Xmpdatum::setValue(const std::string& value) {
  385|   520k|  XmpProperties::XmpLock lock;
  386|   520k|  if (!p_->value_) {
  ------------------
  |  Branch (386:7): [True: 46.2k, False: 473k]
  ------------------
  387|  46.2k|    TypeId type = xmpText;
  388|  46.2k|    if (p_->key_) {
  ------------------
  |  Branch (388:9): [True: 46.2k, False: 0]
  ------------------
  389|  46.2k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  390|  46.2k|    }
  391|  46.2k|    p_->value_ = Value::create(type);
  392|  46.2k|  }
  393|   520k|  return p_->value_->read(value);
  394|   520k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  396|   521k|Xmpdatum& XmpData::operator[](const std::string& key) {
  397|   521k|  XmpProperties::XmpLock lock;
  398|   521k|  XmpKey xmpKey(key, lock);
  399|   521k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  400|   521k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (400:7): [True: 46.2k, False: 475k]
  ------------------
  401|  46.2k|    return xmpMetadata_.emplace_back(xmpKey);
  402|  46.2k|  }
  403|   475k|  return *pos;
  404|   521k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  406|  7.67k|int XmpData::add(const XmpKey& key, const Value* value) {
  407|  7.67k|  XmpProperties::XmpLock lock;
  408|  7.67k|  return addUnlocked(key, value, lock);
  409|  7.67k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  411|   137k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  412|   137k|  xmpMetadata_.emplace_back(key, value);
  413|   137k|  return 0;
  414|   137k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  426|  34.6k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  427|  34.6k|  XmpProperties::XmpLock lock;
  428|  34.6k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  429|  34.6k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  431|   244k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  432|   244k|  XmpProperties::XmpLock lock;
  433|   244k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  434|   244k|}
_ZN5Exiv27XmpData5clearEv:
  436|  38.9k|void XmpData::clear() {
  437|  38.9k|  XmpProperties::XmpLock lock;
  438|  38.9k|  clearUnlocked(lock);
  439|  38.9k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  441|  54.2k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  442|  54.2k|  xmpMetadata_.clear();
  443|  54.2k|  nsBindings_.clear();
  444|  54.2k|}
_ZNK5Exiv27XmpData3endEv:
  459|  34.6k|XmpData::const_iterator XmpData::end() const {
  460|  34.6k|  return xmpMetadata_.end();
  461|  34.6k|}
_ZNK5Exiv27XmpData5emptyEv:
  463|  8.37k|bool XmpData::empty() const {
  464|  8.37k|  XmpProperties::XmpLock lock;
  465|  8.37k|  return emptyUnlocked(lock);
  466|  8.37k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  468|  12.5k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  469|  12.5k|  return xmpMetadata_.empty();
  470|  12.5k|}
_ZN5Exiv27XmpData5beginEv:
  481|  1.94k|XmpData::iterator XmpData::begin() {
  482|  1.94k|  return xmpMetadata_.begin();
  483|  1.94k|}
_ZN5Exiv27XmpData3endEv:
  485|   246k|XmpData::iterator XmpData::end() {
  486|   246k|  return xmpMetadata_.end();
  487|   246k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  538|  19.5k|void xmpToolkitEnsureInitialized() {
  539|  19.5k|  static XmpToolkitLifetimeManager instance;
  540|  19.5k|  (void)instance;
  541|  19.5k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS_12DecodeParamsE:
  663|  16.8k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket, const DecodeParams& dp) {
  664|  16.8k|  try {
  665|  16.8k|    xmpData.setPacket(xmpPacket);
  666|  16.8k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (666:9): [True: 1.50k, False: 15.3k]
  ------------------
  667|  1.50k|      xmpData.clear();
  668|  1.50k|      return 0;
  669|  1.50k|    }
  670|       |
  671|       |    // Acquire Giant Lock
  672|  15.3k|    XmpProperties::XmpLock lock;
  673|  15.3k|    try {
  674|  15.3k|      xmpToolkitEnsureInitialized();
  675|  15.3k|    } catch (const Error&) {
  676|      0|#ifndef SUPPRESS_WARNINGS
  677|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  678|      0|#endif
  679|      0|      return 2;
  680|      0|    }
  681|       |
  682|  15.3k|    xmpData.clearUnlocked(lock);
  683|       |
  684|       |    // Make sure the unterminated substring is used
  685|  15.3k|    size_t len = xmpPacket.size();
  686|   189k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (686:12): [True: 188k, False: 60]
  |  Branch (686:23): [True: 173k, False: 15.2k]
  ------------------
  687|   173k|      --len;
  688|       |
  689|  15.3k|    XMLValidator::check(xmpPacket.data(), len, dp);
  690|  15.3k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  691|  15.3k|    SXMPIterator iter(meta);
  692|  15.3k|    std::string schemaNs;
  693|  15.3k|    std::string propPath;
  694|  15.3k|    std::string propValue;
  695|  15.3k|    XMP_OptionBits opt = 0;
  696|   158k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (696:12): [True: 143k, False: 15.3k]
  ------------------
  697|   143k|      printNode(schemaNs, propPath, propValue, opt);
  698|   143k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (698:11): [True: 0, False: 143k]
  ------------------
  699|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  700|      0|      }
  701|   143k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (701:11): [True: 13.4k, False: 129k]
  ------------------
  702|       |        // Register unknown namespaces with Exiv2
  703|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  704|  13.4k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  705|  13.4k|        if (prefix.empty()) {
  ------------------
  |  Branch (705:13): [True: 9.04k, False: 4.41k]
  ------------------
  706|  9.04k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (706:15): [True: 0, False: 9.04k]
  ------------------
  707|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  708|  9.04k|          prefix.pop_back();
  709|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  710|       |          // already globally bound -- a built-in standard prefix, or one a prior
  711|       |          // explicit registerNs() established -- to a different URI.  Letting it
  712|       |          // would poison every later write and lookup in this process (the
  713|       |          // namespace-leak bug).  The packet's own binding is still captured
  714|       |          // per-instance below, so this object round-trips faithfully; we just
  715|       |          // don't pollute the global registry on a read.
  716|  9.04k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (716:15): [True: 26, False: 9.01k]
  ------------------
  717|     26|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  718|  9.04k|        }
  719|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  720|       |        // encode() can resolve each property's URI from the data it came from,
  721|       |        // rather than from the process-global registry which another image may
  722|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  723|  13.4k|        xmpData.nsBindings_[prefix] = schemaNs;
  724|  13.4k|        continue;
  725|  13.4k|      }
  726|   129k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  727|   129k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (727:11): [True: 916, False: 128k]
  ------------------
  728|       |        // Read Lang Alt property
  729|    916|        auto val = std::make_unique<LangAltValue>();
  730|    916|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  731|  14.0k|        while (count-- > 0) {
  ------------------
  |  Branch (731:16): [True: 13.1k, False: 909]
  ------------------
  732|       |          // Get the text
  733|  13.1k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  734|  13.1k|          printNode(schemaNs, propPath, propValue, opt);
  735|  13.1k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (735:15): [True: 0, False: 13.1k]
  |  Branch (735:28): [True: 0, False: 13.1k]
  |  Branch (735:54): [True: 7, False: 13.1k]
  ------------------
  736|      7|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  737|      7|          }
  738|  13.1k|          std::string text = propValue;
  739|       |          // Get the language qualifier
  740|  13.1k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  741|  13.1k|          printNode(schemaNs, propPath, propValue, opt);
  742|  13.1k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (742:15): [True: 0, False: 13.1k]
  |  Branch (742:15): [True: 0, False: 13.1k]
  |  Branch (742:28): [True: 0, False: 13.1k]
  |  Branch (742:54): [True: 0, False: 13.1k]
  ------------------
  743|  13.1k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (743:15): [True: 0, False: 13.1k]
  ------------------
  744|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  745|      0|          }
  746|  13.1k|          val->value_[propValue] = std::move(text);
  747|  13.1k|        }
  748|    909|        xmpData.addUnlocked(*key, val.get(), lock);
  749|    909|        continue;
  750|    916|      }
  751|   128k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (751:11): [True: 3.75k, False: 125k]
  |  Branch (751:35): [True: 3.75k, False: 0]
  |  Branch (751:66): [True: 3.75k, False: 0]
  ------------------
  752|       |        // Check if all elements are simple
  753|  3.75k|        bool simpleArray = true;
  754|  3.75k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  755|  3.75k|        std::string aSchemaNs;
  756|  3.75k|        std::string aPropPath;
  757|  3.75k|        std::string aPropValue;
  758|  3.75k|        XMP_OptionBits aOpt = 0;
  759|  17.2k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (759:16): [True: 14.5k, False: 2.78k]
  ------------------
  760|  14.5k|          if (propPath == aPropPath)
  ------------------
  |  Branch (760:15): [True: 3.75k, False: 10.7k]
  ------------------
  761|  3.75k|            continue;
  762|  10.7k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (762:15): [True: 706, False: 10.0k]
  |  Branch (762:42): [True: 258, False: 9.79k]
  |  Branch (762:73): [True: 0, False: 9.79k]
  ------------------
  763|  10.7k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (763:15): [True: 0, False: 9.79k]
  |  Branch (763:41): [True: 0, False: 9.79k]
  ------------------
  764|    964|            simpleArray = false;
  765|    964|            break;
  766|    964|          }
  767|  10.7k|        }
  768|  3.75k|        if (simpleArray) {
  ------------------
  |  Branch (768:13): [True: 2.78k, False: 964]
  ------------------
  769|       |          // Read the array into an XmpArrayValue
  770|  2.78k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  771|  2.78k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  772|  12.5k|          while (count-- > 0) {
  ------------------
  |  Branch (772:18): [True: 9.74k, False: 2.78k]
  ------------------
  773|  9.74k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  774|  9.74k|            printNode(schemaNs, propPath, propValue, opt);
  775|  9.74k|            val->read(propValue);
  776|  9.74k|          }
  777|  2.78k|          xmpData.addUnlocked(*key, val.get(), lock);
  778|  2.78k|          continue;
  779|  2.78k|        }
  780|  3.75k|      }
  781|       |
  782|   126k|      auto val = std::make_unique<XmpTextValue>();
  783|   126k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (783:11): [True: 21.0k, False: 105k]
  |  Branch (783:36): [True: 964, False: 104k]
  ------------------
  784|       |        // Create a metadatum with only XMP options
  785|  21.9k|        val->setXmpArrayType(xmpArrayType(opt));
  786|  21.9k|        val->setXmpStruct(xmpStruct(opt));
  787|  21.9k|        xmpData.addUnlocked(*key, val.get(), lock);
  788|  21.9k|        continue;
  789|  21.9k|      }
  790|   104k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (790:11): [True: 104k, False: 0]
  |  Branch (790:36): [True: 0, False: 0]
  ------------------
  791|   104k|        val->read(propValue);
  792|   104k|        xmpData.addUnlocked(*key, val.get(), lock);
  793|   104k|        continue;
  794|   104k|      }
  795|       |      // Don't let any node go by unnoticed
  796|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  797|   104k|    }  // iterate through all XMP nodes
  798|       |
  799|  15.3k|    return 0;
  800|  15.3k|  }
  801|  16.8k|#ifndef SUPPRESS_WARNINGS
  802|  16.8k|  catch (const Error& e) {
  803|     69|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (803:9): [True: 0, False: 69]
  ------------------
  804|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  805|      0|    }
  806|     69|    throw;
  807|  6.81k|  } catch (const XMP_Error& e) {
  808|  6.81k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  6.81k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 6.81k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  6.81k|  LogMsg(LogMsg::error).os()
  ------------------
  809|  6.81k|    xmpData.clear();
  810|  6.81k|    return 3;
  811|  6.81k|  }
  812|       |#else
  813|       |  catch (const XMP_Error&) {
  814|       |    xmpData.clear();
  815|       |    return 3;
  816|       |  }
  817|       |#endif  // SUPPRESS_WARNINGS
  818|  16.8k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  832|  4.19k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  833|  4.19k|  try {
  834|       |    // Acquire Giant Lock
  835|  4.19k|    XmpProperties::XmpLock lock;
  836|  4.19k|    try {
  837|  4.19k|      xmpToolkitEnsureInitialized();
  838|  4.19k|    } catch (const Error&) {
  839|      0|#ifndef SUPPRESS_WARNINGS
  840|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  841|      0|#endif
  842|      0|      return 2;
  843|      0|    }
  844|       |
  845|  4.19k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (845:9): [True: 4.19k, False: 0]
  ------------------
  846|  4.19k|      xmpPacket.clear();
  847|  4.19k|      return 0;
  848|  4.19k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  849|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  850|      0|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (850:33): [True: 0, False: 0]
  ------------------
  851|       |#ifdef EXIV2_DEBUG_MESSAGES
  852|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  853|       |#endif
  854|       |      // registerNsImpl is safe since we hold the lock
  855|      0|      registerNsImpl(xmp, uri.prefix_);
  856|      0|    }
  857|       |
  858|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  859|       |    // the toolkit here.  Every URI they contain was already registered while its
  860|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  861|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  862|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  863|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  864|       |    // serialization of struct fields that still carry the file's prefix.
  865|      0|    SXMPMeta meta;
  866|      0|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (866:26): [True: 0, False: 0]
  ------------------
  867|      0|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  868|      0|      XMP_OptionBits options = 0;
  869|       |
  870|      0|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (870:11): [True: 0, False: 0]
  ------------------
  871|       |        // Encode Lang Alt property
  872|      0|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  873|      0|        if (!la)
  ------------------
  |  Branch (873:13): [True: 0, False: 0]
  ------------------
  874|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  875|       |
  876|      0|        int idx = 1;
  877|      0|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (877:40): [True: 0, False: 0]
  ------------------
  878|      0|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (878:15): [True: 0, False: 0]
  ------------------
  879|      0|            printNode(ns, xmp.tagName(), specs, 0);
  880|      0|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  881|      0|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  882|      0|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  883|      0|          }
  884|      0|        }
  885|      0|        continue;
  886|      0|      }
  887|       |
  888|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  889|      0|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  890|      0|      if (!val)
  ------------------
  |  Branch (890:11): [True: 0, False: 0]
  ------------------
  891|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  892|      0|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  893|      0|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (893:11): [True: 0, False: 0]
  |  Branch (893:37): [True: 0, False: 0]
  |  Branch (893:63): [True: 0, False: 0]
  ------------------
  894|      0|        printNode(ns, xmp.tagName(), "", options);
  895|      0|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  896|      0|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (896:30): [True: 0, False: 0]
  ------------------
  897|      0|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  898|      0|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  899|      0|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  900|      0|        }
  901|      0|        continue;
  902|      0|      }
  903|      0|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  ------------------
  904|      0|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  905|      0|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (905:13): [True: 0, False: 0]
  |  Branch (905:33): [True: 0, False: 0]
  |  Branch (905:72): [True: 0, False: 0]
  ------------------
  906|      0|          printNode(ns, xmp.tagName(), "", options);
  907|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  908|      0|        } else {
  909|      0|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  910|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  911|      0|        }
  912|      0|        continue;
  913|      0|      }
  914|       |      // Don't let any Xmpdatum go by unnoticed
  915|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  916|      0|    }
  917|      0|    std::string tmpPacket;
  918|      0|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  919|      0|                           padding);  // throws
  920|      0|    xmpPacket = std::move(tmpPacket);
  921|       |
  922|      0|    return 0;
  923|      0|  }
  924|  4.19k|#ifndef SUPPRESS_WARNINGS
  925|  4.19k|  catch (const Error& /* e */) {
  926|      0|    throw;
  927|      0|  } catch (const XMP_Error& e) {
  928|      0|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  929|      0|    return 3;
  930|      0|  }
  931|       |#else
  932|       |  catch (const XMP_Error&) {
  933|       |    return 3;
  934|       |  }
  935|       |#endif  // SUPPRESS_WARNINGS
  936|  4.19k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1098|   129k|                                                      const XmpProperties::XmpLock& lock) {
 1099|   129k|  std::string property;
 1100|   129k|  std::string::size_type idx = propPath.find(':');
 1101|   129k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1101:7): [True: 0, False: 129k]
  ------------------
 1102|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1103|      0|  }
 1104|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1105|   129k|  property = propPath.substr(idx + 1);
 1106|   129k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1107|   129k|  if (prefix.empty()) {
  ------------------
  |  Branch (1107:7): [True: 31.2k, False: 98.4k]
  ------------------
 1108|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1109|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1110|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1111|       |    // the property still gets a key; its URI is preserved per-instance.
 1112|  31.2k|    std::string toolkitPrefix;
 1113|  31.2k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1113:9): [True: 31.2k, False: 0]
  ------------------
 1114|  31.2k|      toolkitPrefix.pop_back();
 1115|  31.2k|      prefix = std::move(toolkitPrefix);
 1116|  31.2k|    }
 1117|  31.2k|  }
 1118|   129k|  if (prefix.empty()) {
  ------------------
  |  Branch (1118:7): [True: 0, False: 129k]
  ------------------
 1119|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1120|      0|  }
 1121|   129k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1122|   129k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  203|  16.6M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  204|  16.6M|    return key_ == xmpdatum.key();
  205|  16.6M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  197|   800k|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  198|   800k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcmRKN5Exiv212DecodeParamsE:
   67|  15.3k|  static void check(const char* buf, size_t buflen, const DecodeParams& dp) {
   68|  15.3k|    XMLValidator validator(dp.max_recursion_depth());
   69|  15.3k|    validator.check_internal(buf, buflen);
   70|  15.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Em:
   79|  15.3k|      max_recursion_depth_(max_recursion_depth), parser_(XML_ParserCreateNS(nullptr, '@')) {
   80|  15.3k|    if (!parser_) {
  ------------------
  |  Branch (80:9): [True: 0, False: 15.3k]
  ------------------
   81|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   82|      0|    }
   83|  15.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  104|  15.3k|  void check_internal(const char* buf, size_t buflen) {
  105|  15.3k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (105:9): [True: 0, False: 15.3k]
  ------------------
  106|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  107|      0|    }
  108|       |
  109|  15.3k|    XML_SetUserData(parser_, this);
  110|  15.3k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  111|  15.3k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  112|  15.3k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  113|       |
  114|  15.3k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (114:9): [True: 4.02k, False: 11.2k]
  ------------------
  115|  4.02k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  116|  4.02k|    }
  117|       |
  118|  15.3k|    if (haserror_) {
  ------------------
  |  Branch (118:9): [True: 4.02k, False: 11.2k]
  ------------------
  119|  4.02k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  120|  4.02k|    }
  121|  15.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  160|   135k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  161|   135k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  162|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  123|   135k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  124|   135k|    if (element_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (124:9): [True: 246, False: 134k]
  ------------------
  125|    246|      setError("Too deeply nested");
  126|    246|    }
  127|   135k|    ++element_depth_;
  128|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  166|   124k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  167|   124k|    static_cast<XMLValidator*>(userData)->endElement(name);
  168|   124k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  130|   124k|  void endElement(const XML_Char*) noexcept {
  131|   124k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (131:9): [True: 124k, False: 0]
  ------------------
  132|   124k|      --element_depth_;
  133|   124k|    } else {
  134|      0|      setError("Negative depth");
  135|      0|    }
  136|   124k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  172|  48.9k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  173|  48.9k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  174|  48.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  138|  48.9k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  139|  48.9k|    if (namespace_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (139:9): [True: 729, False: 48.1k]
  ------------------
  140|    729|      setError("Too deeply nested");
  141|    729|    }
  142|  48.9k|    ++namespace_depth_;
  143|  48.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  178|  39.0k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  179|  39.0k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  180|  39.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  145|  39.0k|  void endNamespace(const XML_Char*) noexcept {
  146|  39.0k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (146:9): [True: 39.0k, False: 0]
  ------------------
  147|  39.0k|      --namespace_depth_;
  148|  39.0k|    } else {
  149|      0|      setError("Negative depth");
  150|      0|    }
  151|  39.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   89|  4.99k|  void setError(const char* msg) {
   90|  4.99k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   91|  4.99k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   92|  4.99k|#ifndef SUPPRESS_WARNINGS
   93|  4.99k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  4.99k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.99k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.99k|  LogMsg(LogMsg::info).os()
  ------------------
   94|  4.99k|#endif
   95|       |    // If this is the first error, then save it.
   96|  4.99k|    if (!haserror_) {
  ------------------
  |  Branch (96:9): [True: 4.02k, False: 975]
  ------------------
   97|  4.02k|      haserror_ = true;
   98|  4.02k|      errmsg_ = msg;
   99|  4.02k|      errlinenum_ = errlinenum;
  100|  4.02k|      errcolnum_ = errcolnum;
  101|  4.02k|    }
  102|  4.99k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   85|  15.3k|  ~XMLValidator() {
   86|  15.3k|    XML_ParserFree(parser_);
   87|  15.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  955|  21.9k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  956|  21.9k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  957|  21.9k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (957:7): [True: 21.0k, False: 964]
  ------------------
  958|  21.0k|    var = Exiv2::XmpValue::xsStruct;
  959|  21.0k|  }
  960|  21.9k|  return var;
  961|  21.9k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  975|  24.7k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  976|  24.7k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  977|  24.7k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (977:7): [True: 3.75k, False: 21.0k]
  ------------------
  978|  3.75k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (978:9): [True: 967, False: 2.78k]
  ------------------
  979|    967|      typeId = Exiv2::xmpAlt;
  980|  2.78k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (980:14): [True: 2.16k, False: 620]
  ------------------
  981|  2.16k|      typeId = Exiv2::xmpSeq;
  982|    620|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (982:14): [True: 620, False: 0]
  ------------------
  983|    620|      typeId = Exiv2::xmpBag;
  984|  3.75k|  }
  985|  24.7k|  return typeId;
  986|  24.7k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  988|  21.9k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  989|  21.9k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  990|  21.9k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1091|   179k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1092|   179k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  246|   413k|  ~Impl() = default;

_ZN5Exiv225XmpToolkitLifetimeManagerC2Ev:
   33|      1|  XmpToolkitLifetimeManager() {
   34|      1|    if (SXMPMeta::Initialize()) {
  ------------------
  |  Branch (34:9): [True: 1, False: 0]
  ------------------
   35|       |#ifdef EXV_ADOBE_XMPSDK
   36|       |      SXMPMeta::RegisterNamespace("http://ns.adobe.com/lightroom/1.0/", "lr", nullptr);
   37|       |      SXMPMeta::RegisterNamespace("http://rs.tdwg.org/dwc/index.htm", "dwc", nullptr);
   38|       |      SXMPMeta::RegisterNamespace("http://purl.org/dc/terms/", "dcterms", nullptr);
   39|       |      SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/1.0/", "digiKam", nullptr);
   40|       |      SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/kipi/1.0/", "kipi", nullptr);
   41|       |      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.0/", "MicrosoftPhoto", nullptr);
   42|       |      SXMPMeta::RegisterNamespace("http://ns.acdsee.com/iptc/1.0/", "acdsee", nullptr);
   43|       |      SXMPMeta::RegisterNamespace("http://iptc.org/std/Iptc4xmpExt/2008-02-29/", "iptcExt", nullptr);
   44|       |      SXMPMeta::RegisterNamespace("http://ns.useplus.org/ldf/xmp/1.0/", "plus", nullptr);
   45|       |      SXMPMeta::RegisterNamespace("http://ns.iview-multimedia.com/mediapro/1.0/", "mediapro", nullptr);
   46|       |      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/expressionmedia/1.0/", "expressionmedia", nullptr);
   47|       |      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/", "MP", nullptr);
   48|       |      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/RegionInfo#", "MPRI", nullptr);
   49|       |      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/Region#", "MPReg", nullptr);
   50|       |      SXMPMeta::RegisterNamespace("http://ns.google.com/photos/1.0/panorama/", "GPano", nullptr);
   51|       |      SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/regions/", "mwg-rs", nullptr);
   52|       |      SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/keywords/", "mwg-kw", nullptr);
   53|       |      SXMPMeta::RegisterNamespace("http://ns.adobe.com/xmp/sType/Area#", "stArea", nullptr);
   54|       |      SXMPMeta::RegisterNamespace("http://cipa.jp/exif/1.0/", "exifEX", nullptr);
   55|       |      SXMPMeta::RegisterNamespace("http://ns.adobe.com/camera-raw-saved-settings/1.0/", "crss", nullptr);
   56|       |      SXMPMeta::RegisterNamespace("http://www.audio/", "audio", nullptr);
   57|       |      SXMPMeta::RegisterNamespace("http://www.video/", "video", nullptr);
   58|       |#else
   59|      1|      SXMPMeta::RegisterNamespace("http://ns.adobe.com/lightroom/1.0/", "lr");
   60|      1|      SXMPMeta::RegisterNamespace("http://rs.tdwg.org/dwc/index.htm", "dwc");
   61|      1|      SXMPMeta::RegisterNamespace("http://purl.org/dc/terms/", "dcterms");
   62|      1|      SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/1.0/", "digiKam");
   63|      1|      SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/kipi/1.0/", "kipi");
   64|      1|      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.0/", "MicrosoftPhoto");
   65|      1|      SXMPMeta::RegisterNamespace("http://ns.acdsee.com/iptc/1.0/", "acdsee");
   66|      1|      SXMPMeta::RegisterNamespace("http://iptc.org/std/Iptc4xmpExt/2008-02-29/", "iptcExt");
   67|      1|      SXMPMeta::RegisterNamespace("http://ns.useplus.org/ldf/xmp/1.0/", "plus");
   68|      1|      SXMPMeta::RegisterNamespace("http://ns.iview-multimedia.com/mediapro/1.0/", "mediapro");
   69|      1|      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/expressionmedia/1.0/", "expressionmedia");
   70|      1|      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/", "MP");
   71|      1|      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/RegionInfo#", "MPRI");
   72|      1|      SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/Region#", "MPReg");
   73|      1|      SXMPMeta::RegisterNamespace("http://ns.google.com/photos/1.0/panorama/", "GPano");
   74|      1|      SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/regions/", "mwg-rs");
   75|      1|      SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/keywords/", "mwg-kw");
   76|      1|      SXMPMeta::RegisterNamespace("http://ns.adobe.com/xmp/sType/Area#", "stArea");
   77|      1|      SXMPMeta::RegisterNamespace("http://cipa.jp/exif/1.0/", "exifEX");
   78|      1|      SXMPMeta::RegisterNamespace("http://ns.adobe.com/camera-raw-saved-settings/1.0/", "crss");
   79|      1|      SXMPMeta::RegisterNamespace("http://www.audio/", "audio");
   80|      1|      SXMPMeta::RegisterNamespace("http://www.video/", "video");
   81|      1|#endif
   82|      1|    } else {
   83|      0|      throw Error(ErrorCode::kerXMPToolkitError, 2, "Failed to initialize XMP Toolkit");
   84|      0|    }
   85|      1|  }
_ZN5Exiv225XmpToolkitLifetimeManagerD2Ev:
   87|      1|  ~XmpToolkitLifetimeManager() {
   88|       |    // Use Unsafe version to avoid acquiring mutex during static destruction.
   89|       |    // This is safe because static destruction is single-threaded per C++ standard.
   90|      1|    XmpProperties::unregisterAllNsNoLock(XmpProperties::LifetimeKey{});
   91|      1|    SXMPMeta::Terminate();
   92|      1|  }

_ZN5Exiv210XmpSidecarC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   30|  1.99k|    Image(ImageType::xmp, mdXmp, std::move(io), params) {
   31|  1.99k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (31:7): [True: 0, False: 1.99k]
  |  Branch (31:26): [True: 0, False: 0]
  ------------------
   32|      0|    IoCloser closer(*io_);
   33|      0|    io_->write(reinterpret_cast<const byte*>(xmlHeader), xmlHdrCnt);
   34|      0|  }
   35|  1.99k|}  // XmpSidecar::XmpSidecar
_ZNK5Exiv210XmpSidecar8mimeTypeEv:
   37|  5.31k|std::string XmpSidecar::mimeType() const {
   38|  5.31k|  return "application/rdf+xml";
   39|  5.31k|}
_ZN5Exiv210XmpSidecar12readMetadataEv:
   46|  1.99k|void XmpSidecar::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   49|       |#endif
   50|  1.99k|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 1.99k]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|  1.99k|  IoCloser closer(*io_);
   54|       |  // Ensure that this is the correct image type
   55|  1.99k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1.99k]
  ------------------
   56|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  |  Branch (56:25): [True: 0, False: 0]
  ------------------
   57|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   58|      0|    throw Error(ErrorCode::kerNotAnImage, "XMP");
   59|      0|  }
   60|       |  // Read the XMP packet from the IO stream
   61|  1.99k|  std::string xmpPacket;
   62|  1.99k|  const long len = 64 * 1024;
   63|  1.99k|  auto buf = std::make_unique<byte[]>(len);
   64|  4.76k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (64:15): [True: 2.76k, False: 1.99k]
  ------------------
   65|  2.76k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   66|  2.76k|  }
   67|  1.99k|  if (io_->error())
  ------------------
  |  Branch (67:7): [True: 0, False: 1.99k]
  ------------------
   68|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   69|  1.99k|  clearMetadata();
   70|  1.99k|  xmpPacket_ = std::move(xmpPacket);
   71|  1.99k|  const DecodeParams dp(max_recursion_depth_);
   72|  1.99k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (72:7): [True: 1.99k, False: 1]
  |  Branch (72:30): [True: 412, False: 1.58k]
  ------------------
   73|    412|#ifndef SUPPRESS_WARNINGS
   74|    412|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    412|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 412]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    412|  LogMsg(LogMsg::warn).os()
  ------------------
   75|    412|#endif
   76|    412|  }
   77|       |
   78|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   79|  94.8k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (79:24): [True: 94.8k, False: 1.99k]
  ------------------
   80|  94.8k|    std::string key(xmp.key());
   81|  94.8k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (81:9): [True: 14.1k, False: 80.7k]
  ------------------
   82|  14.1k|      dates_[key] = xmp.value().toString();
   83|  14.1k|    }
   84|  94.8k|  }
   85|       |
   86|  1.99k|  copyXmpToIptc(xmpData_, iptcData_);
   87|  1.99k|  copyXmpToExif(xmpData_, exifData_);
   88|  1.99k|}  // XmpSidecar::readMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  154|  1.99k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  155|  1.99k|  auto image = std::make_unique<XmpSidecar>(std::move(io), params);
  156|  1.99k|  if (!image->good()) {
  ------------------
  |  Branch (156:7): [True: 0, False: 1.99k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  1.99k|  return image;
  160|  1.99k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  162|  21.6k|bool isXmpType(BasicIo& iIo, bool advance) {
  163|       |  /*
  164|       |    Check if the file starts with an optional XML declaration followed by
  165|       |    either an XMP header (<?xpacket ... ?>) or an <x:xmpmeta> element.
  166|       |
  167|       |    In addition, in order for empty XmpSidecar objects as created by
  168|       |    Exiv2 to pass the test, just an XML header is also considered ok.
  169|       |   */
  170|  21.6k|  const int32_t len = 80;
  171|  21.6k|  byte buf[len];
  172|  21.6k|  iIo.read(buf, xmlHdrCnt + 1);
  173|  21.6k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (173:7): [True: 303, False: 21.3k]
  |  Branch (173:20): [True: 3, False: 300]
  ------------------
  174|      3|    return true;
  175|      3|  }
  176|  21.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (176:7): [True: 0, False: 21.6k]
  |  Branch (176:22): [True: 300, False: 21.3k]
  ------------------
  177|    300|    return false;
  178|    300|  }
  179|  21.3k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  180|  21.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (180:7): [True: 0, False: 21.3k]
  |  Branch (180:22): [True: 24, False: 21.2k]
  ------------------
  181|     24|    return false;
  182|     24|  }
  183|       |  // Skip leading BOM
  184|  21.2k|  int32_t start = 0;
  185|  21.2k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (185:7): [True: 95, False: 21.1k]
  ------------------
  186|     95|    start = 3;
  187|     95|  }
  188|  21.2k|  bool rc = false;
  189|  21.2k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  190|  21.2k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (190:7): [True: 51, False: 21.2k]
  ------------------
  191|       |    // Forward to the next tag
  192|     51|    auto it = std::find(head.begin() + 5, head.end(), '<');
  193|     51|    if (it != head.end())
  ------------------
  |  Branch (193:9): [True: 41, False: 10]
  ------------------
  194|     41|      head = head.substr(std::distance(head.begin(), it));
  195|     51|  }
  196|  21.2k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (196:7): [True: 3.05k, False: 18.2k]
  |  Branch (196:40): [True: 2.93k, False: 15.2k]
  ------------------
  197|  5.98k|    rc = true;
  198|  5.98k|  }
  199|  21.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (199:7): [True: 21.2k, False: 0]
  |  Branch (199:19): [True: 0, False: 0]
  ------------------
  200|  21.2k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  201|  21.2k|  }
  202|  21.2k|  return rc;
  203|  21.3k|}

XMP_NewExpatAdapter:
   68|  11.2k|{
   69|  11.2k|	return new ExpatAdapter;
   70|  11.2k|}	// XMP_NewExpatAdapter
_ZN12ExpatAdapterC2Ev:
   74|  11.2k|ExpatAdapter::ExpatAdapter() : parser(0)
   75|  11.2k|{
   76|       |
   77|       |	#if XMP_DebugBuild
   78|       |		this->elemNesting = 0;
   79|       |		#if DumpXMLParseEvents
   80|       |			if ( this->parseLog == 0 ) this->parseLog = stdout;
   81|       |		#endif
   82|       |	#endif
   83|       |
   84|  11.2k|	this->parser = XML_ParserCreateNS ( 0, FullNameSeparator );
  ------------------
  |  |   33|  11.2k|#define FullNameSeparator	'@'
  ------------------
   85|  11.2k|	if ( this->parser == 0 ) XMP_Throw ( "Failure creating Expat parser", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (85:7): [True: 0, False: 11.2k]
  ------------------
   86|       |	
   87|  11.2k|	XML_SetUserData ( this->parser, this );
   88|       |	
   89|  11.2k|	XML_SetNamespaceDeclHandler ( this->parser, StartNamespaceDeclHandler, EndNamespaceDeclHandler );
   90|  11.2k|	XML_SetElementHandler ( this->parser, StartElementHandler, EndElementHandler );
   91|       |
   92|  11.2k|	XML_SetCharacterDataHandler ( this->parser, CharacterDataHandler );
   93|  11.2k|	XML_SetCdataSectionHandler ( this->parser, StartCdataSectionHandler, EndCdataSectionHandler );
   94|       |
   95|  11.2k|	XML_SetProcessingInstructionHandler ( this->parser, ProcessingInstructionHandler );
   96|  11.2k|	XML_SetCommentHandler ( this->parser, CommentHandler );
   97|       |
   98|  11.2k|	#if BanAllEntityUsage
   99|  11.2k|		XML_SetStartDoctypeDeclHandler ( this->parser, StartDoctypeDeclHandler );
  100|  11.2k|		isAborted = false;
  101|  11.2k|	#endif
  102|       |
  103|  11.2k|	this->parseStack.push_back ( &this->tree );	// Push the XML root node.
  104|       |
  105|  11.2k|}	// ExpatAdapter::ExpatAdapter
_ZN12ExpatAdapterD2Ev:
  110|  11.2k|{
  111|       |
  112|  11.2k|	if ( this->parser != 0 ) XML_ParserFree ( this->parser );
  ------------------
  |  Branch (112:7): [True: 11.2k, False: 0]
  ------------------
  113|  11.2k|	this->parser = 0;
  114|       |
  115|  11.2k|}	// ExpatAdapter::~ExpatAdapter
_ZN12ExpatAdapter11ParseBufferEPKvmb:
  126|  11.3k|{
  127|  11.3k|	enum XML_Status status;
  128|       |	
  129|  11.3k|	if ( length == 0 ) {	// Expat does not like empty buffers.
  ------------------
  |  Branch (129:7): [True: 0, False: 11.3k]
  ------------------
  130|      0|		if ( ! last ) return;
  ------------------
  |  Branch (130:8): [True: 0, False: 0]
  ------------------
  131|      0|		buffer = kOneSpace;
  132|      0|		length = 1;
  133|      0|	}
  134|       |	
  135|  11.3k|	status = XML_Parse ( this->parser, (const char *)buffer, length, last );
  136|       |	
  137|  11.3k|	#if BanAllEntityUsage
  138|  11.3k|		if ( this->isAborted ) XMP_Throw ( "DOCTYPE is not allowed", kXMPErr_BadXML );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (138:8): [True: 0, False: 11.3k]
  ------------------
  139|  11.3k|	#endif
  140|       |
  141|  11.3k|	if ( status != XML_STATUS_OK ) {
  ------------------
  |  Branch (141:7): [True: 36, False: 11.2k]
  ------------------
  142|       |	
  143|     36|		XMP_StringPtr errMsg = "XML parsing failure";
  144|       |
  145|       |		#if 0	// XMP_DebugBuild	// Disable for now to make test output uniform. Restore later with thread safety.
  146|       |		
  147|       |			// *** This is a good candidate for a callback error notification mechanism.
  148|       |			// *** This code is not thread safe, the sExpatMessage isn't locked. But that's OK for debug usage.
  149|       |
  150|       |			enum XML_Error expatErr = XML_GetErrorCode ( this->parser );
  151|       |			const char *   expatMsg = XML_ErrorString ( expatErr );
  152|       |			int errLine = XML_GetCurrentLineNumber ( this->parser );
  153|       |		
  154|       |			char msgBuffer[1000];
  155|       |			// AUDIT: Use of sizeof(msgBuffer) for snprintf length is safe.
  156|       |			snprintf ( msgBuffer, sizeof(msgBuffer), "# Expat error %d at line %d, \"%s\"", expatErr, errLine, expatMsg );
  157|       |			sExpatMessage = msgBuffer;
  158|       |			errMsg = sExpatMessage.c_str();
  159|       |
  160|       |			#if  DumpXMLParseEvents
  161|       |				if ( this->parseLog != 0 ) fprintf ( this->parseLog, "%s\n", errMsg, expatErr, errLine, expatMsg );
  162|       |			#endif
  163|       |
  164|       |		#endif
  165|       |
  166|     36|		XMP_Throw ( errMsg, kXMPErr_BadXML );
  ------------------
  |  |  199|     36|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  167|       |
  168|      0|	}
  169|       |	
  170|  11.3k|}	// ExpatAdapter::ParseBuffer
ExpatAdapter.cpp:_ZL25StartNamespaceDeclHandlerPvPKcS1_:
  242|  38.8k|{
  243|  38.8k|	IgnoreParam(userData);
  ------------------
  |  |  117|  38.8k|#define IgnoreParam(p)	(void)p
  ------------------
  244|       |	
  245|       |	// As a bug fix hack, change a URI of "http://purl.org/dc/1.1/" to ""http://purl.org/dc/elements/1.1/.
  246|       |	// Early versions of Flash that put XMP in SWF used a bad URI for the dc: namespace.
  247|       |	
  248|       |	#if XMP_DebugBuild & DumpXMLParseEvents		// Avoid unused variable warning.
  249|       |		ExpatAdapter * thiz = (ExpatAdapter*)userData;
  250|       |	#endif
  251|       |
  252|  38.8k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (252:7): [True: 43, False: 38.7k]
  ------------------
  253|  38.8k|	if ( uri == 0 ) return;	// Ignore, have xmlns:pre="", no URI to register.
  ------------------
  |  Branch (253:7): [True: 36, False: 38.7k]
  ------------------
  254|       |	
  255|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  256|       |		if ( thiz->parseLog != 0 ) {
  257|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  258|       |			fprintf ( thiz->parseLog, "StartNamespace: %s - \"%s\"\n", prefix, uri );
  259|       |		}
  260|       |	#endif
  261|       |	
  262|  38.7k|	if ( XMP_LitMatch ( uri, "http://purl.org/dc/1.1/" ) ) uri = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  |   96|  38.7k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  |  |  ------------------
  |  |  |  Branch (96:28): [True: 1.45k, False: 37.3k]
  |  |  ------------------
  ------------------
  263|  38.7k|	XMPMeta::RegisterNamespace ( uri, prefix );
  264|       |
  265|  38.7k|}	// StartNamespaceDeclHandler
ExpatAdapter.cpp:_ZL23EndNamespaceDeclHandlerPvPKc:
  270|  38.8k|{
  271|  38.8k|	IgnoreParam(userData);
  ------------------
  |  |  117|  38.8k|#define IgnoreParam(p)	(void)p
  ------------------
  272|       |
  273|       |	#if XMP_DebugBuild & DumpXMLParseEvents		// Avoid unused variable warning.
  274|       |		ExpatAdapter * thiz = (ExpatAdapter*)userData;
  275|       |	#endif
  276|       |
  277|  38.8k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (277:7): [True: 43, False: 38.7k]
  ------------------
  278|       |	
  279|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  280|       |		if ( thiz->parseLog != 0 ) {
  281|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  282|       |			fprintf ( thiz->parseLog, "EndNamespace: %s\n", prefix );
  283|       |		}
  284|       |	#endif
  285|       |	
  286|       |	// ! Nothing to do, Expat has done all of the XML processing.
  287|       |
  288|  38.8k|}	// EndNamespaceDeclHandler
ExpatAdapter.cpp:_ZL19StartElementHandlerPvPKcPS1_:
  293|   122k|{
  294|   122k|	XMP_Assert ( attrs != 0 );
  ------------------
  |  |  142|   122k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  295|   122k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  296|       |	
  297|   122k|	size_t attrCount = 0;
  298|   398k|	for ( XMP_StringPtr* a = attrs; *a != 0; ++a ) ++attrCount;
  ------------------
  |  Branch (298:34): [True: 275k, False: 122k]
  ------------------
  299|   122k|	if ( (attrCount & 1) != 0 )	XMP_Throw ( "Expat attribute info has odd length", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (299:7): [True: 0, False: 122k]
  ------------------
  300|   122k|	attrCount = attrCount/2;	// They are name/value pairs.
  301|       |	
  302|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  303|       |		if ( thiz->parseLog != 0 ) {
  304|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  305|       |			fprintf ( thiz->parseLog, "StartElement: %s, %d attrs", name, attrCount );
  306|       |			for ( XMP_StringPtr* attr = attrs; *attr != 0; attr += 2 ) {
  307|       |				XMP_StringPtr attrName = *attr;
  308|       |				XMP_StringPtr attrValue = *(attr+1);
  309|       |				fprintf ( thiz->parseLog, ", %s = \"%s\"", attrName, attrValue );
  310|       |			}
  311|       |			fprintf ( thiz->parseLog, "\n" );
  312|       |		}
  313|       |	#endif
  314|       |
  315|   122k|	XML_Node * parentNode = thiz->parseStack.back();
  316|   122k|	XML_Node * elemNode   = new XML_Node ( parentNode, "", kElemNode );
  317|       |	
  318|   122k|	SetQualName ( name, elemNode );
  319|       |	
  320|   260k|	for ( XMP_StringPtr* attr = attrs; *attr != 0; attr += 2 ) {
  ------------------
  |  Branch (320:37): [True: 137k, False: 122k]
  ------------------
  321|       |
  322|   137k|		XMP_StringPtr attrName = *attr;
  323|   137k|		XMP_StringPtr attrValue = *(attr+1);
  324|   137k|		XML_Node * attrNode = new XML_Node ( elemNode, "", kAttrNode );
  325|       |
  326|   137k|		SetQualName ( attrName, attrNode );
  327|   137k|		attrNode->value = attrValue;
  328|   137k|		if ( attrNode->name == "xml:lang" ) NormalizeLangValue ( &attrNode->value );
  ------------------
  |  Branch (328:8): [True: 41.5k, False: 96.1k]
  ------------------
  329|   137k|		elemNode->attrs.push_back ( attrNode );
  330|       |
  331|   137k|	}
  332|       |	
  333|   122k|	parentNode->content.push_back ( elemNode );
  334|   122k|	thiz->parseStack.push_back ( elemNode );
  335|       |	
  336|   122k|	if ( elemNode->name == "rdf:RDF" ) {
  ------------------
  |  Branch (336:7): [True: 10.9k, False: 111k]
  ------------------
  337|  10.9k|		thiz->rootNode = elemNode;
  338|  10.9k|		++thiz->rootCount;
  339|  10.9k|	}
  340|       |	#if XMP_DebugBuild
  341|       |		++thiz->elemNesting;
  342|       |	#endif
  343|       |
  344|   122k|}	// StartElementHandler
ExpatAdapter.cpp:_ZL11SetQualNamePKcP8XML_Node:
  187|   260k|{
  188|       |	// Expat delivers the full name as a catenation of namespace URI, separator, and local name.
  189|       |
  190|       |	// As a compatibility hack, an "about" or "ID" attribute of an rdf:Description element is
  191|       |	// changed to "rdf:about" or rdf:ID. Easier done here than in the RDF recognizer.
  192|       |	
  193|       |	// As a bug fix hack, change a URI of "http://purl.org/dc/1.1/" to ""http://purl.org/dc/elements/1.1/.
  194|       |	// Early versions of Flash that put XMP in SWF used a bad URI for the dc: namespace.
  195|       |
  196|       |	// ! This code presumes the RDF namespace prefix is "rdf".
  197|       |
  198|   260k|	size_t sepPos = strlen(fullName);
  199|  8.99M|	for ( --sepPos; sepPos > 0; --sepPos ) {
  ------------------
  |  Branch (199:18): [True: 8.99M, False: 6.55k]
  ------------------
  200|  8.99M|		if ( fullName[sepPos] == FullNameSeparator ) break;
  ------------------
  |  |   33|  8.99M|#define FullNameSeparator	'@'
  ------------------
  |  Branch (200:8): [True: 253k, False: 8.73M]
  ------------------
  201|  8.99M|	}
  202|       |
  203|   260k|	if ( fullName[sepPos] == FullNameSeparator ) {
  ------------------
  |  |   33|   260k|#define FullNameSeparator	'@'
  ------------------
  |  Branch (203:7): [True: 253k, False: 6.55k]
  ------------------
  204|       |
  205|   253k|		XMP_StringPtr prefix;
  206|   253k|		XMP_StringLen prefixLen;
  207|   253k|		XMP_StringPtr localPart = fullName + sepPos + 1;
  208|       |
  209|   253k|		node->ns.assign ( fullName, sepPos );
  210|   253k|		if ( node->ns == "http://purl.org/dc/1.1/" ) node->ns = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  Branch (210:8): [True: 3.63k, False: 250k]
  ------------------
  211|       |
  212|   253k|		bool found = XMPMeta::GetNamespacePrefix ( node->ns.c_str(), &prefix, &prefixLen );
  213|   253k|		if ( ! found ) XMP_Throw ( "Unknown URI in Expat full name", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (213:8): [True: 0, False: 253k]
  ------------------
  214|   253k|		node->nsPrefixLen = prefixLen;	// ! Includes the ':'.
  215|       |		
  216|   253k|		node->name = prefix;
  217|   253k|		node->name += localPart;
  218|       |
  219|   253k|	} else {
  220|       |
  221|  6.55k|		node->name = fullName;	// The name is not in a namespace.
  222|       |	
  223|  6.55k|		if ( node->parent->name == "rdf:Description" ) {
  ------------------
  |  Branch (223:8): [True: 1.79k, False: 4.75k]
  ------------------
  224|  1.79k|			if ( node->name == "about" ) {
  ------------------
  |  Branch (224:9): [True: 762, False: 1.03k]
  ------------------
  225|    762|				node->ns   = kXMP_NS_RDF;
  226|    762|				node->name = "rdf:about";
  227|    762|				node->nsPrefixLen = 4;	// ! Include the ':'.
  228|  1.03k|			} else if ( node->name == "ID" ) {
  ------------------
  |  Branch (228:16): [True: 93, False: 938]
  ------------------
  229|     93|				node->ns   = kXMP_NS_RDF;
  230|     93|				node->name = "rdf:ID";
  231|     93|				node->nsPrefixLen = 4;	// ! Include the ':'.
  232|     93|			}
  233|  1.79k|		}
  234|       |		
  235|  6.55k|	}
  236|       |
  237|   260k|}	// SetQualName
ExpatAdapter.cpp:_ZL17EndElementHandlerPvPKc:
  349|   122k|{
  350|   122k|	IgnoreParam(name);
  ------------------
  |  |  117|   122k|#define IgnoreParam(p)	(void)p
  ------------------
  351|       |	
  352|   122k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  353|       |
  354|       |	#if XMP_DebugBuild
  355|       |		--thiz->elemNesting;
  356|       |	#endif
  357|   122k|	(void) thiz->parseStack.pop_back();
  358|       |	
  359|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  360|       |		if ( thiz->parseLog != 0 ) {
  361|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  362|       |			fprintf ( thiz->parseLog, "EndElement: %s\n", name );
  363|       |		}
  364|       |	#endif
  365|       |
  366|   122k|}	// EndElementHandler
ExpatAdapter.cpp:_ZL20CharacterDataHandlerPvPKci:
  371|   318k|{
  372|   318k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  373|       |	
  374|   318k|	if ( (cData == 0) || (len == 0) ) { cData = ""; len = 0; }
  ------------------
  |  Branch (374:7): [True: 0, False: 318k]
  |  Branch (374:23): [True: 0, False: 318k]
  ------------------
  375|       |	
  376|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  377|       |		if ( thiz->parseLog != 0 ) {
  378|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  379|       |			fprintf ( thiz->parseLog, "CharContent: \"" );
  380|       |			for ( int i = 0; i < len; ++i ) fprintf ( thiz->parseLog, "%c", cData[i] );
  381|       |			fprintf ( thiz->parseLog, "\"\n" );
  382|       |		}
  383|       |	#endif
  384|       |	
  385|   318k|	XML_Node * parentNode = thiz->parseStack.back();
  386|   318k|	XML_Node * cDataNode  = new XML_Node ( parentNode, "", kCDataNode );
  387|       |	
  388|   318k|	cDataNode->value.assign ( cData, len );
  389|   318k|	parentNode->content.push_back ( cDataNode );
  390|       |	
  391|   318k|}	// CharacterDataHandler
ExpatAdapter.cpp:_ZL28ProcessingInstructionHandlerPvPKcS1_:
  436|  6.59k|{
  437|  6.59k|	XMP_Assert ( target != 0 );
  ------------------
  |  |  142|  6.59k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  438|  6.59k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  439|       |
  440|  6.59k|	if ( ! XMP_LitMatch ( target, "xpacket" ) ) return;	// Ignore all PIs except the XMP packet wrapper.
  ------------------
  |  |   96|  6.59k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  |  Branch (440:7): [True: 1.62k, False: 4.96k]
  ------------------
  441|  4.96k|	if ( data == 0 ) data = "";
  ------------------
  |  Branch (441:7): [True: 0, False: 4.96k]
  ------------------
  442|       |	
  443|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  444|       |		if ( thiz->parseLog != 0 ) {
  445|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  446|       |			fprintf ( thiz->parseLog, "PI: %s - \"%s\"\n", target, data );
  447|       |		}
  448|       |	#endif
  449|       |	
  450|  4.96k|	XML_Node * parentNode = thiz->parseStack.back();
  451|  4.96k|	XML_Node * piNode  = new XML_Node ( parentNode, target, kPINode );
  452|       |	
  453|  4.96k|	piNode->value.assign ( data );
  454|  4.96k|	parentNode->content.push_back ( piNode );
  455|       |	
  456|  4.96k|}	// ProcessingInstructionHandler

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  9.50k|{
  625|  9.50k|	IgnoreParam(options);
  ------------------
  |  |  117|  9.50k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  9.50k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  9.50k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  9.50k|{
  647|       |
  648|  9.50k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     68|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 68, False: 9.43k]
  ------------------
  649|  9.43k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  9.43k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  9.43k|{
  664|  9.43k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  9.43k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  9.43k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  9.43k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  50.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 41.1k, False: 9.43k]
  ------------------
  670|  41.1k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 31.4k, False: 9.70k]
  ------------------
  671|  9.70k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  9.70k|	}
  673|       |
  674|  9.43k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  14.2k|{
  695|  14.2k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  14.2k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.92k, False: 9.33k]
  |  Branch (696:45): [True: 14, False: 4.91k]
  ------------------
  697|     14|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     14|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  14.2k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 9.69k, False: 4.55k]
  |  Branch (700:21): [True: 465, False: 9.22k]
  ------------------
  701|    465|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    465|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  13.7k|	} else {
  703|  13.7k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  13.7k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  13.7k|	}
  706|       |
  707|  14.2k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   321k|{
  265|   321k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   321k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 321k, False: 561]
  |  Branch (269:28): [True: 105k, False: 215k]
  ------------------
  270|       |
  271|   105k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 72.3k, False: 33.0k]
  ------------------
  272|  72.3k|			term = kRDFTerm_li;
  273|  72.3k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 98, False: 32.9k]
  ------------------
  274|     98|			term = kRDFTerm_parseType;
  275|  32.9k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 9.35k, False: 23.6k]
  ------------------
  276|  9.35k|			term = kRDFTerm_Description;
  277|  23.6k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.73k, False: 21.8k]
  ------------------
  278|  1.73k|			term = kRDFTerm_about;
  279|  21.8k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 135, False: 21.7k]
  ------------------
  280|    135|			term = kRDFTerm_resource;
  281|  21.7k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 153, False: 21.5k]
  ------------------
  282|    153|			term = kRDFTerm_RDF;
  283|  21.5k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 1.28k, False: 20.3k]
  ------------------
  284|  1.28k|			term = kRDFTerm_ID;
  285|  20.3k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 2.75k, False: 17.5k]
  ------------------
  286|  2.75k|			term = kRDFTerm_nodeID;
  287|  17.5k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 73, False: 17.4k]
  ------------------
  288|     73|			term = kRDFTerm_datatype;
  289|  17.4k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 68, False: 17.4k]
  ------------------
  290|     68|			term = kRDFTerm_aboutEach;
  291|  17.4k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 18, False: 17.3k]
  ------------------
  292|     18|			term = kRDFTerm_aboutEachPrefix;
  293|  17.3k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 69, False: 17.3k]
  ------------------
  294|     69|			term = kRDFTerm_bagID;
  295|     69|		}
  296|       |
  297|   105k|	}
  298|       |
  299|   321k|	return term;
  300|       |
  301|   321k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  13.7k|{
  732|  13.7k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  13.7k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  13.7k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  38.0k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 25.3k, False: 12.6k]
  ------------------
  738|       |
  739|  25.3k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  25.3k|		switch ( attrTerm ) {
  742|       |
  743|     93|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 93, False: 25.2k]
  ------------------
  744|    137|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 44, False: 25.3k]
  ------------------
  745|  1.87k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.73k, False: 23.6k]
  ------------------
  746|       |
  747|  1.87k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     75|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 75, False: 1.79k]
  ------------------
  748|  1.79k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.79k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.79k, False: 2]
  |  Branch (750:24): [True: 1.66k, False: 132]
  ------------------
  751|       |					// This is the rdf:about attribute on a top level node. Set the XMP tree name if
  752|       |					// it doesn't have a name yet. Make sure this name matches the XMP tree name.
  753|  1.66k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.66k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.66k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.65k, False: 6]
  ------------------
  755|  1.65k|						xmpParent->name = (*currAttr)->value;
  756|  1.65k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 3, False: 3]
  ------------------
  757|      3|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 2, False: 1]
  ------------------
  758|      1|					}
  759|  1.66k|				}
  760|       |
  761|  1.79k|				break;
  762|       |
  763|  23.1k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 23.1k, False: 2.26k]
  ------------------
  764|  23.1k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  23.1k|				break;
  766|       |
  767|    397|			default :
  ------------------
  |  Branch (767:4): [True: 397, False: 24.9k]
  ------------------
  768|    397|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|    397|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  25.3k|		}
  771|       |
  772|  25.3k|	}
  773|       |
  774|  13.7k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   160k|{
  363|       |	#if 0
  364|       |		cout << "AddChildNode, parent = " << xmpParent->name << ", child = " << xmlNode.name;
  365|       |		cout << ", value = \"" << value << '"';
  366|       |		if ( isTopLevel ) cout << ", top level";
  367|       |		cout << endl;
  368|       |	#endif
  369|       |	
  370|   160k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 427, False: 160k]
  ------------------
  371|    427|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    427|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   160k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   160k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   160k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   160k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   160k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 28.6k, False: 131k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  28.6k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  28.6k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  28.6k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  28.6k|#define kXMP_CreateNodes	true
  ------------------
  384|  28.6k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  28.6k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  16.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 16.1k, False: 12.5k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  28.6k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  28.6k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 28.6k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  28.6k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   160k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 87.7k, False: 72.5k]
  ------------------
  398|  87.7k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  87.7k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 10, False: 87.6k]
  ------------------
  399|     10|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  87.7k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   160k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   160k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 159k, False: 239]
  |  Branch (406:26): [True: 101, False: 138]
  ------------------
  407|   160k|		 xmpParent->children.push_back ( newChild );
  408|   160k|	} else {
  409|    150|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|    150|	}
  411|   160k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 239, False: 159k]
  ------------------
  412|    239|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    237|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 237, False: 2]
  |  Branch (412:22): [True: 0, False: 2]
  ------------------
  413|      2|		xmpParent->options |= kRDF_HasValueElem;
  414|      2|	}
  415|       |	
  416|   159k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 72.2k, False: 87.6k]
  ------------------
  417|  72.2k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     74|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 74, False: 72.2k]
  ------------------
  418|  72.2k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  72.2k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  72.2k|	}
  423|       |	
  424|   159k|	return newChild;
  425|       |
  426|   159k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  12.9k|{
  787|  12.9k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  12.9k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   273k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 260k, False: 12.5k]
  ------------------
  791|   260k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 180k, False: 80.2k]
  ------------------
  792|  80.2k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 426, False: 79.7k]
  ------------------
  793|    426|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    426|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  79.7k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  79.7k|	}
  797|       |
  798|  12.9k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  79.7k|{
  854|  79.7k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  79.7k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|    167|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 167, False: 79.6k]
  ------------------
  856|       |	
  857|  79.6k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 2.13k, False: 77.4k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  2.13k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  77.4k|	} else {
  863|       |
  864|       |		// Look through the attributes for one that isn't rdf:ID or xml:lang, it will usually tell
  865|       |		// what we should be dealing with. The called routines must verify their specific syntax!
  866|       |
  867|  77.4k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  77.4k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  77.4k|		XMP_VarString * attrName = 0;
  870|       |
  871|   119k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 64.3k, False: 55.0k]
  ------------------
  872|  64.3k|			attrName = &((*currAttr)->name);
  873|  64.3k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 23.8k, False: 40.4k]
  |  Branch (873:38): [True: 22.4k, False: 1.37k]
  ------------------
  874|  64.3k|		}
  875|       |
  876|  77.4k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 22.4k, False: 55.0k]
  ------------------
  877|       |
  878|  22.4k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  22.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  22.4k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  22.4k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 19, False: 22.4k]
  ------------------
  882|     19|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  22.4k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 22.1k, False: 291]
  ------------------
  884|  22.1k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  22.1k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 0, False: 291]
  ------------------
  886|      0|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    291|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 283, False: 8]
  ------------------
  888|    283|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    283|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 8]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|      8|			} else {
  892|      8|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|      8|			}
  894|       |
  895|  55.0k|		} else {
  896|       |
  897|       |			// Only rdf:ID and xml:lang, could be a resourcePropertyElt, a literalPropertyElt, or an.
  898|       |			// emptyPropertyElt. Look at the child XML nodes to decide which.
  899|       |
  900|  55.0k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 34.4k, False: 20.5k]
  ------------------
  901|       |
  902|  34.4k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  34.4k|			} else {
  905|       |			
  906|  20.5k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  20.5k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  52.3k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 36.5k, False: 15.8k]
  ------------------
  910|  36.5k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.75k, False: 31.8k]
  ------------------
  911|  36.5k|				}
  912|       |				
  913|  20.5k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 15.8k, False: 4.75k]
  ------------------
  914|  15.8k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  15.8k|				} else {
  916|  4.75k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.75k|				}
  918|       |			
  919|  20.5k|			}
  920|       |
  921|  55.0k|		}
  922|       |		
  923|  77.4k|	}
  924|       |
  925|  79.6k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  79.7k|{
  350|       |
  351|  79.7k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 18, False: 79.7k]
  |  Branch (351:42): [True: 0, False: 79.7k]
  ------------------
  352|  79.7k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  79.7k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  79.7k|{
  334|       |
  335|  79.7k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 79.7k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  79.7k|	return false;
  337|       |
  338|  79.7k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  79.7k|{
  317|       |
  318|  79.7k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 72.5k, False: 7.25k]
  |  Branch (318:40): [True: 149, False: 72.3k]
  ------------------
  319|  79.6k|	return false;
  320|       |
  321|  79.7k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  58.7k|{
 1190|  58.7k|	bool hasPropertyAttrs = false;
 1191|  58.7k|	bool hasResourceAttr  = false;
 1192|  58.7k|	bool hasNodeIDAttr    = false;
 1193|  58.7k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  58.7k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  58.7k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     75|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 75, False: 58.6k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  58.6k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  58.6k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   160k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 101k, False: 58.6k]
  ------------------
 1205|       |
 1206|   101k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|   101k|		switch ( attrTerm ) {
 1209|       |
 1210|    596|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 596, False: 100k]
  ------------------
 1211|       |				// Nothing to do.
 1212|    596|				break;
 1213|       |
 1214|     64|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 64, False: 101k]
  ------------------
 1215|     64|				if ( hasNodeIDAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1215:10): [True: 0, False: 64]
  ------------------
 1216|     64|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 0, False: 64]
  ------------------
 1217|     64|				hasResourceAttr = true;
 1218|     64|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 64, False: 0]
  ------------------
 1219|     64|				break;
 1220|       |
 1221|  1.35k|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 1.35k, False: 100k]
  ------------------
 1222|  1.35k|				if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1222:10): [True: 0, False: 1.35k]
  ------------------
 1223|  1.35k|				hasNodeIDAttr = true;
 1224|  1.35k|				break;
 1225|       |
 1226|  99.5k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 99.5k, False: 2.01k]
  ------------------
 1227|  99.5k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 388, False: 99.1k]
  ------------------
 1228|    388|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 0, False: 388]
  ------------------
 1229|    388|					hasValueAttr = true;
 1230|    388|					valueNode = *currAttr;
 1231|  99.1k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 61.5k, False: 37.6k]
  ------------------
 1232|  61.5k|					hasPropertyAttrs = true;
 1233|  61.5k|				}
 1234|  99.5k|				break;
 1235|       |
 1236|  99.5k|			default :
  ------------------
  |  Branch (1236:4): [True: 1, False: 101k]
  ------------------
 1237|      1|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|   101k|		}
 1241|       |
 1242|   101k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  58.6k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  58.6k|	bool childIsStruct = false;
 1250|       |	
 1251|  58.6k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 452, False: 58.2k]
  ------------------
 1252|    452|		childNode->value = valueNode->value;
 1253|    452|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 64, False: 388]
  ------------------
 1254|  58.2k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 22.5k, False: 35.6k]
  ------------------
 1255|  22.5k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  22.5k|		childIsStruct = true;
 1257|  22.5k|	}
 1258|       |		
 1259|  58.6k|	currAttr = xmlNode.attrs.begin();
 1260|  58.6k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   160k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 101k, False: 58.6k]
  ------------------
 1263|       |
 1264|   101k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 451, False: 100k]
  ------------------
 1265|   100k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|   100k|		switch ( attrTerm ) {
 1268|       |
 1269|    596|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 596, False: 100k]
  ------------------
 1270|  1.94k|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 1.35k, False: 99.6k]
  ------------------
 1271|  1.94k|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 100k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  99.0k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 99.0k, False: 1.94k]
  ------------------
 1278|  99.0k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 38.7k, False: 60.3k]
  |  Branch (1278:31): [True: 2.32k, False: 57.9k]
  ------------------
 1279|  41.0k|					AddQualifierNode ( childNode, **currAttr );
 1280|  57.9k|				} else {
 1281|  57.9k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  57.9k|				}
 1283|  99.0k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 100k]
  ------------------
 1286|      0|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1287|      0|				break;
 1288|       |
 1289|   100k|		}
 1290|       |
 1291|   100k|	}
 1292|       |
 1293|  58.6k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  44.1k|{
  484|  44.1k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 2, False: 44.1k]
  ------------------
  485|      2|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  44.1k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  44.1k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  44.4k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  44.4k|	const bool isLang = (name == "xml:lang");
  443|  44.4k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  44.4k|	XMP_Node * newQual = 0;
  446|       |
  447|  44.4k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  44.4k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 3.42k, False: 41.0k]
  ------------------
  450|  3.42k|			xmpParent->qualifiers.push_back ( newQual );
  451|  41.0k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 40.7k, False: 254]
  ------------------
  452|  40.7k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 40.7k, False: 3]
  ------------------
  453|  40.7k|				xmpParent->qualifiers.push_back ( newQual );
  454|  40.7k|			} else {
  455|      3|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|      3|			}
  457|  40.7k|			xmpParent->options |= kXMP_PropHasLang;
  458|  40.7k|		} else {
  459|    254|			XMP_Assert ( isType );
  ------------------
  |  |  142|    254|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    254|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 252, False: 2]
  ------------------
  461|    252|				xmpParent->qualifiers.push_back ( newQual );
  462|    252|			} else {
  463|      2|				size_t offset = 0;
  464|      2|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 2, False: 0]
  ------------------
  465|      2|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|      2|			}
  467|    254|			xmpParent->options |= kXMP_PropHasType;
  468|    254|		}
  469|       |
  470|  44.4k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  44.4k|	return newQual;
  473|       |
  474|  44.4k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  15.8k|{
 1015|  15.8k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  15.8k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  15.8k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  19.8k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 4.01k, False: 15.8k]
  ------------------
 1021|  4.01k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  4.01k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 3.13k, False: 882]
  ------------------
 1023|  3.13k|			AddQualifierNode ( newChild, **currAttr );
 1024|  3.13k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 861, False: 21]
  |  Branch (1024:41): [True: 16, False: 5]
  ------------------
 1025|    877|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|    877|		} else {
 1027|      5|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  4.01k|	}
 1030|       |	
 1031|  15.8k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  15.8k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  15.8k|	size_t      textSize  = 0;
 1034|       |
 1035|  38.0k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 22.2k, False: 15.8k]
  ------------------
 1036|  22.2k|		if ( (*currChild)->kind != kCDataNode ) XMP_Throw ( "Invalid child of literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1036:8): [True: 1, False: 22.2k]
  ------------------
 1037|  22.2k|		textSize += (*currChild)->value.size();
 1038|  22.2k|	}
 1039|       |	
 1040|  15.8k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  38.0k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 22.2k, False: 15.8k]
  ------------------
 1043|  22.2k|		newChild->value += (*currChild)->value;
 1044|  22.2k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  15.8k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    283|{
 1087|       |
 1088|    283|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    283|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    283|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    283|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    566|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 283, False: 283]
  ------------------
 1095|    283|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    283|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 283, False: 0]
  ------------------
 1097|    283|			continue;	// ! The caller ensured the value is "Resource".
 1098|    283|		} else if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1098:15): [True: 0, False: 0]
  ------------------
 1099|      0|			AddQualifierNode ( newStruct, **currAttr );
 1100|      0|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (1100:15): [True: 0, False: 0]
  ------------------
 1101|      0|			continue;	// Ignore all rdf:ID attributes.
 1102|      0|		} else {
 1103|      0|			XMP_Throw ( "Invalid attribute for ParseTypeResource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1104|      0|		}
 1105|    283|	}
 1106|       |
 1107|    283|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    283|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 283]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    283|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|      8|{
 1147|      8|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      8|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      8|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      8|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|      8|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  4.75k|{
  943|  4.75k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.74k, False: 14]
  |  Branch (943:21): [True: 0, False: 4.74k]
  ------------------
  944|       |	
  945|  4.75k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.75k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.75k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.76k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 7, False: 4.75k]
  ------------------
  951|      7|		XMP_VarString & attrName = (*currAttr)->name;
  952|      7|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 6, False: 1]
  ------------------
  953|      6|			AddQualifierNode ( newCompound, **currAttr );
  954|      6|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 1, False: 0]
  ------------------
  955|      1|			continue;	// Ignore all rdf:ID attributes.
  956|      1|		} else {
  957|      0|			XMP_Throw ( "Invalid attribute for resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  958|      0|		}
  959|      7|	}
  960|       |	
  961|  4.75k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.75k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  14.1k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 14.1k, False: 10]
  ------------------
  965|  14.1k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.74k, False: 9.36k]
  ------------------
  966|  14.1k|	}
  967|  4.75k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 4.75k]
  ------------------
  968|  4.75k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     86|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 86, False: 4.67k]
  ------------------
  969|       |
  970|  4.67k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 181, False: 4.49k]
  ------------------
  971|    181|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.49k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.11k, False: 2.37k]
  ------------------
  973|  2.11k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.37k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.89k, False: 477]
  ------------------
  975|  1.89k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.89k|	} else {
  977|    477|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    477|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 355, False: 122]
  ------------------
  979|    355|			XMP_VarString typeName ( (*currChild)->ns );
  980|    355|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    355|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|    101|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 101, False: 254]
  ------------------
  982|    254|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    254|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    254|		}
  985|    477|	}
  986|       |
  987|  4.57k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.57k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 4.57k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  4.57k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.79k, False: 2.77k]
  ------------------
  991|  1.79k|		DetectAltText ( newCompound );
  992|  1.79k|	}
  993|       |
  994|  12.6k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 8.18k, False: 4.48k]
  ------------------
  995|  8.18k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     82|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 82, False: 8.09k]
  ------------------
  996|  8.09k|	}
  997|       |
  998|  4.57k|}	// RDF_ResourcePropertyElement

_Z28InitializeUnicodeConversionsv:
  147|      1|{
  148|      1|	UC_Assert ( (sizeof(UTF8Unit) == 1) && (sizeof(UTF16Unit) == 2) && (sizeof(UTF32Unit) == 4) ); 
  149|       |
  150|      1|	UTF16Unit u16  = 0x00FF;
  151|      1|	bool bigEndian = (*((UTF8Unit*)&u16) == 0);
  152|       |
  153|      1|	UTF8_to_UTF16Native = UTF8_to_UTF16Nat;
  154|      1|	UTF8_to_UTF32Native = UTF8_to_UTF32Nat;
  155|      1|	UTF16Native_to_UTF8 = UTF16Nat_to_UTF8;
  156|      1|	UTF32Native_to_UTF8 = UTF32Nat_to_UTF8;
  157|       |	
  158|      1|	if ( bigEndian ) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|       |	
  160|      0|		swap32to16Offset = 0;
  161|       |
  162|      0|		CodePoint_to_UTF16BE = CodePoint_to_UTF16Nat;
  163|      0|		CodePoint_to_UTF16LE = CodePoint_to_UTF16Swp;
  164|       |
  165|      0|		CodePoint_from_UTF16BE = CodePoint_from_UTF16Nat;
  166|      0|		CodePoint_from_UTF16LE = CodePoint_from_UTF16Swp;
  167|       |
  168|      0|		UTF8_to_UTF16BE = UTF8_to_UTF16Nat;
  169|      0|		UTF8_to_UTF16LE = UTF8_to_UTF16Swp;
  170|      0|		UTF8_to_UTF32BE = UTF8_to_UTF32Nat;
  171|      0|		UTF8_to_UTF32LE = UTF8_to_UTF32Swp;
  172|       |
  173|      0|		UTF16BE_to_UTF8 = UTF16Nat_to_UTF8;
  174|      0|		UTF16LE_to_UTF8 = UTF16Swp_to_UTF8;
  175|      0|		UTF32BE_to_UTF8 = UTF32Nat_to_UTF8;
  176|      0|		UTF32LE_to_UTF8 = UTF32Swp_to_UTF8;
  177|       |
  178|      0|		UTF16BE_to_UTF32BE = UTF16Nat_to_UTF32Nat;
  179|      0|		UTF16BE_to_UTF32LE = UTF16Nat_to_UTF32Swp;
  180|      0|		UTF16LE_to_UTF32BE = UTF16Swp_to_UTF32Nat;
  181|      0|		UTF16LE_to_UTF32LE = UTF16Swp_to_UTF32Swp;
  182|       |
  183|      0|		UTF32BE_to_UTF16BE = UTF32Nat_to_UTF16Nat;
  184|      0|		UTF32BE_to_UTF16LE = UTF32Nat_to_UTF16Swp;
  185|      0|		UTF32LE_to_UTF16BE = UTF32Swp_to_UTF16Nat;
  186|      0|		UTF32LE_to_UTF16LE = UTF32Swp_to_UTF16Swp;
  187|       |
  188|      1|	} else {
  189|       |	
  190|      1|		swap32to16Offset = 1;	// ! Offset in UTF16 units!
  191|       |
  192|      1|		CodePoint_to_UTF16BE = CodePoint_to_UTF16Swp;
  193|      1|		CodePoint_to_UTF16LE = CodePoint_to_UTF16Nat;
  194|       |
  195|      1|		CodePoint_from_UTF16BE = CodePoint_from_UTF16Swp;
  196|      1|		CodePoint_from_UTF16LE = CodePoint_from_UTF16Nat;
  197|       |
  198|      1|		UTF8_to_UTF16BE = UTF8_to_UTF16Swp;
  199|      1|		UTF8_to_UTF16LE = UTF8_to_UTF16Nat;
  200|      1|		UTF8_to_UTF32BE = UTF8_to_UTF32Swp;
  201|      1|		UTF8_to_UTF32LE = UTF8_to_UTF32Nat;
  202|       |
  203|      1|		UTF16BE_to_UTF8 = UTF16Swp_to_UTF8;
  204|      1|		UTF16LE_to_UTF8 = UTF16Nat_to_UTF8;
  205|      1|		UTF32BE_to_UTF8 = UTF32Swp_to_UTF8;
  206|      1|		UTF32LE_to_UTF8 = UTF32Nat_to_UTF8;
  207|       |
  208|      1|		UTF16BE_to_UTF32BE = UTF16Swp_to_UTF32Swp;
  209|      1|		UTF16BE_to_UTF32LE = UTF16Swp_to_UTF32Nat;
  210|      1|		UTF16LE_to_UTF32BE = UTF16Nat_to_UTF32Swp;
  211|      1|		UTF16LE_to_UTF32LE = UTF16Nat_to_UTF32Nat;
  212|       |
  213|      1|		UTF32BE_to_UTF16BE = UTF32Swp_to_UTF16Swp;
  214|      1|		UTF32BE_to_UTF16LE = UTF32Swp_to_UTF16Nat;
  215|      1|		UTF32LE_to_UTF16BE = UTF32Nat_to_UTF16Swp;
  216|      1|		UTF32LE_to_UTF16LE = UTF32Nat_to_UTF16Nat;
  217|       |
  218|      1|	}
  219|       |
  220|      1|}	// InitializeUnicodeConversions
_Z19CodePoint_from_UTF8PKhmPjPm:
  567|  9.63k|{
  568|  9.63k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  9.63k|	size_t unitCount = 0;
  570|       |
  571|  9.63k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  9.63k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 9.63k]
  ------------------
  573|  9.63k|	inUnit = *utf8In;
  574|  9.63k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 9.63k, False: 0]
  ------------------
  575|       |	
  576|      0|	unitCount = 1;
  577|      0|	*cpOut = inUnit;	// ! Don't put after Done, don't write if no input.
  578|       |	
  579|      0|Done:	
  580|      0|	*utf8Read = unitCount;
  581|      0|	return;
  582|       |
  583|  9.63k|MultiByte:
  584|  9.63k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  9.63k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  9.63k|{
  517|  9.63k|	UTF8Unit  inUnit = *utf8In;
  518|  9.63k|	size_t    unitCount = 0;
  519|  9.63k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  9.63k|	const UTF8Unit * utf8Pos;
  521|       |
  522|       |	// -------------------------------------------------------------------------------------
  523|       |	// We've got a multibyte UTF-8 character. The first byte has the number of bytes and the
  524|       |	// highest order data bits. The other bytes each add 6 more data bits.
  525|       |	
  526|       |	#if 0	// This might be a more effcient way to count the bytes.
  527|       |		static XMP_Uns8 kByteCounts[16] = { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 4 };
  528|       |		size_t bytesNeeded = kByteCounts [ inUnit >> 4 ];
  529|       |		if ( (bytesNeeded < 2) || ((bytesNeeded == 4) && ((inUnit & 0x08) != 0)) ) {
  530|       |			UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  531|       |		}
  532|       |	#endif
  533|       |
  534|  9.63k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  31.1k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 21.5k, False: 9.63k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  9.63k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|      0|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 0, False: 9.63k]
  |  Branch (538:28): [True: 0, False: 9.63k]
  ------------------
  539|  9.63k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 9.63k]
  ------------------
  540|  9.63k|	unitCount = bytesNeeded;
  541|       |	
  542|  9.63k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  9.63k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  21.5k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 11.8k, False: 9.63k]
  ------------------
  546|  11.8k|		inUnit = *utf8Pos;
  547|  11.8k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|      0|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 0, False: 11.8k]
  ------------------
  548|  11.8k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  11.8k|	}
  550|       |	
  551|  9.63k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 0, False: 9.63k]
  ------------------
  552|      0|		if ( (0xD800 <= cp) && (cp <= 0xDFFF) ) UC_Throw ( "Bad UTF-8 - surrogate code point", kXMPErr_BadParam );
  ------------------
  |  |   18|      0|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (552:8): [True: 0, False: 0]
  |  Branch (552:26): [True: 0, False: 0]
  ------------------
  553|      0|		if ( cp > 0x10FFFF ) UC_Throw ( "Bad UTF-8 - out of range", kXMPErr_BadParam );
  ------------------
  |  |   18|      0|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (553:8): [True: 0, False: 0]
  ------------------
  554|      0|	}
  555|       |	
  556|  9.63k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  9.63k|Done:	
  559|  9.63k|	*utf8Read = unitCount;
  560|  9.63k|	return;
  561|       |	
  562|  9.63k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   519k|{
   88|       |
   89|   519k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   519k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   519k|	const XMP_Uns8 * namePos   = nameStart;
   92|   519k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   519k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 519k]
  ------------------
   97|       |
   98|   519k|	cp = *namePos;
   99|   519k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 519k, False: 242]
  ------------------
  100|   519k|		++namePos;
  101|   519k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 519k]
  ------------------
  102|   519k|	} else {
  103|    242|		cp = GetCodePoint ( &namePos );
  104|    242|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 242]
  ------------------
  105|    242|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  18.6M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 18.1M, False: 519k]
  ------------------
  110|  18.1M|		cp = *namePos;
  111|  18.1M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 18.1M, False: 5.27k]
  ------------------
  112|  18.1M|			++namePos;
  113|  18.1M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 104k, False: 18.0M]
  |  Branch (113:38): [True: 0, False: 104k]
  ------------------
  114|  18.1M|		} else {
  115|  5.27k|			cp = GetCodePoint ( &namePos );
  116|  5.27k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 568, False: 4.70k]
  |  Branch (116:41): [True: 0, False: 568]
  ------------------
  117|  5.27k|		}
  118|  18.1M|	}
  119|       |
  120|   519k|	return;
  121|       |
  122|   519k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPCore_Impl.cpp:_ZL17IsStartChar_ASCIIj:
   31|  18.6M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  18.6M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 18.2M, False: 335k]
  |  Branch (33:23): [True: 18.2M, False: 0]
  |  Branch (33:40): [True: 231k, False: 104k]
  |  Branch (33:55): [True: 227k, False: 4.03k]
  |  Branch (33:71): [True: 4.03k, False: 104k]
  ------------------
   34|   104k|	return false;
   35|  18.6M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  5.51k|{
   20|  5.51k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  5.51k|	XMP_Uns32 cp;
   22|  5.51k|	size_t u8Len;
   23|  5.51k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  5.51k|	*utf8Str_io = u8Ptr + u8Len;
   25|  5.51k|	return cp;
   26|  5.51k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  5.51k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  5.51k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 5.16k, False: 352]
  |  Branch (43:24): [True: 262, False: 4.90k]
  |  Branch (43:43): [True: 4.90k, False: 352]
  |  Branch (43:59): [True: 1.02k, False: 3.87k]
  ------------------
   44|  4.22k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 3.87k, False: 352]
  |  Branch (44:24): [True: 2.41k, False: 1.45k]
  |  Branch (44:43): [True: 1.23k, False: 568]
  |  Branch (44:60): [True: 0, False: 1.23k]
  ------------------
   45|       |
   46|  1.80k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.23k, False: 568]
  |  Branch (46:25): [True: 894, False: 345]
  |  Branch (46:46): [True: 345, False: 568]
  |  Branch (46:64): [True: 0, False: 345]
  ------------------
   47|    913|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 345, False: 568]
  |  Branch (47:26): [True: 0, False: 345]
  |  Branch (47:46): [True: 345, False: 568]
  |  Branch (47:64): [True: 0, False: 345]
  ------------------
   48|    913|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 345, False: 568]
  |  Branch (48:26): [True: 345, False: 0]
  |  Branch (48:46): [True: 0, False: 568]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    568|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 568]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 568]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    568|	return false;
   52|       |
   53|    568|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   104k|{
   59|       |	// ASCII following characters for an XML name.
   60|   104k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 48.3k, False: 55.8k]
  |  Branch (60:23): [True: 48.3k, False: 0]
  |  Branch (60:39): [True: 25.9k, False: 29.8k]
  |  Branch (60:54): [True: 29.8k, False: 0]
  ------------------
   61|      0|	return false;
   62|   104k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    568|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    568|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 352, False: 216]
  |  Branch (69:24): [True: 216, False: 0]
  |  Branch (69:41): [True: 216, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    568|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  38.8k|{
   88|       |
   89|  38.8k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  38.8k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  38.8k|	const XMP_Uns8 * namePos   = nameStart;
   92|  38.8k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  38.8k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 38.8k]
  ------------------
   97|       |
   98|  38.8k|	cp = *namePos;
   99|  38.8k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 38.4k, False: 448]
  ------------------
  100|  38.4k|		++namePos;
  101|  38.4k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 38.4k]
  ------------------
  102|  38.4k|	} else {
  103|    448|		cp = GetCodePoint ( &namePos );
  104|    448|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 448]
  ------------------
  105|    448|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  9.25M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 9.21M, False: 38.8k]
  ------------------
  110|  9.21M|		cp = *namePos;
  111|  9.21M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 9.21M, False: 3.67k]
  ------------------
  112|  9.21M|			++namePos;
  113|  9.21M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 12.0k, False: 9.20M]
  |  Branch (113:38): [True: 0, False: 12.0k]
  ------------------
  114|  9.21M|		} else {
  115|  3.67k|			cp = GetCodePoint ( &namePos );
  116|  3.67k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 286, False: 3.38k]
  |  Branch (116:41): [True: 0, False: 286]
  ------------------
  117|  3.67k|		}
  118|  9.21M|	}
  119|       |
  120|  38.8k|	return;
  121|       |
  122|  38.8k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  9.25M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  9.25M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 9.19M, False: 52.3k]
  |  Branch (33:23): [True: 9.19M, False: 0]
  |  Branch (33:40): [True: 40.3k, False: 12.0k]
  |  Branch (33:55): [True: 39.3k, False: 929]
  |  Branch (33:71): [True: 929, False: 12.0k]
  ------------------
   34|  12.0k|	return false;
   35|  9.25M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  4.12k|{
   20|  4.12k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  4.12k|	XMP_Uns32 cp;
   22|  4.12k|	size_t u8Len;
   23|  4.12k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  4.12k|	*utf8Str_io = u8Ptr + u8Len;
   25|  4.12k|	return cp;
   26|  4.12k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  4.12k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  4.12k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 3.88k, False: 234]
  |  Branch (43:24): [True: 417, False: 3.47k]
  |  Branch (43:43): [True: 3.47k, False: 234]
  |  Branch (43:59): [True: 527, False: 2.94k]
  ------------------
   44|  3.17k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 2.94k, False: 234]
  |  Branch (44:24): [True: 1.51k, False: 1.43k]
  |  Branch (44:43): [True: 1.38k, False: 286]
  |  Branch (44:60): [True: 0, False: 1.38k]
  ------------------
   45|       |
   46|  1.66k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.38k, False: 286]
  |  Branch (46:25): [True: 826, False: 555]
  |  Branch (46:46): [True: 555, False: 286]
  |  Branch (46:64): [True: 0, False: 555]
  ------------------
   47|    841|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 555, False: 286]
  |  Branch (47:26): [True: 0, False: 555]
  |  Branch (47:46): [True: 555, False: 286]
  |  Branch (47:64): [True: 0, False: 555]
  ------------------
   48|    841|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 555, False: 286]
  |  Branch (48:26): [True: 555, False: 0]
  |  Branch (48:46): [True: 0, False: 286]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    286|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 286]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 286]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    286|	return false;
   52|       |
   53|    286|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  12.0k|{
   59|       |	// ASCII following characters for an XML name.
   60|  12.0k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 4.84k, False: 7.16k]
  |  Branch (60:23): [True: 4.84k, False: 0]
  |  Branch (60:39): [True: 3.99k, False: 3.16k]
  |  Branch (60:54): [True: 3.16k, False: 0]
  ------------------
   61|      0|	return false;
   62|  12.0k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    286|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    286|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 234, False: 52]
  |  Branch (69:24): [True: 52, False: 0]
  |  Branch (69:41): [True: 52, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    286|}

WXMPIterator_PropCTor_1:
   40|  12.2k|{
   41|  12.2k|    XMP_ENTER_WRAPPER ( "WXMPIterator_PropCTor_1" )
  ------------------
  |  |  241|  12.2k|	AnnounceEntry ( proc );									\
  |  |  242|  12.2k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  12.2k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  12.2k|	try {													\
  |  |  245|  12.2k|		XMP_AutoMutex mutex;								\
  |  |  246|  12.2k|		wResult->errMessage = 0;
  ------------------
   42|       |
   43|  12.2k|		if ( schemaNS == 0 ) schemaNS = "";
  ------------------
  |  Branch (43:8): [True: 0, False: 12.2k]
  ------------------
   44|  12.2k|		if ( propName == 0 ) propName = "";
  ------------------
  |  Branch (44:8): [True: 0, False: 12.2k]
  ------------------
   45|       |
   46|  12.2k|		const XMPMeta & xmpObj = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  12.2k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
   47|  12.2k|		XMPIterator *   iter   = new XMPIterator ( xmpObj, schemaNS, propName, options );
   48|  12.2k|		++iter->clientRefs;
   49|  12.2k|		XMP_Assert ( iter->clientRefs == 1 );
  ------------------
  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   50|  12.2k|		wResult->ptrResult = XMPIteratorRef ( iter );
   51|       |
   52|  12.2k|    XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  12.2k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  12.2k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  12.2k|	AnnounceExit();
  ------------------
   53|  12.2k|}
WXMPIterator_DecrementRefCount_1:
   96|  12.2k|{
   97|  12.2k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
   98|  12.2k|	XMP_ENTER_WRAPPER ( "WXMPIterator_DecrementRefCount_1" )
  ------------------
  |  |  241|  12.2k|	AnnounceEntry ( proc );									\
  |  |  242|  12.2k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  12.2k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  12.2k|	try {													\
  |  |  245|  12.2k|		XMP_AutoMutex mutex;								\
  |  |  246|  12.2k|		wResult->errMessage = 0;
  ------------------
   99|       |
  100|  12.2k|		XMPIterator * thiz = (XMPIterator*)iterRef;
  101|       |		
  102|  12.2k|		XMP_Assert ( thiz->clientRefs > 0 );
  ------------------
  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  103|  12.2k|		--thiz->clientRefs;
  104|  12.2k|		if ( thiz->clientRefs <= 0 ) delete ( thiz );
  ------------------
  |  Branch (104:8): [True: 12.2k, False: 0]
  ------------------
  105|       |
  106|  12.2k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  12.2k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  12.2k|	AnnounceExit();
  ------------------
  107|  12.2k|}
WXMPIterator_Next_1:
  136|   204k|{
  137|   204k|    XMP_ENTER_WRAPPER ( "WXMPIterator_Next_1" )
  ------------------
  |  |  241|   204k|	AnnounceEntry ( proc );									\
  |  |  242|   204k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|   204k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|   204k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|   204k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|   204k|	try {													\
  |  |  245|   204k|		XMP_AutoMutex mutex;								\
  |  |  246|   204k|		wResult->errMessage = 0;
  ------------------
  138|       |
  139|   204k|		if ( schemaNS == 0 ) schemaNS = &voidStringPtr;
  ------------------
  |  Branch (139:8): [True: 0, False: 204k]
  ------------------
  140|   204k|		if ( nsSize == 0 ) nsSize = &voidStringLen;
  ------------------
  |  Branch (140:8): [True: 0, False: 204k]
  ------------------
  141|   204k|		if ( propPath == 0 ) propPath = &voidStringPtr;
  ------------------
  |  Branch (141:8): [True: 0, False: 204k]
  ------------------
  142|   204k|		if ( pathSize == 0 ) pathSize = &voidStringLen;
  ------------------
  |  Branch (142:8): [True: 0, False: 204k]
  ------------------
  143|   204k|		if ( propValue == 0 ) propValue = &voidStringPtr;
  ------------------
  |  Branch (143:8): [True: 0, False: 204k]
  ------------------
  144|   204k|		if ( valueSize == 0 ) valueSize = &voidStringLen;
  ------------------
  |  Branch (144:8): [True: 0, False: 204k]
  ------------------
  145|   204k|		if ( propOptions == 0 ) propOptions = &voidOptionBits;
  ------------------
  |  Branch (145:8): [True: 0, False: 204k]
  ------------------
  146|       |
  147|   204k|		XMPIterator * iter = WtoXMPIterator_Ptr ( iterRef );
  ------------------
  |  |  112|   204k|#define WtoXMPIterator_Ptr(iterRef)	(((iterRef) == 0) ? 0 : (XMPIterator *)(iterRef))
  |  |  ------------------
  |  |  |  Branch (112:38): [True: 0, False: 204k]
  |  |  ------------------
  ------------------
  148|   204k|		XMP_Bool found = iter->Next ( schemaNS, nsSize, propPath, pathSize, propValue, valueSize, propOptions );
  149|   204k|		wResult->int32Result = found;
  150|       |
  151|   204k|    XMP_EXIT_WRAPPER_KEEP_LOCK ( found )
  ------------------
  |  |  253|   204k|		if ( keep ) mutex.KeepLock();		\
  |  |  ------------------
  |  |  |  Branch (253:8): [True: 193k, False: 11.2k]
  |  |  ------------------
  |  |  254|   204k|	XMP_CATCH_EXCEPTIONS					\
  |  |  ------------------
  |  |  |  |  265|   204k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|     20|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|     20|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|     20|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|     20|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  270|     20|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|     20|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  255|   204k|	AnnounceExit();
  ------------------
  152|   204k|}
WXMPUtils_UnlockIter_1:
  174|   193k|{
  175|   193k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  176|   193k|    XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPUtils_UnlockIter_1" )
  ------------------
  |  |  235|   193k|	AnnounceNoLock ( proc );								\
  |  |  236|   193k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|   193k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|   193k|	try {													\
  |  |  238|   193k|		wResult->errMessage = 0;
  ------------------
  177|       |
  178|   193k|		XMPIterator * iter = WtoXMPIterator_Ptr ( iterRef );
  ------------------
  |  |  112|   193k|#define WtoXMPIterator_Ptr(iterRef)	(((iterRef) == 0) ? 0 : (XMPIterator *)(iterRef))
  |  |  ------------------
  |  |  |  Branch (112:38): [True: 0, False: 193k]
  |  |  ------------------
  ------------------
  179|   193k|		iter->UnlockIter ( options );
  180|       |
  181|   193k|    XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|   193k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|   193k|	AnnounceExit();
  ------------------
  182|   193k|}

WXMPMeta_Initialize_1:
   50|      1|{
   51|      1|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Initialize_1" )
  ------------------
  |  |  235|      1|	AnnounceNoLock ( proc );								\
  |  |  236|      1|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|      1|	try {													\
  |  |  238|      1|		wResult->errMessage = 0;
  ------------------
   52|       |
   53|      1|		bool ok = XMPMeta::Initialize();
   54|      1|		wResult->int32Result = ok;
   55|       |
   56|      1|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|      1|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|      1|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|      1|	AnnounceExit();
  ------------------
   57|      1|}
WXMPMeta_Terminate_1:
   62|      1|{
   63|      1|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
   64|      1|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Terminate_1" )
  ------------------
  |  |  235|      1|	AnnounceNoLock ( proc );								\
  |  |  236|      1|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|      1|	try {													\
  |  |  238|      1|		wResult->errMessage = 0;
  ------------------
   65|       |
   66|      1|		XMPMeta::Terminate();
   67|       |
   68|      1|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|      1|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|      1|	AnnounceExit();
  ------------------
   69|      0|}
WXMPMeta_CTor_1:
   77|  11.2k|{
   78|  11.2k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CTor_1" )
  ------------------
  |  |  241|  11.2k|	AnnounceEntry ( proc );									\
  |  |  242|  11.2k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  11.2k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  11.2k|	try {													\
  |  |  245|  11.2k|		XMP_AutoMutex mutex;								\
  |  |  246|  11.2k|		wResult->errMessage = 0;
  ------------------
   79|       |
   80|  11.2k|		XMPMeta * xmpObj = new XMPMeta();
   81|  11.2k|		++xmpObj->clientRefs;
   82|  11.2k|		XMP_Assert ( xmpObj->clientRefs == 1 );
  ------------------
  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   83|  11.2k|		wResult->ptrResult = XMPMetaRef ( xmpObj );
   84|       |
   85|  11.2k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  11.2k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  11.2k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  11.2k|	AnnounceExit();
  ------------------
   86|  11.2k|}
WXMPMeta_DecrementRefCount_1:
  108|  11.2k|{
  109|  11.2k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  110|  11.2k|	XMP_ENTER_WRAPPER ( "WXMPMeta_DecrementRefCount_1" )
  ------------------
  |  |  241|  11.2k|	AnnounceEntry ( proc );									\
  |  |  242|  11.2k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  11.2k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  11.2k|	try {													\
  |  |  245|  11.2k|		XMP_AutoMutex mutex;								\
  |  |  246|  11.2k|		wResult->errMessage = 0;
  ------------------
  111|       |
  112|  11.2k|		XMPMeta * thiz = (XMPMeta*)xmpRef;
  113|       |		
  114|  11.2k|		XMP_Assert ( thiz->clientRefs > 0 );
  ------------------
  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  115|  11.2k|		--thiz->clientRefs;
  116|  11.2k|		if ( thiz->clientRefs <= 0 ) delete ( thiz );
  ------------------
  |  Branch (116:8): [True: 11.2k, False: 0]
  ------------------
  117|       |
  118|  11.2k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  11.2k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  11.2k|	AnnounceExit();
  ------------------
  119|  11.2k|}
WXMPMeta_Unlock_1:
  207|  40.3k|{
  208|  40.3k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  209|  40.3k|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Unlock_1" )
  ------------------
  |  |  235|  40.3k|	AnnounceNoLock ( proc );								\
  |  |  236|  40.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  40.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|  40.3k|	try {													\
  |  |  238|  40.3k|		wResult->errMessage = 0;
  ------------------
  210|       |
  211|  40.3k|		XMPMeta::Unlock ( options );
  212|       |
  213|  40.3k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  40.3k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  40.3k|	AnnounceExit();
  ------------------
  214|  40.3k|}
WXMPMeta_RegisterNamespace_1:
  222|     22|{
  223|     22|	XMP_ENTER_WRAPPER ( "WXMPMeta_RegisterNamespace_1" )
  ------------------
  |  |  241|     22|	AnnounceEntry ( proc );									\
  |  |  242|     22|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|     22|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|     22|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|     22|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|     22|	try {													\
  |  |  245|     22|		XMP_AutoMutex mutex;								\
  |  |  246|     22|		wResult->errMessage = 0;
  ------------------
  224|       |
  225|     22|		if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (225:8): [True: 0, False: 22]
  |  Branch (225:31): [True: 0, False: 22]
  ------------------
  226|     22|		if ( (prefix == 0) || (*prefix == 0) ) XMP_Throw ( "Empty prefix", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (226:8): [True: 0, False: 22]
  |  Branch (226:25): [True: 0, False: 22]
  ------------------
  227|       |
  228|     22|		XMPMeta::RegisterNamespace ( namespaceURI, prefix );
  229|       |
  230|     22|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|     22|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|     22|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|     22|	AnnounceExit();
  ------------------
  231|     22|}
WXMPMeta_GetNamespacePrefix_1:
  240|  40.3k|{
  241|  40.3k|	XMP_ENTER_WRAPPER ( "WXMPMeta_GetNamespacePrefix_1" )
  ------------------
  |  |  241|  40.3k|	AnnounceEntry ( proc );									\
  |  |  242|  40.3k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  40.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  40.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  40.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  40.3k|	try {													\
  |  |  245|  40.3k|		XMP_AutoMutex mutex;								\
  |  |  246|  40.3k|		wResult->errMessage = 0;
  ------------------
  242|       |
  243|  40.3k|		if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (243:8): [True: 0, False: 40.3k]
  |  Branch (243:31): [True: 0, False: 40.3k]
  ------------------
  244|       |
  245|  40.3k|		if ( namespacePrefix == 0 ) namespacePrefix = &voidStringPtr;
  ------------------
  |  Branch (245:8): [True: 0, False: 40.3k]
  ------------------
  246|  40.3k|		if ( prefixSize == 0 ) prefixSize = &voidStringLen;
  ------------------
  |  Branch (246:8): [True: 0, False: 40.3k]
  ------------------
  247|       |
  248|  40.3k|		bool found = XMPMeta::GetNamespacePrefix ( namespaceURI, namespacePrefix, prefixSize );
  249|  40.3k|		wResult->int32Result = found;
  250|       |		
  251|  40.3k|	XMP_EXIT_WRAPPER_KEEP_LOCK ( found )
  ------------------
  |  |  253|  40.3k|		if ( keep ) mutex.KeepLock();		\
  |  |  ------------------
  |  |  |  Branch (253:8): [True: 40.3k, False: 0]
  |  |  ------------------
  |  |  254|  40.3k|	XMP_CATCH_EXCEPTIONS					\
  |  |  ------------------
  |  |  |  |  265|  40.3k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  255|  40.3k|	AnnounceExit();
  ------------------
  252|  40.3k|}
WXMPMeta_CountArrayItems_1:
 1168|  3.70k|{
 1169|  3.70k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CountArrayItems_1" )
  ------------------
  |  |  241|  3.70k|	AnnounceEntry ( proc );									\
  |  |  242|  3.70k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.70k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.70k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.70k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.70k|	try {													\
  |  |  245|  3.70k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.70k|		wResult->errMessage = 0;
  ------------------
 1170|       |		
 1171|  3.70k|		if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1171:8): [True: 0, False: 3.70k]
  |  Branch (1171:27): [True: 0, False: 3.70k]
  ------------------
 1172|  3.70k|		if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1172:8): [True: 0, False: 3.70k]
  |  Branch (1172:28): [True: 0, False: 3.70k]
  ------------------
 1173|       |
 1174|  3.70k|		const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  3.70k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
 1175|  3.70k|		XMP_Index count = meta.CountArrayItems ( schemaNS, arrayName );
 1176|  3.70k|		wResult->int32Result = count;
 1177|       |		
 1178|  3.70k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  3.70k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  3.70k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  3.70k|	AnnounceExit();
  ------------------
 1179|  3.70k|}
WXMPMeta_ParseFromBuffer_1:
 1270|  11.2k|{
 1271|  11.2k|	XMP_ENTER_WRAPPER ( "WXMPMeta_ParseFromBuffer_1" )
  ------------------
  |  |  241|  11.2k|	AnnounceEntry ( proc );									\
  |  |  242|  11.2k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  11.2k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  11.2k|	try {													\
  |  |  245|  11.2k|		XMP_AutoMutex mutex;								\
  |  |  246|  11.2k|		wResult->errMessage = 0;
  ------------------
 1272|       |
 1273|  11.2k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|  11.2k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
 1274|  11.2k|		meta->ParseFromBuffer ( buffer, bufferSize, options );
 1275|       |		
 1276|  11.2k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  11.2k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  11.2k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|  2.77k|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|  2.77k|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|  2.77k|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|  2.77k|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 2.77k]
  |  |  |  |  ------------------
  |  |  |  |  270|  2.77k|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|  2.77k|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  11.2k|	AnnounceExit();
  ------------------
 1277|  11.2k|}

WXMPUtils_ConvertToDate_1:
  339|    178|{
  340|    178|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPUtils_ConvertToDate_1" )
  ------------------
  |  |  235|    178|	AnnounceNoLock ( proc );								\
  |  |  236|    178|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|    178|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|    178|	try {													\
  |  |  238|    178|		wResult->errMessage = 0;
  ------------------
  341|       |
  342|    178|		if ( binValue == 0 ) XMP_Throw ( "Null output date", kXMPErr_BadParam); // ! Pointer is from the client.
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (342:8): [True: 0, False: 178]
  ------------------
  343|    178|		XMPUtils::ConvertToDate ( strValue, binValue );
  344|       |
  345|    178|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|    178|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|    178|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|    124|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|    124|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|    124|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|    124|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 124]
  |  |  |  |  ------------------
  |  |  |  |  270|    124|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|    124|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|    178|	AnnounceExit();
  ------------------
  346|    178|}
WXMPUtils_ConvertToLocalTime_1:
  395|     54|{
  396|     54|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPUtils_ConvertToLocalTime_1" )
  ------------------
  |  |  235|     54|	AnnounceNoLock ( proc );								\
  |  |  236|     54|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|     54|	try {													\
  |  |  238|     54|		wResult->errMessage = 0;
  ------------------
  397|       |
  398|     54|		if ( time == 0 ) XMP_Throw ( "Null output date", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (398:8): [True: 0, False: 54]
  ------------------
  399|     54|		XMPUtils::ConvertToLocalTime ( time );
  400|       |
  401|     54|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|     54|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|     54|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|     54|	AnnounceExit();
  ------------------
  402|     54|}

_ZN8XML_NodeC2EPS_PKch:
   90|   595k|            : kind(_kind), name(_name), nsPrefixLen(0), parent(_parent) {};
_ZN8XML_NodeD2Ev:
   95|   595k|	virtual ~XML_Node() { RemoveAttrs(); RemoveContent(); };
_ZN16XMLParserAdapterC2Ev:
  112|  11.2k|		: tree(0,"",kRootNode), rootNode(0), rootCount(0), charEncoding(XMP_OptionBits(-1)), pendingCount(0)
  113|  11.2k|	{
  114|       |		#if XMP_DebugBuild
  115|       |			parseLog = 0;
  116|       |		#endif
  117|  11.2k|	};
_ZN16XMLParserAdapterD2Ev:
  119|  11.2k|	virtual ~XMLParserAdapter() {};

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   324k|{
   40|   324k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 93.6k, False: 230k]
  ------------------
   41|       |
   42|   901k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 671k, False: 229k]
  ------------------
   43|   671k|		unsigned char ch = this->value[i];
   44|   671k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   671k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 556k, False: 115k]
  |  |  |  Branch (45:49): [True: 273, False: 115k]
  |  |  |  Branch (45:67): [True: 114k, False: 1.05k]
  |  |  |  Branch (45:85): [True: 0, False: 1.05k]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|  1.05k|		return false;	// All the checks failed, this isn't whitespace.
   47|   671k|	}
   48|       |
   49|   229k|	return true;
   50|       |
   51|   230k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   595k|{
  428|       |
  429|   732k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 137k, False: 595k]
  ------------------
  430|   595k|	this->attrs.clear();
  431|       |
  432|   595k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   595k|{
  440|       |
  441|  1.04M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 446k, False: 595k]
  ------------------
  442|   595k|	this->content.clear();
  443|       |
  444|   595k|}	// XML_Node::RemoveContent

_Z13XMP_InitMutexP15pthread_mutex_t:
  114|      1|	bool XMP_InitMutex ( XMP_Mutex * mutex ) {
  115|      1|		int err = pthread_mutex_init ( mutex, 0 );
  116|      1|		return (err == 0 );
  117|      1|	}
_Z13XMP_TermMutexR15pthread_mutex_t:
  119|      1|	void XMP_TermMutex ( XMP_Mutex & mutex ) {
  120|      1|		(void) pthread_mutex_destroy ( &mutex );
  121|      1|	}
_Z23XMP_EnterCriticalRegionR15pthread_mutex_t:
  123|   307k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   307k|		int err = pthread_mutex_lock ( &mutex );
  125|   307k|		if ( err != 0 ) XMP_Throw ( "XMP_EnterCriticalRegion - pthread_mutex_lock failure", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (125:8): [True: 0, False: 307k]
  ------------------
  126|   307k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   307k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   307k|		int err = pthread_mutex_unlock ( &mutex );
  130|   307k|		if ( err != 0 ) XMP_Throw ( "XMP_ExitCriticalRegion - pthread_mutex_unlock failure", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (130:8): [True: 0, False: 307k]
  ------------------
  131|   307k|	}
_Z16VerifySetOptionsjPKc:
  563|    963|{
  564|       |
  565|    963|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 251, False: 712]
  ------------------
  566|    963|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 251, False: 712]
  ------------------
  567|    963|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 489, False: 474]
  ------------------
  568|       |	
  569|    963|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 963]
  ------------------
  570|      0|		XMP_Throw ( "Unrecognized option flags", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  571|      0|	}
  572|       |	
  573|    963|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 0, False: 963]
  |  Branch (573:45): [True: 0, False: 0]
  ------------------
  574|      0|		XMP_Throw ( "IsStruct and IsArray options are mutually exclusive", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  575|      0|	}
  576|       |	
  577|    963|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 963]
  |  Branch (577:48): [True: 0, False: 0]
  ------------------
  578|      0|		XMP_Throw ( "Structs and arrays can't have \"value\" options", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  579|      0|	}
  580|       |	
  581|    963|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 0, False: 963]
  |  Branch (581:27): [True: 0, False: 0]
  ------------------
  582|      0|		XMP_Throw ( "Structs and arrays can't have string values", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  583|      0|	}
  584|       |
  585|    963|	return options;
  586|       |
  587|    963|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   187k|{
  663|   187k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   187k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   187k|	XMP_StringPtr	qualName, nameEnd;
  667|   187k|	XMP_VarString	currStep;
  668|       |		
  669|   187k|	qualName = nameEnd = NULL;
  670|   187k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  19.9M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 19.7M, False: 187k]
  ------------------
  672|  19.7M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 72.1k, False: 19.6M]
  |  Branch (672:29): [True: 152k, False: 19.4M]
  ------------------
  673|  19.7M|	}
  674|       |	
  675|   187k|	expandedXPath->clear();
  676|   187k|	expandedXPath->reserve ( resCount );
  677|       |	
  678|       |	// -------------------------------------------------------------------------------------------
  679|       |	// Pull out the first component and do some special processing on it: add the schema namespace
  680|       |	// prefix and see if it is an alias. The start must be a qualName.
  681|       |	
  682|   187k|	stepBegin = propPath;
  683|   187k|	stepEnd = stepBegin;
  684|  14.6M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 14.6M, False: 35.3k]
  |  Branch (684:29): [True: 14.6M, False: 579]
  |  Branch (684:50): [True: 14.4M, False: 152k]
  |  Branch (684:71): [True: 14.4M, False: 0]
  ------------------
  685|   187k|	if ( stepEnd == stepBegin ) XMP_Throw ( "Empty initial XPath step", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (685:7): [True: 0, False: 187k]
  ------------------
  686|   187k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   187k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   187k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   187k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 187k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   187k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   412k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 224k, False: 187k]
  ------------------
  700|       |
  701|   224k|		stepBegin = stepEnd;
  702|   224k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 72.1k, False: 152k]
  ------------------
  703|   224k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 224k]
  ------------------
  704|      0|			++stepBegin;
  705|      0|			if ( *stepBegin != '[' ) XMP_Throw ( "Missing '[' after '*'", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (705:9): [True: 0, False: 0]
  ------------------
  706|      0|		}
  707|   224k|		stepEnd = stepBegin;
  708|       |
  709|   224k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 72.1k, False: 152k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|  72.1k|			qualName = stepBegin;
  713|  4.56M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 4.49M, False: 72.1k]
  |  Branch (713:31): [True: 4.49M, False: 0]
  |  Branch (713:52): [True: 4.49M, False: 0]
  |  Branch (713:73): [True: 4.49M, False: 0]
  ------------------
  714|  72.1k|			nameEnd = stepEnd;
  715|  72.1k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   152k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   152k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   152k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 152k, False: 0]
  |  Branch (723:30): [True: 152k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|   546k|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 546k, False: 0]
  |  Branch (726:32): [True: 546k, False: 0]
  |  Branch (726:53): [True: 394k, False: 152k]
  ------------------
  727|   152k|				if ( *stepEnd != ']' ) XMP_Throw ( "Missing ']' for integer array index", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (727:10): [True: 0, False: 152k]
  ------------------
  728|   152k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   152k|			} else {
  731|       |
  732|       |				// Could be "[last()]" or one of the selector forms. Find the ']' or '='.
  733|       |				
  734|      0|				while ( (*stepEnd != 0) && (*stepEnd != ']') && (*stepEnd != '=') ) ++stepEnd;
  ------------------
  |  Branch (734:13): [True: 0, False: 0]
  |  Branch (734:32): [True: 0, False: 0]
  |  Branch (734:53): [True: 0, False: 0]
  ------------------
  735|      0|				if ( *stepEnd == 0 ) XMP_Throw ( "Missing ']' or '=' for array index", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (735:10): [True: 0, False: 0]
  ------------------
  736|       |
  737|      0|				if ( *stepEnd == ']' ) {
  ------------------
  |  Branch (737:10): [True: 0, False: 0]
  ------------------
  738|       |
  739|      0|					if ( strncmp ( "[last()", stepBegin, (stepEnd - stepBegin) ) != 0 ) {
  ------------------
  |  Branch (739:11): [True: 0, False: 0]
  ------------------
  740|      0|						XMP_Throw ( "Invalid non-numeric array index", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  741|      0|					}
  742|      0|					stepFlags = kXMP_ArrayLastStep;
  743|       |
  744|      0|				} else {
  745|       |
  746|      0|					qualName = stepBegin+1;
  747|      0|					nameEnd = stepEnd;
  748|      0|					++stepEnd;	// Absorb the '=', remember the quote.
  749|      0|					const char quote = *stepEnd;
  750|      0|					if ( (quote != '\'') && (quote != '"') ) {
  ------------------
  |  Branch (750:11): [True: 0, False: 0]
  |  Branch (750:30): [True: 0, False: 0]
  ------------------
  751|      0|						XMP_Throw ( "Invalid quote in array selector", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  752|      0|					}
  753|       |
  754|      0|					++stepEnd;	// Absorb the leading quote.
  755|      0|					while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (755:14): [True: 0, False: 0]
  ------------------
  756|      0|						if ( *stepEnd == quote ) {
  ------------------
  |  Branch (756:12): [True: 0, False: 0]
  ------------------
  757|      0|							if ( *(stepEnd+1) != quote ) break;
  ------------------
  |  Branch (757:13): [True: 0, False: 0]
  ------------------
  758|      0|							++stepEnd;
  759|      0|						}
  760|      0|						++stepEnd;
  761|      0|					}
  762|      0|					if ( *stepEnd == 0 ) {
  ------------------
  |  Branch (762:11): [True: 0, False: 0]
  ------------------
  763|      0|						XMP_Throw ( "No terminating quote for array selector", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  764|      0|					}
  765|      0|					++stepEnd;	// Absorb the trailing quote.
  766|       |					
  767|      0|					stepFlags = kXMP_FieldSelectorStep;	// ! Touch up later, also changing '@' to '?'.
  768|       |
  769|      0|				}
  770|       |
  771|      0|			}
  772|       |
  773|   152k|			if ( *stepEnd != ']' ) XMP_Throw ( "Missing ']' for array index", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (773:9): [True: 0, False: 152k]
  ------------------
  774|   152k|			++stepEnd;
  775|       |			
  776|   152k|		}
  777|       |
  778|   224k|		if ( stepEnd == stepBegin ) XMP_Throw ( "Empty XPath step", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (778:8): [True: 0, False: 224k]
  ------------------
  779|   224k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   224k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   224k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 72.1k, False: 152k]
  ------------------
  782|       |
  783|  72.1k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 72.1k]
  ------------------
  784|      0|				currStep[0] = '?';
  785|      0|				if ( currStep != "?xml:lang" ) XMP_Throw ( "Only xml:lang allowed with '@'", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (785:10): [True: 0, False: 0]
  ------------------
  786|      0|			}
  787|  72.1k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 43.5k, False: 28.5k]
  ------------------
  788|  43.5k|				++qualName;
  789|  43.5k|				stepFlags = kXMP_QualifierStep;
  790|  43.5k|			}
  791|  72.1k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   152k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   152k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 152k]
  ------------------
  794|       |
  795|      0|			if ( currStep[1] == '@' ) {
  ------------------
  |  Branch (795:9): [True: 0, False: 0]
  ------------------
  796|      0|				currStep[1] = '?';
  797|      0|				if ( strncmp ( currStep.c_str(), "[?xml:lang=", 11 ) != 0 ) {
  ------------------
  |  Branch (797:10): [True: 0, False: 0]
  ------------------
  798|      0|					XMP_Throw ( "Only xml:lang allowed with '@'", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  799|      0|				}
  800|      0|			}
  801|      0|			if ( currStep[1] == '?' ) {
  ------------------
  |  Branch (801:9): [True: 0, False: 0]
  ------------------
  802|      0|				++qualName;
  803|      0|				stepFlags = kXMP_QualSelectorStep;
  804|      0|			}
  805|      0|			VerifyQualName ( qualName, nameEnd );
  806|       |
  807|      0|		}
  808|       |
  809|   224k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   224k|	}
  812|       |
  813|   187k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   290k|{
  829|   290k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   290k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   290k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|   690k|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 621k, False: 69.6k]
  ------------------
  834|   621k|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|   621k|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|   621k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|   621k|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 221k, False: 399k]
  ------------------
  837|   221k|			schemaNode = currSchema;
  838|   221k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 187k, False: 33.6k]
  ------------------
  839|   221k|			break;
  840|   221k|		}
  841|   621k|	}
  842|       |	
  843|   290k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 69.6k, False: 221k]
  |  Branch (843:28): [True: 16.3k, False: 53.2k]
  ------------------
  844|       |
  845|  16.3k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  16.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  16.3k|		XMP_StringPtr prefixPtr;
  847|  16.3k|		XMP_StringLen prefixLen;
  848|  16.3k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  16.3k|		XMP_Assert ( found );
  ------------------
  |  |  142|  16.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  16.3k|		UNUSED(found);
  851|       |
  852|  16.3k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  16.3k|		xmpTree->children.push_back ( schemaNode );
  854|  16.3k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 240, False: 16.1k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  16.3k|	}
  861|       |	
  862|   290k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   290k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   290k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   290k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   290k|	return schemaNode;
  865|       |	
  866|   290k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   310k|{
  882|   310k|	XMP_Node * childNode = 0;
  883|       |
  884|   310k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 12, False: 310k]
  ------------------
  885|     12|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     12|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 12, False: 0]
  ------------------
  886|     12|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     12|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|		}
  888|      0|		if ( parent->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|      0|			XMP_Throw ( "Named children not allowed for arrays", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  890|      0|		}
  891|      0|		if ( ! createNodes ) {	// *** Should be assert? If !createNodes, why is the parent a new implicit node?
  ------------------
  |  Branch (891:8): [True: 0, False: 0]
  ------------------
  892|      0|			XMP_Throw ( "Parent is new implicit node, but createNodes is false", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  893|      0|		}
  894|      0|		parent->options |= kXMP_PropValueIsStruct;
  895|      0|	}
  896|       |	
  897|  1.51M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 1.41M, False: 93.4k]
  ------------------
  898|  1.41M|		XMP_Node * currChild = parent->children[childNum];
  899|  1.41M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  1.41M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  1.41M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 216k, False: 1.20M]
  ------------------
  901|   216k|			childNode = currChild;
  902|   216k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 216k, False: 676]
  ------------------
  903|   216k|			break;
  904|   216k|		}
  905|  1.41M|	}
  906|       |	
  907|   310k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 93.4k, False: 216k]
  |  Branch (907:27): [True: 242, False: 93.2k]
  ------------------
  908|    242|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|    242|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|    242|		parent->children.push_back ( childNode );
  910|    242|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 242, False: 0]
  ------------------
  911|    242|	}
  912|       |	
  913|   310k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   310k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   310k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   310k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   310k|	return childNode;
  916|       |	
  917|   310k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|  43.5k|{
  935|  43.5k|	XMP_Node * qualNode = 0;
  936|       |	
  937|  43.5k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|  43.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  62.1k|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 62.1k, False: 0]
  ------------------
  940|  62.1k|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  62.1k|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  62.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  62.1k|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 43.5k, False: 18.5k]
  ------------------
  943|  43.5k|			qualNode = currQual;
  944|  43.5k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 43.5k, False: 0]
  ------------------
  945|  43.5k|			break;
  946|  43.5k|		}
  947|  62.1k|	}
  948|       |	
  949|  43.5k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 0, False: 43.5k]
  |  Branch (949:26): [True: 0, False: 0]
  ------------------
  950|       |
  951|      0|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|      0|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|      0|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|      0|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|      0|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|      0|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|      0|		const bool isSpecial = isLang | isType;
  957|       |
  958|      0|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 0, False: 0]
  ------------------
  959|      0|			parent->options |= kXMP_PropHasLang;
  960|      0|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 0, False: 0]
  ------------------
  961|      0|			parent->options |= kXMP_PropHasType;
  962|      0|		}
  963|       |		
  964|      0|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 0, False: 0]
  |  Branch (964:38): [True: 0, False: 0]
  ------------------
  965|      0|			parent->qualifiers.push_back ( qualNode );
  966|      0|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 0, False: 0]
  ------------------
  967|      0|		} else {
  968|      0|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      0|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 0, False: 0]
  |  Branch (969:19): [True: 0, False: 0]
  ------------------
  970|      0|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      0|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 0, False: 0]
  ------------------
  972|      0|		}
  973|       |
  974|      0|	}
  975|       |	
  976|  43.5k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|  43.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|  43.5k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  43.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|  43.5k|	return qualNode;
  979|       |	
  980|  43.5k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   187k|{
 1063|   187k|	XMP_Node *     currNode = 0;
 1064|   187k|	XMP_NodePtrPos currPos;
 1065|   187k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   187k|	bool           leafIsNew = false;
 1067|       |	
 1068|   187k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   187k|	if ( expandedXPath.empty() ) XMP_Throw ( "Empty XPath", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1070:7): [True: 0, False: 187k]
  ------------------
 1071|       |	
 1072|   187k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   187k|	size_t stepLim = expandedXPath.size();
 1074|       |	
 1075|       |	// The start of processing deals with the schema node and top level alias. If the top level step
 1076|       |	// is not an alias, lookup the expanded path's schema URI. Otherwise, lookup the expanded path
 1077|       |	// for the actual. While tempting, don't substitute the actual's path into the local one, don't
 1078|       |	// risk messing with the caller's use of that. Also don't call FindNode recursively, we need to
 1079|       |	// keep track of the root of the implicitly created subtree as we move down the path.
 1080|       |	
 1081|   187k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 187k, False: 0]
  ------------------
 1082|       |		
 1083|   187k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   187k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 0, False: 187k]
  ------------------
 1085|       |
 1086|   187k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   187k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 240, False: 187k]
  ------------------
 1087|    240|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    240|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|    240|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 240, False: 0]
  ------------------
 1089|    240|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|    240|		}
 1091|       |
 1092|   187k|	} else {
 1093|       |
 1094|      0|		stepNum = 2;	// ! Continue processing the original path at the second level step.
 1095|       |
 1096|      0|		XMP_AliasMapPos aliasPos = sRegisteredAliasMap->find ( expandedXPath[kRootPropStep].step );
 1097|      0|		XMP_Assert ( aliasPos != sRegisteredAliasMap->end() );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1098|       |		
 1099|      0|		currNode = FindSchemaNode ( xmpTree, aliasPos->second[kSchemaStep].step.c_str(), createNodes, &currPos );
 1100|      0|		if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1100:8): [True: 0, False: 0]
  ------------------
 1101|      0|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1101:8): [True: 0, False: 0]
  ------------------
 1102|      0|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1103|      0|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1103:9): [True: 0, False: 0]
  ------------------
 1104|      0|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1105|      0|		}
 1106|       |
 1107|      0|		currNode = FollowXPathStep ( currNode, aliasPos->second, 1, createNodes, &currPos );
 1108|      0|		if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1108:8): [True: 0, False: 0]
  ------------------
 1109|      0|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1109:8): [True: 0, False: 0]
  ------------------
 1110|      0|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1111|      0|			CheckImplicitStruct ( currNode, expandedXPath, 2, stepLim );
 1112|      0|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1112:9): [True: 0, False: 0]
  ------------------
 1113|      0|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1114|      0|		}
 1115|       |		
 1116|      0|		XMP_OptionBits arrayForm = aliasPos->second[kRootPropStep].options & kXMP_PropArrayFormMask;
 1117|      0|		XMP_Assert ( (arrayForm == 0) || (arrayForm & kXMP_PropValueIsArray) );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1118|      0|		XMP_Assert ( (arrayForm == 0) ? (aliasPos->second.size() == 2) : (aliasPos->second.size() == 3) );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1119|       |		
 1120|      0|		if ( arrayForm != 0 ) { 
  ------------------
  |  Branch (1120:8): [True: 0, False: 0]
  ------------------
 1121|      0|			currNode = FollowXPathStep ( currNode, aliasPos->second, 2, createNodes, &currPos, true );
 1122|      0|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1122:9): [True: 0, False: 0]
  ------------------
 1123|      0|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1123:9): [True: 0, False: 0]
  ------------------
 1124|      0|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1125|      0|				CheckImplicitStruct ( currNode, expandedXPath, 2, stepLim );
 1126|      0|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1126:10): [True: 0, False: 0]
  ------------------
 1127|      0|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1128|      0|			}
 1129|      0|		}
 1130|       |		
 1131|      0|	}
 1132|       |	
 1133|       |	// Now follow the remaining steps of the original XPath.
 1134|       |	
 1135|       |	// *** ??? Change all the num/lim loops back to num<lim? Probably safer.
 1136|       |	
 1137|   187k|	try {
 1138|   600k|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 412k, False: 187k]
  ------------------
 1139|   412k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   412k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 0, False: 412k]
  ------------------
 1141|   412k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   412k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 242, False: 411k]
  ------------------
 1142|    242|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    242|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|    242|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|    242|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 2, False: 240]
  ------------------
 1145|    242|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|    242|			}
 1147|   412k|		}
 1148|   187k|	} catch ( ... ) {
 1149|      0|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 0, False: 0]
  ------------------
 1150|      0|		throw;
 1151|      0|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   187k|EXIT:
 1156|       |
 1157|   187k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   187k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   187k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 242, False: 187k]
  ------------------
 1161|    242|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 242, False: 0]
  ------------------
 1162|    242|			currNode->options |= leafOptions;
 1163|    242|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|    242|	}
 1167|       |
 1168|   187k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 187k, False: 0]
  |  Branch (1168:26): [True: 0, False: 187k]
  ------------------
 1169|   187k|	return currNode;
 1170|       |	
 1171|   187k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  41.5k|{
 1344|  41.5k|	char * tagStart;
 1345|  41.5k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  41.5k|	tagStart = (char*) value->c_str();
 1350|  1.19M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 1.19M, False: 5.56k]
  |  Branch (1350:45): [True: 1.15M, False: 35.9k]
  ------------------
 1351|  1.15M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 1.10M, False: 45.5k]
  |  Branch (1351:28): [True: 15.8k, False: 1.09M]
  ------------------
 1352|  1.15M|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  41.5k|	tagStart = tagEnd;
 1357|  41.5k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 35.9k, False: 5.56k]
  ------------------
 1358|  4.81M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 4.77M, False: 40.3k]
  |  Branch (1358:45): [True: 4.76M, False: 1.15k]
  ------------------
 1359|  4.76M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 4.73M, False: 31.9k]
  |  Branch (1359:28): [True: 17.6k, False: 4.71M]
  ------------------
 1360|  4.76M|	}
 1361|  41.5k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 585, False: 40.9k]
  ------------------
 1362|    585|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 465, False: 120]
  |  Branch (1362:30): [True: 447, False: 18]
  ------------------
 1363|    585|		++tagStart;
 1364|    585|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 473, False: 112]
  |  Branch (1364:30): [True: 433, False: 40]
  ------------------
 1365|    585|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  51.4k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 51.4k, Folded]
  ------------------
 1370|  51.4k|		tagStart = tagEnd;
 1371|  51.4k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 9.94k, False: 41.5k]
  ------------------
 1372|  51.4k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 41.5k, False: 9.94k]
  ------------------
 1373|  13.5M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 13.5M, False: 1.15k]
  |  Branch (1373:46): [True: 13.5M, False: 8.79k]
  ------------------
 1374|  13.5M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 13.4M, False: 43.1k]
  |  Branch (1374:29): [True: 51.7k, False: 13.4M]
  ------------------
 1375|  13.5M|		}
 1376|  9.94k|	}
 1377|       |	
 1378|  41.5k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    725|{
 1391|    725|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    725|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    725|	size_t itemNum;
 1394|    725|	size_t itemLim = array->children.size();
 1395|    725|	bool   hasDefault = false;
 1396|       |	
 1397|  8.44k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 8.03k, False: 417]
  ------------------
 1398|       |	
 1399|  8.03k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 8.03k]
  ------------------
 1400|  8.03k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 8.03k]
  ------------------
 1401|      0|			XMP_Throw ( "AltText array items must have an xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1402|      0|		}
 1403|       |
 1404|  8.03k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 308, False: 7.72k]
  ------------------
 1405|    308|			hasDefault = true;
 1406|    308|			break;
 1407|    308|		}
 1408|       |
 1409|  8.03k|	}
 1410|       |
 1411|    725|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 308, False: 417]
  ------------------
 1412|       |
 1413|    308|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 1, False: 307]
  ------------------
 1414|      1|			XMP_Node * temp = array->children[0];
 1415|      1|			array->children[0] = array->children[itemNum];
 1416|      1|			array->children[itemNum] = temp;
 1417|      1|		}
 1418|       |
 1419|       |// 09-Oct-07, ahu: disabled to avoid unexpected behaviour
 1420|       |//		if ( itemLim == 2 ) array->children[1]->value = array->children[0]->value;
 1421|       |
 1422|    308|	}
 1423|       |	
 1424|    725|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.79k|{
 1435|  1.79k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.79k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.79k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  11.2k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 10.4k, False: 794]
  ------------------
 1440|  10.4k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  10.4k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 862, False: 9.63k]
  |  Branch (1441:50): [True: 140, False: 9.49k]
  ------------------
 1442|  10.4k|	}
 1443|       |	
 1444|  1.79k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.72k, False: 69]
  |  Branch (1444:25): [True: 725, False: 1.00k]
  ------------------
 1445|    725|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    725|		NormalizeLangArray ( xmpParent );
 1447|    725|	}
 1448|       |
 1449|  1.79k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   187k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   187k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   187k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   187k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   187k|	if ( *schemaURI == 0 ) XMP_Throw ( "Schema namespace URI is required", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (160:7): [True: 0, False: 187k]
  ------------------
  161|       |
  162|   187k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 187k]
  |  Branch (162:29): [True: 0, False: 187k]
  ------------------
  163|      0|		XMP_Throw ( "Top level name must not be a qualifier", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  164|      0|	}
  165|  14.6M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 14.4M, False: 187k]
  ------------------
  166|  14.4M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 14.4M]
  |  Branch (166:24): [True: 0, False: 14.4M]
  ------------------
  167|      0|			XMP_Throw ( "Top level name must be simple", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  168|      0|		}
  169|  14.4M|	}
  170|       |
  171|   187k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   187k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 187k]
  ------------------
  173|      0|		XMP_Throw ( "Unregistered schema namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  174|      0|	}
  175|       |
  176|   187k|	XMP_StringPtr colonPos = propName;
  177|  9.73M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 9.73M, False: 244]
  |  Branch (177:30): [True: 9.54M, False: 187k]
  ------------------
  178|   187k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   187k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 244, False: 187k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|    244|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|    244|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|    244|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   187k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   187k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   187k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   187k|		XMP_VarString prefix ( propName, prefixLen );
  198|   187k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   187k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 187k]
  ------------------
  200|      0|			XMP_Throw ( "Unknown schema namespace prefix", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  201|      0|		}
  202|   187k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 20, False: 187k]
  ------------------
  203|     20|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     20|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   187k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   187k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   187k|	}
  210|       |
  211|   187k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|  72.1k|{
  220|  72.1k|	if ( qualName >= nameEnd ) XMP_Throw ( "Empty qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (220:7): [True: 0, False: 72.1k]
  ------------------
  221|       |
  222|  72.1k|	XMP_StringPtr colonPos = qualName;
  223|   312k|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 312k, False: 0]
  |  Branch (223:34): [True: 240k, False: 72.1k]
  ------------------
  224|  72.1k|	if ( (colonPos == qualName) || (colonPos >= nameEnd) ) XMP_Throw ( "Ill-formed qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (224:7): [True: 0, False: 72.1k]
  |  Branch (224:33): [True: 0, False: 72.1k]
  ------------------
  225|       |
  226|  72.1k|	VerifySimpleXMLName ( qualName, colonPos );
  227|  72.1k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|  72.1k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|  72.1k|	XMP_VarString prefix ( qualName, prefixLen );
  231|  72.1k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|  72.1k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 0, False: 72.1k]
  ------------------
  233|      0|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|  72.1k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   412k|{
  395|   412k|	XMP_Node * nextNode = 0;
  396|   412k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   412k|	XMP_Index      index    = 0;
  398|   412k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   412k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   412k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   412k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 216k, False: 195k]
  ------------------
  403|       |
  404|   216k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   216k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 43.5k, False: 152k]
  ------------------
  407|       |	
  408|  43.5k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|  43.5k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|  43.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|  43.5k|		++qualStep;
  411|  43.5k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   152k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   152k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 0, False: 152k]
  ------------------
  418|      0|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   152k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 152k, False: 0]
  ------------------
  422|   152k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   152k|		} else if ( stepKind == kXMP_ArrayLastStep ) {
  ------------------
  |  Branch (423:15): [True: 0, False: 0]
  ------------------
  424|      0|			index = parentNode->children.size() - 1;
  425|      0|		} else if ( stepKind == kXMP_FieldSelectorStep ) {
  ------------------
  |  Branch (425:15): [True: 0, False: 0]
  ------------------
  426|      0|			XMP_VarString fieldName, fieldValue;
  427|      0|			SplitNameAndValue ( nextStep.step, &fieldName, &fieldValue );
  428|      0|			index = LookupFieldSelector ( parentNode, fieldName.c_str(), fieldValue.c_str() );
  429|      0|		} else if ( stepKind == kXMP_QualSelectorStep ) {
  ------------------
  |  Branch (429:15): [True: 0, False: 0]
  ------------------
  430|      0|			XMP_VarString qualName, qualValue;
  431|      0|			SplitNameAndValue ( nextStep.step, &qualName, &qualValue );
  432|      0|			index = LookupQualSelector ( parentNode, qualName, qualValue );
  433|      0|		} else {
  434|      0|			XMP_Throw ( "Unknown array indexing step in FollowXPathStep", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  435|      0|		}
  436|       |		
  437|   152k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 152k, False: 0]
  |  Branch (437:24): [True: 152k, False: 0]
  ------------------
  438|       |
  439|   152k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 152k]
  |  Branch (439:25): [True: 0, False: 0]
  |  Branch (439:40): [True: 0, False: 0]
  |  Branch (439:60): [True: 0, False: 0]
  ------------------
  440|       |		
  441|       |			// An ugly special case without an obvious better place to be. We have an alias to the
  442|       |			// x-default item of an alt-text array. A simple reference via SetProperty must create
  443|       |			// the x-default item if it does not yet exist.
  444|       |			
  445|      0|			XMP_Assert ( parentNode->options & kXMP_PropArrayIsAltText );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  446|      0|			XMP_Assert ( (stepNum == 2) && (nextStep.step == "[?xml:lang=\"x-default\"]") );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  447|       |
  448|      0|			nextNode = new XMP_Node ( parentNode, kXMP_ArrayItemName,
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  449|      0|									  (kXMP_PropHasQualifiers | kXMP_PropHasLang | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  450|       |
  451|      0|			XMP_Node * langQual = new XMP_Node ( nextNode, "xml:lang", "x-default", kXMP_PropIsQualifier );
  452|      0|			nextNode->qualifiers.push_back ( langQual );
  453|       |
  454|      0|			if ( parentNode->children.empty() ) {
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  ------------------
  455|      0|				parentNode->children.push_back ( nextNode );
  456|      0|			} else {
  457|      0|				parentNode->children.insert ( parentNode->children.begin(), nextNode );
  458|      0|			}
  459|       |
  460|      0|			index = 0;	// ! C-style index! The x-default item is always first.
  461|       |
  462|      0|		}
  463|       |		
  464|   152k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 152k, False: 0]
  |  Branch (464:27): [True: 152k, False: 0]
  ------------------
  465|       |	
  466|   152k|	}
  467|       |
  468|   412k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   412k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 412k, False: 0]
  |  Branch (468:26): [True: 242, False: 411k]
  ------------------
  469|    242|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|    242|	}
  471|       |	
  472|   412k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   412k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   412k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   412k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   412k|	return nextNode;
  475|       |	
  476|   412k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   152k|{
  249|   152k|	XMP_Index index = 0;
  250|   152k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   152k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   152k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|   546k|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 394k, False: 152k]
  ------------------
  255|   394k|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|   394k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|   394k|		index = (index * 10) + (indexStep[chNum] - '0');
  257|   394k|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 394k]
  ------------------
  258|      0|			XMP_Throw ( "Array index overflow", kXMPErr_BadXPath );	// ! Overflow, not truly negative.
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  259|      0|		}
  260|   394k|	}
  261|       |
  262|   152k|	--index;	// Change to a C-style, zero based index.
  263|   152k|	if ( index < 0 ) XMP_Throw ( "Array index must be larger than zero", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (263:7): [True: 0, False: 152k]
  ------------------
  264|       |
  265|   152k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 0, False: 152k]
  |  Branch (265:59): [True: 0, False: 0]
  ------------------
  266|      0|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|      0|		arrayNode->children.push_back ( newItem );
  268|      0|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   152k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 152k]
  ------------------
  272|   152k|	return index;
  273|       |	
  274|   152k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|    242|{
  488|       |
  489|    242|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 0, False: 242]
  ------------------
  490|      0|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 0, False: 0]
  ------------------
  491|      0|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|      0|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 0, False: 0]
  ------------------
  492|       |
  493|      0|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      0|	}
  496|       |
  497|    242|}	// CheckImplicitStruct

_ZN13XMP_AutoMutexC2Ev:
  222|   307k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   307k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   307k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|  73.3k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 73.3k, False: 233k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   233k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   375k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   224k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|  28.8k|		: options(_options), name(_name), parent(_parent)
  435|  28.8k|	{
  436|       |		#if XMP_DebugBuild
  437|       |			XMP_Assert ( (name.find ( ':' ) != XMP_VarString::npos) || (name == kXMP_ArrayItemName) ||
  438|       |			             (options & kXMP_SchemaNode) || (parent == 0) );
  439|       |			// *** _namePtr  = name.c_str();
  440|       |			// *** _valuePtr = value.c_str();
  441|       |		#endif
  442|  28.8k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   161k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   161k|	{
  458|       |		#if XMP_DebugBuild
  459|       |			XMP_Assert ( (name.find ( ':' ) != XMP_VarString::npos) || (name == kXMP_ArrayItemName) ||
  460|       |			             (options & kXMP_SchemaNode) || (parent == 0) );
  461|       |			// *** _namePtr  = name.c_str();
  462|       |			// *** _valuePtr = value.c_str();
  463|       |		#endif
  464|   161k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  44.4k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  44.4k|	{
  469|       |		#if XMP_DebugBuild
  470|       |			XMP_Assert ( (name.find ( ':' ) != XMP_VarString::npos) || (name == kXMP_ArrayItemName) ||
  471|       |			             (options & kXMP_SchemaNode) || (parent == 0) );
  472|       |			// *** _namePtr  = name.c_str();
  473|       |			// *** _valuePtr = value.c_str();
  474|       |		#endif
  475|  44.4k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   248k|	{
  479|   424k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 176k, False: 248k]
  ------------------
  480|   176k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 176k, False: 0]
  ------------------
  481|   176k|		}
  482|   248k|		children.clear();
  483|   248k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   248k|	{
  487|   294k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 45.5k, False: 248k]
  ------------------
  488|  45.5k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 45.5k, False: 0]
  ------------------
  489|  45.5k|		}
  490|   248k|		qualifiers.clear();
  491|   248k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  14.0k|	{
  495|  14.0k|		options = 0;
  496|  14.0k|		name.erase();
  497|  14.0k|		value.erase();
  498|  14.0k|		this->RemoveChildren();
  499|  14.0k|		this->RemoveQualifiers();
  500|  14.0k|	}
_ZN8XMP_NodeD2Ev:
  502|   234k|	virtual ~XMP_Node() { RemoveChildren(); RemoveQualifiers(); };

_ZN11XMPIterator10InitializeEv:
  376|      1|{
  377|      1|	sDummySchema = new XMP_Node ( 0, "dummy:schema/", kXMP_SchemaNode);
  378|      1|	return true;
  379|       |	
  380|      1|}	// Initialize
_ZN11XMPIterator9TerminateEv:
  388|      1|{
  389|      1|	delete ( sDummySchema );
  390|      1|	sDummySchema = 0;
  391|      1|	return;
  392|       |	
  393|      1|}	// Terminate
_ZN11XMPIteratorC2ERK7XMPMetaPKcS4_j:
  427|  12.2k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  12.2k|{
  429|  12.2k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 12.2k]
  ------------------
  430|      0|		XMP_Throw ( "Unsupported iteration kind", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  431|      0|	}
  432|       |	
  433|       |	// *** Lock the XMPMeta object if we ever stop using a full DLL lock.
  434|       |
  435|  12.2k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 3.75k, False: 8.51k]
  ------------------
  436|       |
  437|       |		// An iterator rooted at a specific node.
  438|       |
  439|       |		#if TraceIterators
  440|       |			printf ( "\nNew XMP property iterator for \"%s\", options = %X\n    Schema = %s, root = %s\n",
  441|       |			         xmpObj.tree.name.c_str(), options, schemaNS, propName );
  442|       |		#endif
  443|       |		
  444|  3.75k|		XMP_ExpandedXPath propPath;
  445|  3.75k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  3.75k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  3.75k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.75k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  3.75k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 3.75k, False: 0]
  ------------------
  449|       |
  450|  3.75k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  3.75k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 0, False: 3.75k]
  ------------------
  452|      0|				XMP_OptionBits stepKind = GetStepKind ( propPath[i].options );
  ------------------
  |  |  408|      0|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  453|      0|				if ( stepKind <= kXMP_QualifierStep ) rootName += '/';
  ------------------
  |  Branch (453:10): [True: 0, False: 0]
  ------------------
  454|      0|				rootName += propPath[i].step;
  455|      0|			}
  456|       |
  457|  3.75k|			propName = rootName.c_str();
  458|  3.75k|			size_t leafOffset = rootName.size();
  459|  58.7k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 55.0k, False: 3.75k]
  |  Branch (459:32): [True: 55.0k, False: 0]
  |  Branch (459:65): [True: 55.0k, False: 0]
  ------------------
  460|  3.75k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 0, False: 3.75k]
  ------------------
  461|       |
  462|  3.75k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  3.75k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  3.75k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 3.75k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  3.75k|		}
  469|       |	
  470|  8.51k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 8.51k]
  ------------------
  471|       |
  472|       |		// An iterator for all properties in one schema.
  473|       |		
  474|       |		#if TraceIterators
  475|       |			printf ( "\nNew XMP schema iterator for \"%s\", options = %X\n    Schema = %s\n",
  476|       |			         xmpObj.tree.name.c_str(), options, schemaNS );
  477|       |		#endif
  478|       |		
  479|      0|		info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaNS, 0 ) );
  480|      0|		IterNode & iterSchema = info.tree.children.back();
  481|       |		
  482|      0|		XMP_Node * xmpSchema = FindConstSchema ( &xmpObj.tree, schemaNS );
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  483|      0|		if ( xmpSchema != 0 ) AddSchemaProps ( info, iterSchema, xmpSchema );
  ------------------
  |  Branch (483:8): [True: 0, False: 0]
  ------------------
  484|       |		
  485|      0|		if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, schemaNS );
  ------------------
  |  Branch (485:8): [True: 0, False: 0]
  ------------------
  486|       |		
  487|      0|		if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (487:8): [True: 0, False: 0]
  ------------------
  488|      0|			info.tree.children.pop_back();	// No properties, remove the schema node.
  489|      0|		} else {
  490|      0|			SetCurrSchema ( info, schemaNS );
  491|      0|		}
  492|       |	
  493|  8.51k|	} else {
  494|       |
  495|       |		// An iterator for all properties in all schema. First add schema that exist (have children),
  496|       |		// adding aliases from them if appropriate. Then add schema that have no actual properties
  497|       |		// but do have aliases to existing properties, if we're including aliases in the iteration.
  498|       |		
  499|       |		#if TraceIterators
  500|       |			printf ( "\nNew XMP tree iterator for \"%s\", options = %X\n",
  501|       |			         xmpObj.tree.name.c_str(), options );
  502|       |		#endif
  503|       |		
  504|       |		// First pick up the schema that exist.
  505|       |		
  506|  22.0k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 13.5k, False: 8.51k]
  ------------------
  507|       |
  508|  13.5k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  13.5k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  13.5k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  13.5k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 13.5k, False: 0]
  ------------------
  513|  13.5k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  13.5k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 13.5k]
  ------------------
  515|  13.5k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 13.5k]
  ------------------
  516|  13.5k|			}
  517|       |
  518|  13.5k|		}
  519|       |		
  520|  8.51k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 8.51k]
  ------------------
  521|       |
  522|       |			// Add the schema that only have aliases. The most convenient, and safest way, is to go
  523|       |			// through the registered namespaces, see if it exists, and let AddSchemaAliases do its
  524|       |			// thing if not. Don't combine with the above loop, it is nicer to have the "real" stuff
  525|       |			// be in storage order (not subject to the namespace map order).
  526|       |			
  527|       |			// ! We don't do the kXMP_IterJustChildren handing in the same way here as above. The
  528|       |			// ! existing schema (presumably) have actual children. We need to call AddSchemaAliases
  529|       |			// ! here to determine if the namespace has any aliases to existing properties. We then
  530|       |			// ! strip the children if necessary.
  531|       |
  532|      0|			XMP_cStringMapPos currNS = sNamespaceURIToPrefixMap->begin();
  533|      0|			XMP_cStringMapPos endNS  = sNamespaceURIToPrefixMap->end();
  534|      0|			for ( ; currNS != endNS; ++currNS ) {
  ------------------
  |  Branch (534:12): [True: 0, False: 0]
  ------------------
  535|      0|				XMP_StringPtr schemaName = currNS->first.c_str();
  536|      0|				if ( FindConstSchema ( &xmpObj.tree, schemaName ) != 0 ) continue;
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  |  Branch (536:10): [True: 0, False: 0]
  ------------------
  537|      0|				info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaName, 0 ) );
  538|      0|				IterNode & iterSchema = info.tree.children.back();
  539|      0|				AddSchemaAliases ( info, iterSchema, schemaName );
  540|      0|				if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (540:10): [True: 0, False: 0]
  ------------------
  541|      0|					info.tree.children.pop_back();	// No aliases, remove the schema node.
  542|      0|				} else if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|					iterSchema.children.clear();	// Get rid of the children.
  544|      0|				}
  545|      0|			}
  546|       |
  547|      0|		}
  548|       |
  549|  8.51k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  12.2k|	info.currPos = info.tree.children.begin();
  554|  12.2k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  12.2k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 12.2k]
  |  Branch (556:49): [True: 0, False: 0]
  |  Branch (556:82): [True: 0, False: 0]
  ------------------
  557|      0|		info.currPos->visitStage = kIter_VisitSelf;
  558|      0|	}
  559|       |
  560|       |	#if TraceIterators
  561|       |		if ( info.currPos == info.endPos ) {
  562|       |			printf ( "    ** Empty iteration **\n" );
  563|       |		} else {
  564|       |			printf ( "    Initial node %s, stage = %s, iterator @ %.8X\n",
  565|       |			         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage], this );
  566|       |		}
  567|       |	#endif
  568|       |	
  569|  12.2k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  12.2k|{
  592|  12.2k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  12.2k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   204k|{
  618|       |	// *** Lock the XMPMeta object if we ever stop using a full DLL lock.
  619|       |	
  620|       |	// ! NOTE: Supporting aliases throws in some nastiness with schemas. There might not be any XMP
  621|       |	// ! node for the schema, but we still have to visit it because of possible aliases.
  622|       |	
  623|   204k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 2.13k, False: 202k]
  ------------------
  624|       |	
  625|       |	#if TraceIterators
  626|       |		printf ( "Next iteration from %s, stage = %s, iterator @ %.8X\n",
  627|       |			     info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage], this );
  628|       |	#endif
  629|       |	
  630|   202k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   202k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 9.08k, False: 193k]
  ------------------
  632|   193k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   193k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 193k]
  ------------------
  635|      0|		while ( isSchemaNode || (! xmpNode->children.empty()) ) {
  ------------------
  |  Branch (635:11): [True: 0, False: 0]
  |  Branch (635:27): [True: 0, False: 0]
  ------------------
  636|      0|			info.currPos->visitStage = kIter_VisitQualifiers;	// Skip to this node's children.
  637|      0|			xmpNode = GetNextXMPNode ( info );
  638|      0|			if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (638:9): [True: 0, False: 0]
  ------------------
  639|      0|			isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  640|      0|		}
  641|      0|	}
  642|       |	
  643|   193k|	*schemaNS = info.currSchema.c_str();
  644|   193k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   193k|	*propOptions = info.currPos->options;
  647|       |
  648|   193k|	*propPath  = "";
  649|   193k|	*pathSize  = 0;
  650|   193k|	*propValue = "";
  651|   193k|	*valueSize = 0;
  652|       |	
  653|   193k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 180k, False: 13.4k]
  ------------------
  654|       |
  655|   180k|		*propPath = info.currPos->fullPath.c_str();
  656|   180k|		*pathSize = info.currPos->fullPath.size();
  657|   180k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 180k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   180k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 150k, False: 30.1k]
  ------------------
  663|   150k|			*propValue = xmpNode->value.c_str();
  664|   150k|			*valueSize = xmpNode->value.size();
  665|   150k|		}
  666|       |
  667|   180k|	}
  668|       |	
  669|       |	#if TraceIterators
  670|       |		printf ( "    Next node %s, stage = %s\n",
  671|       |			     info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage] );
  672|       |	#endif
  673|       |	
  674|   193k|	return true;
  675|       |
  676|   193k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   193k|{
  730|   193k|	UNUSED(options);
  731|       |
  732|   193k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   193k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  3.75k|{
  182|       |
  183|  3.75k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  3.75k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   180k|{
  115|   180k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   180k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   180k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 41.2k, False: 138k]
  |  Branch (118:44): [True: 41.2k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  41.2k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  41.2k|		leafOffset += 2;
  126|       |		
  127|  85.2k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 43.9k, False: 41.2k]
  ------------------
  128|  43.9k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  43.9k|			currPath += xmpQual->name;
  130|  43.9k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  43.9k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  43.9k|		}
  136|       |		
  137|  41.2k|		leafOffset -= 2;
  138|  41.2k|		currPath.erase ( leafOffset );
  139|       |
  140|  41.2k|	}
  141|       |
  142|   180k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 29.9k, False: 150k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  29.9k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  29.9k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  29.9k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 21.7k, False: 8.24k]
  ------------------
  151|  21.7k|			currPath += '/';
  152|  21.7k|			leafOffset += 1;
  153|  21.7k|		}
  154|       |		
  155|   186k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 156k, False: 29.9k]
  ------------------
  156|   156k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   156k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 30.0k, False: 126k]
  ------------------
  158|  30.0k|				currPath += xmpChild->name;
  159|   126k|			} else {
  160|   126k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|   126k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|   126k|				currPath += buffer;
  163|   126k|			}
  164|   156k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   156k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   156k|		}
  170|       |	
  171|  29.9k|	}
  172|       |
  173|   180k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  13.5k|{
   49|  13.5k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  37.6k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 24.1k, False: 13.5k]
  ------------------
   55|  24.1k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  24.1k|		iterSchema.children.push_back ( IterNode ( xmpProp->options, xmpProp->name, 0 ) );
   58|       |		#if TraceIterators
   59|       |			printf ( "        %s\n", xmpProp->name.c_str() );
   60|       |		#endif
   61|  24.1k|	}
   62|       |
   63|  13.5k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   202k|{
  309|   202k|	const XMP_Node * xmpNode = 0;
  310|       |
  311|       |	// ----------------------------------------------------------------------------------------------
  312|       |	// On entry currPos points to an iteration node whose state is either before-visit or visit-self.
  313|       |	// If it is before-visit then we will return that node's value part now. If it is visit-self it
  314|       |	// means the previous iteration returned the value portion of that node, so we can advance to the
  315|       |	// next node in the iteration tree. Then we find the corresponding XMP node, allowing for the XMP
  316|       |	// tree to have been modified since that part of the iteration tree was constructed.
  317|       |	
  318|       |	// ! NOTE: Supporting aliases throws in some nastiness with schemas. There might not be any XMP
  319|       |	// ! node for the schema, but we still have to visit it because of possible aliases. The static
  320|       |	// ! sDummySchema is returned if there is no real schema node.
  321|       |
  322|   202k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 192k, False: 10.1k]
  ------------------
  323|       |	
  324|   202k|	bool isSchemaNode = false;
  325|   202k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   202k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 193k, False: 9.10k]
  ------------------
  328|       |
  329|   193k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   193k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 13.4k, False: 180k]
  ------------------
  331|  13.4k|			SetCurrSchema ( info, info.currPos->fullPath );
  332|  13.4k|			xmpNode = FindConstSchema ( &info.xmpObj->tree, info.currPos->fullPath.c_str() );
  ------------------
  |  |  298|  13.4k|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  13.4k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  333|  13.4k|			if ( xmpNode == 0 ) xmpNode = sDummySchema;
  ------------------
  |  Branch (333:9): [True: 0, False: 13.4k]
  ------------------
  334|   180k|		} else {
  335|   180k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   180k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   180k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   180k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   180k|		}
  338|   193k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 193k, False: 20]
  ------------------
  339|       |
  340|     20|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|     20|		info.currPos->children.clear();
  342|     20|		info.currPos->qualifiers.clear();
  343|     20|		AdvanceIterPos ( info );
  344|       |
  345|     20|	}
  346|       |
  347|   202k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 9.08k, False: 193k]
  ------------------
  348|       |	
  349|       |	// -------------------------------------------------------------------------------------------
  350|       |	// Now we've got the iteration node and corresponding XMP node. Add the iteration children for
  351|       |	// structs and arrays. The children of schema were added when the iterator was constructed.
  352|       |
  353|   193k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   193k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   193k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 193k, False: 20]
  ------------------
  356|   193k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 180k, False: 13.4k]
  |  Branch (356:28): [True: 180k, False: 0]
  ------------------
  357|   180k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   180k|		}
  359|   193k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   193k|	}
  361|       |	
  362|   193k|	return xmpNode;
  363|       |
  364|   202k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  20.5k|{
  193|       |
  194|  20.5k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  20.5k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   192k|{
  213|       |	// -------------------------------------------------------------------------------------------
  214|       |	// Keep looking until we find a node to visit or the end of everything. The first time through
  215|       |	// the current node will exist, we just visited it. But we have to keep looking if the current
  216|       |	// node was the last of its siblings or is an empty schema.
  217|       |	
  218|       |	// ! It is possible that info.currPos == info.endPos on entry. Don't dereference info.currPos yet!
  219|       |
  220|   466k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 466k, Folded]
  ------------------
  221|       |	
  222|   466k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 91.7k, False: 375k]
  ------------------
  223|       |		
  224|       |			// ------------------------------------------------------------------------------------
  225|       |			// At the end of a set of siblings, move up to an ancestor. We've either just finished
  226|       |			// the qualifiers and will move to the children, or have just finished the children and
  227|       |			// will move on to the next sibling.
  228|       |			
  229|  91.7k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 9.08k, False: 82.6k]
  ------------------
  230|       |
  231|  82.6k|			IterPosPair & parent = info.ancestors.back();
  232|  82.6k|			info.currPos = parent.first;
  233|  82.6k|			info.endPos  = parent.second;
  234|  82.6k|			info.ancestors.pop_back();
  235|       |			
  236|       |			#if TraceIterators
  237|       |				printf ( "    Moved up to %s, stage = %s\n",
  238|       |				         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage] );
  239|       |			#endif
  240|       |		
  241|   375k|		} else {
  242|       |			
  243|       |			// -------------------------------------------------------------------------------------------
  244|       |			// Decide what to do with this iteration node based on its state. Don't use a switch statement,
  245|       |			// some of the cases want to break from the loop. A break in a switch just exits the case.
  246|       |			
  247|       |			#if TraceIterators
  248|       |				printf ( "    Moving from %s, stage = %s\n",
  249|       |				         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage] );
  250|       |			#endif
  251|       |			
  252|   375k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 99.8k, False: 275k]
  ------------------
  253|  99.8k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 7.07k, False: 92.7k]
  ------------------
  254|  99.8k|				break;
  255|  99.8k|			}
  256|       |
  257|   275k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 192k, False: 82.6k]
  ------------------
  258|   192k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   192k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 40.9k, False: 151k]
  ------------------
  260|  40.9k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  40.9k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  40.9k|					info.currPos = info.currPos->qualifiers.begin();
  263|  40.9k|					break;
  264|  40.9k|				}
  265|   192k|			}
  266|       |
  267|   234k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 192k, False: 41.6k]
  ------------------
  268|   192k|				info.currPos->qualifiers.clear();
  269|   192k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   192k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 42.7k, False: 149k]
  ------------------
  271|  42.7k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  42.7k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  42.7k|					info.currPos = info.currPos->children.begin();
  274|  42.7k|					break;
  275|  42.7k|				}
  276|   192k|			}
  277|       |
  278|   191k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 191k, False: 0]
  ------------------
  279|   191k|				info.currPos->children.clear();
  280|   191k|				++info.currPos;											// Move to the next sibling.
  281|   191k|				continue;
  282|   191k|			}
  283|       |			
  284|       |			#if TraceIterators
  285|       |				if ( info.currPos != info.endPos ) {
  286|       |					printf ( "    Moved to %s, stage = %s\n",
  287|       |					         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage] );
  288|       |				}
  289|       |			#endif
  290|       |			
  291|   191k|		}
  292|       |
  293|   466k|	}	// Loop to find the next node.
  294|       |	
  295|   192k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   192k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   192k|}	// AdvanceIterPos

_ZN8IterNodeC2Ev:
   43|  12.2k|	IterNode() : options(0), leafOffset(0), visitStage(kIter_BeforeVisit)
   44|  12.2k|	{
   45|       |		#if 0	// *** XMP_DebugBuild
   46|       |			_pathPtr = _leafPtr = 0;
   47|       |		#endif
   48|  12.2k|	};
_ZN8IterNodeC2EjRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
   51|   241k|			 : options(_options), fullPath(_fullPath), leafOffset(_leafOffset), visitStage(kIter_BeforeVisit)
   52|   241k|	{
   53|       |		#if 0	// *** XMP_DebugBuild
   54|       |			_pathPtr = fullPath.c_str();
   55|       |			_leafPtr = _pathPtr + leafOffset;
   56|       |		#endif
   57|   241k|	};
_ZN8IterInfoC2EjPK7XMPMeta:
   80|  12.2k|	IterInfo ( XMP_OptionBits _options, const XMPMeta * _xmpObj ) : options(_options), xmpObj(_xmpObj)
   81|  12.2k|	{
   82|       |		#if 0	// *** XMP_DebugBuild
   83|       |			_schemaPtr = 0;
   84|       |		#endif
   85|  12.2k|	};

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  11.2k|{
 1097|  11.2k|	if ( (buffer == 0) && (xmpSize != 0) ) XMP_Throw ( "Null parse buffer", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1097:7): [True: 0, False: 11.2k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  11.2k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 11.2k]
  ------------------
 1099|       |	
 1100|  11.2k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  11.2k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  11.2k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 11.2k, False: 0]
  ------------------
 1105|  11.2k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 11.2k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  11.2k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  11.2k|	}
 1108|       |	
 1109|  11.2k|	XMLParserAdapter& parser = *this->xmlParser;
 1110|       |	
 1111|       |	#if 0	// XMP_DebugBuild
 1112|       |		if ( parser.parseLog != 0 ) {
 1113|       |			char message [200];	// AUDIT: Using sizeof(message) below for snprintf length is safe.
 1114|       |			snprintf ( message, sizeof(message), "<!-- ParseFromBuffer, length = %d, options = %X%s -->",	// AUDIT: See above.
 1115|       |					   xmpSize, options, (lastClientCall ? " (last)" : "") );
 1116|       |			fwrite ( message, 1, strlen(message), parser.parseLog );
 1117|       |			fflush ( parser.parseLog );
 1118|       |		}
 1119|       |	#endif
 1120|       |		
 1121|  11.2k|	try {	// Cleanup the tree and xmlParser if anything fails.
 1122|       |	
 1123|       |		// Determine the character encoding before doing any real parsing. This is needed to do the
 1124|       |		// 8-bit special processing.
 1125|       |		
 1126|  11.2k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 11.2k, False: 0]
  ------------------
 1127|       |
 1128|  11.2k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 11.2k, False: 0]
  |  Branch (1128:39): [True: 11.2k, False: 36]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  11.2k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  11.2k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     36|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     36|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 36, False: 0]
  ------------------
 1139|       |
 1140|     36|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     36|				buffer += pendingOverlap;
 1142|     36|				xmpSize -= pendingOverlap;
 1143|     36|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     36|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 36]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     36|				parser.charEncoding = DetermineInputEncoding ( parser.pendingInput, parser.pendingCount );
 1147|       |				
 1148|       |				#if Trace_ParsingHackery
 1149|       |					fprintf ( stderr, "XMP Character encoding is %d\n", parser.charEncoding );
 1150|       |				#endif
 1151|       |			
 1152|     36|			}
 1153|       |
 1154|  11.2k|		}
 1155|       |		
 1156|       |		// We have the character encoding. Process UTF-16 and UTF-32 as is. UTF-8 needs special
 1157|       |		// handling to take care of things like ISO Latin-1 or unescaped ASCII controls.
 1158|       |
 1159|  11.2k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  11.2k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 11.2k]
  ------------------
 1162|       |		
 1163|      0|			if ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|       |				// Might have pendingInput from the above portion to determine the character encoding.
 1165|      0|				parser.ParseBuffer ( parser.pendingInput, parser.pendingCount, false );
 1166|      0|			}
 1167|      0|			parser.ParseBuffer ( buffer, xmpSize, lastClientCall );
 1168|       |			
 1169|  11.2k|		} else {
 1170|       |
 1171|       |			#if Trace_ParsingHackery
 1172|       |				fprintf ( stderr, "Parsing %d bytes @ %.8X, %s, %d pending, context: %.8s\n",
 1173|       |						  xmpSize, buffer, (lastClientCall ? "last" : "not last"), parser.pendingCount, buffer );
 1174|       |			#endif
 1175|       |
 1176|       |			// The UTF-8 processing is a bit complex due to the need to tolerate ISO Latin-1 input.
 1177|       |			// This is done by scanning the input for byte sequences that are not valid UTF-8,
 1178|       |			// assuming they are Latin-1 characters in the range 0x80..0xFF. This requires saving a
 1179|       |			// pending input buffer to handle partial UTF-8 sequences at the end of a buffer.
 1180|       |			
 1181|  11.3k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 36, False: 11.2k]
  ------------------
 1182|       |			
 1183|       |				// We've got some leftover input, process it first then continue with the current
 1184|       |				// buffer. Try to fill the pendingInput buffer before parsing further. We use a loop
 1185|       |				// for weird edge cases like a 2 byte input buffer, using 1 byte for pendingInput,
 1186|       |				// then having a partial UTF-8 end and need to absorb more.
 1187|       |				
 1188|     36|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     36|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 36, False: 0]
  ------------------
 1190|       |				
 1191|     36|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     36|				parser.pendingCount += pendingOverlap;
 1193|     36|				buffer += pendingOverlap;
 1194|     36|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     36|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 36]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     36|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     36|				size_t bytesLeft = parser.pendingCount - bytesDone;
 1199|       |
 1200|       |				#if Trace_ParsingHackery
 1201|       |					fprintf ( stderr, "   ProcessUTF8Portion handled %d pending bytes\n", bytesDone );
 1202|       |				#endif
 1203|       |				
 1204|     36|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 36, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     36|					parser.pendingCount = 0;
 1208|       |
 1209|     36|				} else if ( bytesLeft <= pendingOverlap ) {
  ------------------
  |  Branch (1209:17): [True: 0, False: 0]
  ------------------
 1210|       |
 1211|       |					// The leftover pending input all came from the current buffer. Exit this loop.
 1212|      0|					buffer -= bytesLeft;
 1213|      0|					xmpSize += bytesLeft;
 1214|      0|					parser.pendingCount = 0;
 1215|       |
 1216|      0|				} else if ( xmpSize > 0 ) {
  ------------------
  |  Branch (1216:17): [True: 0, False: 0]
  ------------------
 1217|       |
 1218|       |					// Pull more of the current buffer into the pending input and try again.
 1219|       |					// Backup by this pass's overlap so the loop entry code runs OK.
 1220|      0|					parser.pendingCount -= pendingOverlap;
 1221|      0|					buffer -= pendingOverlap;
 1222|      0|					xmpSize += pendingOverlap;
 1223|       |
 1224|      0|				} else {
 1225|       |
 1226|       |					// There is no more of the current buffer. Wait for more. Partial sequences at
 1227|       |					// the end of the last buffer should be treated as Latin-1 by ProcessUTF8Portion.
 1228|      0|					XMP_Assert ( ! lastClientCall );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1229|      0|					parser.pendingCount = bytesLeft;
 1230|      0|					memcpy ( &parser.pendingInput[0], &parser.pendingInput[bytesDone], bytesLeft );	// AUDIT: Count is safe.
 1231|      0|					return;
 1232|       |
 1233|      0|				}
 1234|       |			
 1235|     36|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  11.2k|			size_t bytesDone = ProcessUTF8Portion ( &parser, (XMP_Uns8*)buffer, xmpSize, lastClientCall );
 1240|       |
 1241|       |			#if Trace_ParsingHackery
 1242|       |				fprintf ( stderr, "   ProcessUTF8Portion handled %d additional bytes\n", bytesDone );
 1243|       |			#endif
 1244|       |			
 1245|  11.2k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 11.2k]
  ------------------
 1246|       |
 1247|      0|				XMP_Assert ( ! lastClientCall );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1248|      0|				size_t bytesLeft = xmpSize - bytesDone;
 1249|      0|				if ( bytesLeft > kXMLPendingInputMax ) XMP_Throw ( "Parser bytesLeft too large", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1249:10): [True: 0, False: 0]
  ------------------
 1250|       |
 1251|      0|				memcpy ( parser.pendingInput, &buffer[bytesDone], bytesLeft );	// AUDIT: Count is safe.
 1252|      0|				parser.pendingCount = bytesLeft;
 1253|      0|				return;	// Wait for the next buffer.
 1254|       |
 1255|      0|			}
 1256|       |
 1257|  11.2k|		}
 1258|       |		
 1259|  11.2k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 11.2k, False: 36]
  ------------------
 1260|       |		
 1261|       |			#if XMP_DebugBuild && DumpXMLParseTree
 1262|       |				if ( parser.parseLog == 0 ) parser.parseLog = stdout;
 1263|       |				DumpXMLTree ( parser.parseLog, parser.tree, 0 );
 1264|       |			#endif
 1265|       |
 1266|  11.2k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  11.2k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 9.50k, False: 1.74k]
  ------------------
 1269|       |
 1270|  9.50k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  9.50k|				NormalizeDCArrays ( &this->tree );
 1272|  9.50k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 9.50k]
  ------------------
 1273|  9.50k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  9.50k|				size_t schemaNum = 0;
 1277|  23.0k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 13.5k, False: 9.50k]
  ------------------
 1278|  13.5k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  13.5k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 13.5k, False: 0]
  ------------------
 1280|  13.5k|						++schemaNum;
 1281|  13.5k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  13.5k|				}
 1286|       |				
 1287|  9.50k|			}
 1288|       |
 1289|  11.2k|			delete this->xmlParser;
 1290|  11.2k|			this->xmlParser = 0;
 1291|       |
 1292|  11.2k|		}
 1293|       |		
 1294|  11.2k|	} catch ( ... ) {
 1295|       |
 1296|  2.77k|		delete this->xmlParser;
 1297|  2.77k|		this->xmlParser = 0;
 1298|  2.77k|		prevTkVer = 0;
 1299|  2.77k|		this->tree.ClearNode();
 1300|  2.77k|		throw;
 1301|       |
 1302|  2.77k|	}
 1303|       |	
 1304|  11.2k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  11.2k|{
  811|  11.2k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 11.2k]
  ------------------
  812|       |	
  813|  11.2k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  11.2k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 11.2k]
  ------------------
  816|       |	
  817|       |		// These cases are:
  818|       |		//   00 nn -- -- - Big endian UTF-16
  819|       |		//   00 00 00 nn - Big endian UTF-32
  820|       |		//   00 00 FE FF - Big endian UTF 32
  821|       |
  822|      0|		if ( (length < 4) || (uniChar[1] != 0) ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (822:8): [True: 0, False: 0]
  |  Branch (822:24): [True: 0, False: 0]
  ------------------
  823|      0|		return kXMP_EncodeUTF32Big;
  824|       |		
  825|  11.2k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 11.2k, False: 0]
  ------------------
  826|       |	
  827|       |		// These cases are:
  828|       |		//   nn mm -- -- - UTF-8, includes EF BB BF case
  829|       |		//   nn 00 00 00 - Little endian UTF-32
  830|       |		//   nn 00 -- -- - Little endian UTF-16
  831|       |
  832|  11.2k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 11.2k, False: 0]
  ------------------
  833|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (833:8): [True: 0, False: 0]
  |  Branch (833:24): [True: 0, False: 0]
  ------------------
  834|      0|		return kXMP_EncodeUTF32Little;
  835|       |
  836|      0|	} else {
  837|       |	
  838|       |		// These cases are:
  839|       |		//   EF BB BF -- - UTF-8
  840|       |		//   FE FF -- -- - Big endian UTF-16
  841|       |		//   FF FE 00 00 - Little endian UTF-32
  842|       |		//   FF FE -- -- - Little endian UTF-16
  843|       |
  844|      0|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 0, False: 0]
  ------------------
  845|      0|		if ( uniChar[0] == 0xFE ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (845:8): [True: 0, False: 0]
  ------------------
  846|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (846:8): [True: 0, False: 0]
  |  Branch (846:24): [True: 0, False: 0]
  ------------------
  847|      0|		return kXMP_EncodeUTF32Little;
  848|       |
  849|      0|	}
  850|       |		
  851|  11.2k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  11.3k|{
  977|  11.3k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  11.3k|	const XMP_Uns8 * spanEnd;
  980|       |
  981|       |	// `buffer` is copied into this std::string. If `buffer` only
  982|       |	// contains valid UTF-8 and no escape characters, then the copy
  983|       |	// will be identical to the original, but invalid characters are
  984|       |	// replaced - usually with a space character.  This std::string was
  985|       |	// added as a performance fix for:
  986|       |	// https://github.com/Exiv2/exiv2/security/advisories/GHSA-w8mv-g8qq-36mj
  987|       |	// Previously, the code was repeatedly calling
  988|       |	// `xmlParser->ParseBuffer()`, which turned out to have quadratic
  989|       |	// complexity, because expat kept reparsing the entire string from
  990|       |	// the beginning.
  991|  11.3k|	std::string copy;
  992|       |		
  993|  69.5M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 69.5M, False: 11.3k]
  ------------------
  994|       |
  995|  69.5M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 69.2M, False: 292k]
  |  Branch (995:30): [True: 68.9M, False: 338k]
  |  Branch (995:52): [True: 67.5M, False: 1.31M]
  ------------------
  996|  67.5M|			copy.push_back(*spanEnd);
  997|  67.5M|			continue;	// A regular ASCII character.
  998|  67.5M|		}
  999|       |
 1000|  1.94M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 14.3k, False: 1.93M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  14.3k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  14.3k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 14.3k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  14.3k|				copy.append((const char*)spanEnd, uniLen);
 1010|  14.3k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  14.3k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|  1.93M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 292k, False: 1.64M]
  |  Branch (1026:36): [True: 323k, False: 1.31M]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   616k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   616k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   612k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   344k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 4.30k, False: 612k]
  |  Branch (1030:31): [True: 268k, False: 344k]
  |  Branch (1030:52): [True: 20.5k, False: 323k]
  ------------------
 1031|   292k|				copy.push_back(*spanEnd);
 1032|   292k|				continue;
 1033|   292k|			}
 1034|       |
 1035|   323k|			copy.push_back(' ');
 1036|       |		
 1037|  1.31M|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|  1.31M|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|  1.31M|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|  1.31M|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|  1.31M|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 62, False: 1.31M]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     62|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 62, False: 0]
  ------------------
 1048|     62|					copy.push_back('&');
 1049|     62|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     62|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|  1.31M|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 66.4k, False: 1.25M]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  66.4k|				copy.push_back(' ');
 1058|  66.4k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|  1.25M|			} else {
 1061|  1.25M|				copy.push_back('&');
 1062|  1.25M|			}
 1063|       |
 1064|  1.31M|		}
 1065|       |		
 1066|  1.94M|	}
 1067|       |	
 1068|  11.3k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  11.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  11.3k|	copy.push_back(' ');
 1070|  11.3k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  11.3k|	return length;
 1072|       |
 1073|  11.3k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  14.3k|{
  868|  14.3k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  14.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  14.3k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 14.3k]
  ------------------
  870|  14.3k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 14.3k]
  ------------------
  871|       |	
  872|  14.3k|	int byteCount = 2;
  873|  14.3k|	XMP_Uns8 firstByte = *charStart;
  874|  19.1k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 4.80k, False: 14.3k]
  ------------------
  875|       |	
  876|  14.3k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 14.3k]
  ------------------
  877|       |
  878|  33.5k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 19.1k, False: 14.3k]
  ------------------
  879|  19.1k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 19.1k]
  ------------------
  880|  19.1k|	}
  881|       |	
  882|  14.3k|	return byteCount;
  883|       |	
  884|  14.3k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|  1.31M|{
  898|  1.31M|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|  1.31M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|  1.31M|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 1.31M]
  ------------------
  900|  1.31M|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|  1.31M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|  1.31M|	size_t tailLen = bufEnd - escStart;
  903|  1.31M|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 62, False: 1.31M]
  ------------------
  904|       |	
  905|  1.31M|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 1.00M, False: 317k]
  ------------------
  906|       |	
  907|   317k|	XMP_Uns8 escValue = 0;
  908|   317k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   317k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 305k, False: 11.7k]
  |  Branch (910:27): [True: 1.79k, False: 303k]
  ------------------
  911|  1.79k|		escValue = *escPos - '0';
  912|  1.79k|		++escPos;
  913|   315k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 298k, False: 16.6k]
  |  Branch (913:34): [True: 2.32k, False: 296k]
  ------------------
  914|  2.32k|		escValue = *escPos - 'A' + 10;
  915|  2.32k|		++escPos;
  916|   313k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 286k, False: 26.3k]
  |  Branch (916:34): [True: 177k, False: 109k]
  ------------------
  917|   177k|		escValue = *escPos - 'a' + 10;
  918|   177k|		++escPos;
  919|   177k|	}
  920|       |	
  921|   317k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 268k, False: 48.7k]
  |  Branch (921:27): [True: 293, False: 268k]
  ------------------
  922|    293|		escValue = (escValue << 4) + (*escPos - '0');
  923|    293|		++escPos;
  924|   317k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 257k, False: 59.2k]
  |  Branch (924:34): [True: 995, False: 256k]
  ------------------
  925|    995|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|    995|		++escPos;
  927|   316k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 246k, False: 69.0k]
  |  Branch (927:34): [True: 106k, False: 140k]
  ------------------
  928|   106k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|   106k|		++escPos;
  930|   106k|	}
  931|       |	
  932|   317k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 317k]
  ------------------
  933|   317k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 244k, False: 72.7k]
  ------------------
  934|       |	
  935|  72.7k|	size_t escLen = escPos - escStart + 1;
  936|  72.7k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 3.56k, False: 69.1k]
  ------------------
  937|       |	
  938|  69.1k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  69.1k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  68.7k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  66.8k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 356, False: 68.7k]
  |  Branch (938:29): [True: 1.95k, False: 66.8k]
  |  Branch (938:50): [True: 383, False: 66.4k]
  ------------------
  939|       |	
  940|  66.4k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  69.1k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  11.2k|{
  152|  11.2k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  11.2k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 1.33k, False: 9.92k]
  ------------------
  155|  11.2k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 1.74k, False: 9.50k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  9.50k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  9.50k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  9.50k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  9.50k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 9.50k]
  ------------------
  164|      0|		     ((rootNode->parent == 0) ||
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|		      ((rootNode->parent->name != "x:xmpmeta") && (rootNode->parent->name != "x:xapmeta"))) ) return 0;
  ------------------
  |  Branch (165:10): [True: 0, False: 0]
  |  Branch (165:53): [True: 0, False: 0]
  ------------------
  166|       |
  167|  10.1k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.66k, False: 8.53k]
  ------------------
  168|  1.66k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.66k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 895, False: 771]
  |  Branch (169:42): [True: 79, False: 692]
  ------------------
  170|    974|				verStr = currAttr->value.c_str();
  171|    974|				break;
  172|    974|			}
  173|  1.66k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  9.50k|	unsigned long part;
  178|  24.2k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 15.5k, False: 8.65k]
  |  Branch (178:29): [True: 3.04k, False: 12.5k]
  |  Branch (178:48): [True: 11.6k, False: 854]
  ------------------
  179|       |	
  180|  9.50k|	part = 0;
  181|  12.2k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.56k, False: 8.65k]
  |  Branch (181:28): [True: 2.87k, False: 691]
  |  Branch (181:48): [True: 2.71k, False: 160]
  ------------------
  182|  2.71k|		part = (part * 10) + (*verStr - '0');
  183|  2.71k|		++verStr;
  184|  2.71k|	}
  185|  9.50k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 140, False: 9.36k]
  ------------------
  186|  9.50k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  9.50k|	part = 0;
  189|  9.50k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 599, False: 8.90k]
  ------------------
  190|  11.8k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 3.18k, False: 8.66k]
  |  Branch (190:28): [True: 2.53k, False: 650]
  |  Branch (190:48): [True: 2.33k, False: 193]
  ------------------
  191|  2.33k|		part = (part * 10) + (*verStr - '0');
  192|  2.33k|		++verStr;
  193|  2.33k|	}
  194|  9.50k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 67, False: 9.43k]
  ------------------
  195|  9.50k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  9.50k|	part = 0;
  198|  9.50k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 398, False: 9.10k]
  ------------------
  199|  11.1k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 2.44k, False: 8.66k]
  |  Branch (199:28): [True: 1.84k, False: 596]
  |  Branch (199:48): [True: 1.60k, False: 246]
  ------------------
  200|  1.60k|		part = (part * 10) + (*verStr - '0');
  201|  1.60k|		++verStr;
  202|  1.60k|	}
  203|  9.50k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 96, False: 9.40k]
  ------------------
  204|  9.50k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  9.50k|	part = 0;
  207|  9.50k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 508, False: 8.99k]
  ------------------
  208|  10.8k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 2.00k, False: 8.88k]
  |  Branch (208:28): [True: 1.89k, False: 114]
  |  Branch (208:48): [True: 1.39k, False: 502]
  ------------------
  209|  1.39k|		part = (part * 10) + (*verStr - '0');
  210|  1.39k|		++verStr;
  211|  1.39k|	}
  212|  9.50k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 42, False: 9.46k]
  ------------------
  213|  9.50k|	thiz->prevTkVer += part;
  214|       |	
  215|  9.50k|	return rootNode;
  216|       |	
  217|  9.50k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  4.59k|{
  112|       |
  113|       |	// Look among this parent's content for x:xmpmeta. The recursion for x:xmpmeta is broader than
  114|       |	// the strictly defined choice, but gives us smaller code.
  115|  17.6k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 14.7k, False: 2.85k]
  ------------------
  116|  14.7k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  14.7k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 8.85k, False: 5.89k]
  ------------------
  118|  5.89k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 1.74k, False: 4.15k]
  |  Branch (118:44): [True: 0, False: 4.15k]
  ------------------
  119|  5.89k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  2.85k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 2.85k, False: 0]
  ------------------
  122|  11.9k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 10.3k, False: 1.59k]
  ------------------
  123|  10.3k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  10.3k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 6.26k, False: 4.11k]
  ------------------
  125|  4.11k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 1.25k, False: 2.85k]
  ------------------
  126|  4.11k|		}
  127|  2.85k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  3.04k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 1.52k, False: 1.52k]
  ------------------
  131|  1.52k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  1.52k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 73, False: 1.44k]
  ------------------
  133|  1.52k|	}
  134|       |	
  135|  1.52k|	return 0;
  136|       |
  137|  1.59k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  6.77k|{
  232|  6.77k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  6.77k|#define kXMP_ExistingOnly	false
  ------------------
  233|  6.77k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 5.27k, False: 1.49k]
  ------------------
  234|       |	
  235|  5.27k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 3.77k, False: 1.49k]
  ------------------
  236|  3.77k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  3.77k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  3.77k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 306, False: 3.46k]
  ------------------
  240|       |		
  241|  3.46k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 149, False: 3.32k]
  ------------------
  242|  3.32k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 89, False: 3.23k]
  ------------------
  243|    238|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  3.23k|		} else if (
  245|  3.23k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 102, False: 3.12k]
  ------------------
  246|  3.12k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 110, False: 3.01k]
  ------------------
  247|  3.01k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 39, False: 2.98k]
  ------------------
  248|    251|			arrayForm = kXMP_PropArrayIsAltText;
  249|  2.98k|		} else if (
  250|  2.98k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 43, False: 2.93k]
  ------------------
  251|  2.93k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 158, False: 2.77k]
  ------------------
  252|  2.77k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 37, False: 2.74k]
  ------------------
  253|  2.74k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 34, False: 2.70k]
  ------------------
  254|  2.70k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 184, False: 2.52k]
  ------------------
  255|  2.52k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 18, False: 2.50k]
  ------------------
  256|    474|			arrayForm = kXMP_PropValueIsArray;
  257|    474|		}
  258|  3.46k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 2.50k, False: 963]
  ------------------
  259|       |		
  260|    963|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    963|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    963|		dcSchema->children[propNum] = newArray;
  263|    963|		newArray->children.push_back ( currProp );
  264|    963|		currProp->parent = newArray;
  265|    963|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    963|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    963|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 251, False: 712]
  |  Branch (267:44): [True: 251, False: 0]
  ------------------
  268|    251|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    251|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    251|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 251, False: 0]
  ------------------
  271|    251|				currProp->qualifiers.push_back ( newLang );
  272|    251|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    251|		}
  276|       |
  277|    963|	}
  278|       |	
  279|  1.49k|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  6.77k|{
  666|  6.77k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  6.77k|	XMP_Node * currSchema = 0;
  671|       |
  672|  6.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  6.77k|#define kXMP_ExistingOnly	false
  ------------------
  673|  6.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 47, False: 6.72k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     47|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     47|#define kXMP_ExistingOnly	false
  ------------------
  677|     47|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 47]
  ------------------
  678|       |	
  679|       |		// *** Should probably have RepairAltText change simple values to LangAlt with 'x-default' item.
  680|       |		// *** For now just do this for exif:UserComment, the one case we know about, late in cycle fix.
  681|     47|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     47|#define kXMP_ExistingOnly	false
  ------------------
  682|     47|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 47]
  |  Branch (682:30): [True: 0, False: 0]
  ------------------
  683|      0|			XMP_Node * newChild = new XMP_Node ( userComment, kXMP_ArrayItemName,
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  684|      0|												 userComment->value.c_str(), userComment->options );
  685|      0|			newChild->qualifiers.swap ( userComment->qualifiers );
  686|      0|			if ( ! XMP_PropHasLang ( newChild->options ) ) {
  ------------------
  |  Branch (686:9): [True: 0, False: 0]
  ------------------
  687|      0|				XMP_Node * langQual = new XMP_Node ( newChild, "xml:lang", "x-default", kXMP_PropIsQualifier );
  688|      0|				newChild->qualifiers.insert ( newChild->qualifiers.begin(), langQual );
  689|      0|				newChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  690|      0|			}
  691|      0|			userComment->value.erase();
  692|      0|			userComment->options = kXMP_PropArrayFormMask;	// ! Happens to have all the right bits.
  693|      0|			userComment->children.push_back ( newChild );
  694|      0|		}
  695|       |
  696|     47|	}
  697|       |
  698|  6.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  6.77k|#define kXMP_ExistingOnly	false
  ------------------
  699|  6.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 25, False: 6.74k]
  ------------------
  700|       |		// Do a special case migration of xmpDM:copyright to dc:rights['x-default']. Do this before
  701|       |		// the dc: touch up since it can affect the dc: schema.
  702|     25|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|     25|#define kXMP_ExistingOnly	false
  ------------------
  703|     25|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 25]
  ------------------
  704|     25|	}
  705|       |
  706|  6.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  6.77k|#define kXMP_ExistingOnly	false
  ------------------
  707|  6.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 1.49k, False: 5.27k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|  1.49k|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.49k|#define kXMP_ExistingOnly	false
  ------------------
  710|  1.49k|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 229, False: 1.26k]
  ------------------
  711|    229|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|    229|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|    229|		}
  714|  1.49k|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  6.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  6.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  6.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  6.77k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  6.77k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  6.77k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 979, False: 5.79k]
  ------------------
  732|       |
  733|    979|		bool nameIsUUID = false;
  734|    979|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    979|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    979|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 188, False: 791]
  |  |  ------------------
  ------------------
  737|       |
  738|    188|			nameIsUUID = true;
  739|       |
  740|    791|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 463, False: 328]
  ------------------
  741|       |
  742|    463|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  8.52k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 8.47k, False: 56]
  ------------------
  744|  8.47k|				char ch = nameStr[i];
  745|  8.47k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 609, False: 7.86k]
  ------------------
  746|    609|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 52, False: 557]
  |  Branch (746:23): [True: 204, False: 353]
  |  Branch (746:36): [True: 75, False: 278]
  |  Branch (746:49): [True: 98, False: 180]
  ------------------
  747|    180|					nameIsUUID = false;
  748|    180|					break;
  749|  7.86k|				} else {
  750|  7.86k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 7.78k, False: 83]
  |  Branch (750:27): [True: 403, False: 7.37k]
  |  Branch (750:44): [True: 7.30k, False: 155]
  |  Branch (750:59): [True: 7.23k, False: 72]
  ------------------
  751|    227|					nameIsUUID = false;
  752|    227|					break;
  753|  7.86k|				}
  754|  8.47k|			}
  755|       |
  756|    463|		}
  757|       |		
  758|    979|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 244, False: 735]
  ------------------
  759|       |
  760|    244|			XMP_ExpandedXPath expPath;
  761|    244|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|    244|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|    244|#define kXMP_CreateNodes	true
  ------------------
  763|    244|			if ( idNode == 0 ) XMP_Throw ( "Failure creating xmpMM:InstanceID", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (763:9): [True: 0, False: 244]
  ------------------
  764|       |
  765|    244|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|    244|			idNode->value = tree.name;
  767|    244|			idNode->RemoveChildren();
  768|    244|			idNode->RemoveQualifiers();
  769|       |
  770|    244|			tree.name.erase();
  771|       |
  772|    244|		}
  773|       |
  774|    979|	}
  775|       |
  776|  6.77k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  33.8k|{
  610|  33.8k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  33.8k|#define kXMP_ExistingOnly	false
  ------------------
  611|  33.8k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 29.2k, False: 4.61k]
  ------------------
  612|       |	
  613|  4.61k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.61k|#define kXMP_ExistingOnly	false
  ------------------
  614|  4.61k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 4.17k, False: 437]
  |  Branch (614:27): [True: 359, False: 78]
  ------------------
  615|       |	
  616|     78|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 1, False: 77]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     77|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  6.94k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 6.86k, False: 77]
  ------------------
  622|       |
  623|  6.86k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  6.86k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 1.48k, False: 5.37k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|  1.48k|			delete ( currChild );
  629|  1.48k|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  5.37k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.02k, False: 4.35k]
  ------------------
  632|       |		
  633|  1.02k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 204, False: 819]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|    204|				delete ( currChild );
  637|    204|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|    819|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|    819|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|    819|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 807, False: 12]
  ------------------
  644|    807|					currChild->qualifiers.push_back ( repairLang );
  645|    807|				} else {
  646|     12|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     12|				}
  648|    819|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|    819|			}
  651|       |
  652|  1.02k|		}
  653|       |
  654|  6.86k|	}
  655|       |
  656|     77|}	// RepairAltText

_ZN7XMPMetaC2Ev:
  588|  11.2k|XMPMeta::XMPMeta() : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
  589|  11.2k|{
  590|       |	// Nothing more to do, clientRefs is incremented in wrapper.
  591|       |	#if XMP_TraceCTorDTor
  592|       |		printf ( "Default construct XMPMeta @ %.8X\n", this );
  593|       |	#endif
  594|  11.2k|}	// XMPMeta
_ZN7XMPMetaD2Ev:
  599|  11.2k|{
  600|       |	#if XMP_TraceCTorDTor
  601|       |		printf ( "Destruct XMPMeta @ %.8X\n", this );
  602|       |	#endif
  603|       |
  604|  11.2k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  11.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  605|  11.2k|	if ( xmlParser != 0 ) delete ( xmlParser );
  ------------------
  |  Branch (605:7): [True: 0, False: 11.2k]
  ------------------
  606|  11.2k|	xmlParser = 0;
  607|       |
  608|  11.2k|}	// ~XMPMeta
_ZN7XMPMeta10InitializeEv:
  644|      1|{
  645|       |	// Allocate and initialize static objects.
  646|       |	
  647|      1|	++sXMP_InitCount;
  648|      1|	if ( sXMP_InitCount > 1 ) return true;
  ------------------
  |  Branch (648:7): [True: 0, False: 1]
  ------------------
  649|       |	
  650|       |	#if TraceXMPCalls
  651|       |		// xmpOut = fopen ( "xmp.out", "w" );	// Coordinate with client glue in WXMP_Common.hpp
  652|       |		fprintf ( xmpOut, "XMP initializing\n" ); fflush ( xmpOut );
  653|       |	#endif
  654|       |	
  655|      1|	sExceptionMessage = new XMP_VarString();
  656|      1|	XMP_InitMutex ( &sXMPCoreLock );
  657|      1|    sOutputNS  = new XMP_VarString;
  658|      1|    sOutputStr = new XMP_VarString;
  659|       |
  660|      1|	xdefaultName = new XMP_VarString ( "x-default" );
  661|       |	
  662|      1|	sNamespaceURIToPrefixMap	= new XMP_StringMap;
  663|      1|	sNamespacePrefixToURIMap	= new XMP_StringMap;
  664|      1|	sRegisteredAliasMap			= new XMP_AliasMap;
  665|       |	
  666|      1|	InitializeUnicodeConversions();
  667|       |	
  668|       |	// Register standard namespaces and aliases.
  669|      1|	RegisterNamespace ( kXMP_NS_XML, "xml" );
  670|      1|	RegisterNamespace ( kXMP_NS_RDF, "rdf" );
  671|      1|	RegisterNamespace ( kXMP_NS_DC, "dc" );
  672|       |
  673|      1|	RegisterNamespace ( kXMP_NS_XMP, "xmp" );
  674|      1|	RegisterNamespace ( kXMP_NS_PDF, "pdf" );
  675|      1|	RegisterNamespace ( kXMP_NS_Photoshop, "photoshop" );
  676|      1|	RegisterNamespace ( kXMP_NS_PSAlbum, "album" );
  677|      1|	RegisterNamespace ( kXMP_NS_EXIF, "exif" );
  678|      1|	RegisterNamespace ( kXMP_NS_EXIF_Aux, "aux" );
  679|      1|	RegisterNamespace ( kXMP_NS_TIFF, "tiff" );
  680|      1|	RegisterNamespace ( kXMP_NS_PNG, "png" );
  681|      1|	RegisterNamespace ( kXMP_NS_JPEG, "jpeg" );
  682|      1|	RegisterNamespace ( kXMP_NS_JP2K, "jp2k" );
  683|      1|	RegisterNamespace ( kXMP_NS_CameraRaw, "crs" );
  684|      1|	RegisterNamespace ( kXMP_NS_ASF, "asf" );
  685|      1|	RegisterNamespace ( kXMP_NS_WAV, "wav" );
  686|       |
  687|      1|	RegisterNamespace ( kXMP_NS_AdobeStockPhoto, "bmsp" );
  688|      1|	RegisterNamespace ( kXMP_NS_CreatorAtom, "creatorAtom" );
  689|       |
  690|      1|	RegisterNamespace ( kXMP_NS_XMP_Rights, "xmpRights" );
  691|      1|	RegisterNamespace ( kXMP_NS_XMP_MM, "xmpMM" );
  692|      1|	RegisterNamespace ( kXMP_NS_XMP_BJ, "xmpBJ" );
  693|      1|	RegisterNamespace ( kXMP_NS_XMP_Note, "xmpNote" );
  694|       |
  695|      1|	RegisterNamespace ( kXMP_NS_DM, "xmpDM" );
  696|      1|	RegisterNamespace ( kXMP_NS_XMP_Text, "xmpT" );
  697|      1|	RegisterNamespace ( kXMP_NS_XMP_PagedFile, "xmpTPg" );
  698|      1|	RegisterNamespace ( kXMP_NS_XMP_Graphics, "xmpG" );
  699|      1|	RegisterNamespace ( kXMP_NS_XMP_Image, "xmpGImg" );
  700|       |
  701|      1|	RegisterNamespace ( kXMP_NS_XMP_Font, "stFnt" );
  702|      1|	RegisterNamespace ( kXMP_NS_XMP_Dimensions, "stDim" );
  703|      1|	RegisterNamespace ( kXMP_NS_XMP_ResourceEvent, "stEvt" );
  704|      1|	RegisterNamespace ( kXMP_NS_XMP_ResourceRef, "stRef" );
  705|      1|	RegisterNamespace ( kXMP_NS_XMP_ST_Version, "stVer" );
  706|      1|	RegisterNamespace ( kXMP_NS_XMP_ST_Job, "stJob" );
  707|      1|	RegisterNamespace ( kXMP_NS_XMP_ManifestItem, "stMfs" );
  708|       |
  709|      1|	RegisterNamespace ( kXMP_NS_XMP_IdentifierQual, "xmpidq" );
  710|       |
  711|      1|	RegisterNamespace ( kXMP_NS_IPTCCore, "Iptc4xmpCore" );
  712|      1|	RegisterNamespace ( kXMP_NS_DICOM, "DICOM" );
  713|       |
  714|      1|	RegisterNamespace ( kXMP_NS_PDFA_Schema, "pdfaSchema" );
  715|      1|	RegisterNamespace ( kXMP_NS_PDFA_Property, "pdfaProperty" );
  716|      1|	RegisterNamespace ( kXMP_NS_PDFA_Type, "pdfaType" );
  717|      1|	RegisterNamespace ( kXMP_NS_PDFA_Field, "pdfaField" );
  718|      1|	RegisterNamespace ( kXMP_NS_PDFA_ID, "pdfaid" );
  719|      1|	RegisterNamespace ( kXMP_NS_PDFA_Extension, "pdfaExtension" );
  720|       |
  721|      1|	RegisterNamespace ( kXMP_NS_PDFX, "pdfx" );
  722|      1|	RegisterNamespace ( kXMP_NS_PDFX_ID, "pdfxid" );
  723|       |	
  724|      1|	RegisterNamespace ( "adobe:ns:meta/", "x" );
  725|      1|	RegisterNamespace ( "http://ns.adobe.com/iX/1.0/", "iX" );
  726|       |
  727|       |// 06-Oct-07, ahu: Do not use aliases. They result in unexpected behaviour.
  728|       |//	XMPMeta::RegisterStandardAliases ( "" );
  729|       |	
  730|       |	// Initialize the other core classes.
  731|       |	
  732|      1|	if ( ! XMPIterator::Initialize() ) XMP_Throw ( "Failure from XMPIterator::Initialize", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (732:7): [True: 0, False: 1]
  ------------------
  733|      1|	if ( ! XMPUtils::Initialize() ) XMP_Throw ( "Failure from XMPUtils::Initialize", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (733:7): [True: 0, False: 1]
  ------------------
  734|       |	// Do miscelaneous semantic checks of types and arithmetic.
  735|       |
  736|      1|	XMP_Assert ( sizeof(XMP_Int8) == 1 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  737|      1|	XMP_Assert ( sizeof(XMP_Int16) == 2 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  738|      1|	XMP_Assert ( sizeof(XMP_Int32) == 4 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  739|      1|	XMP_Assert ( sizeof(XMP_Int64) == 8 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  740|      1|	XMP_Assert ( sizeof(XMP_Uns8) == 1 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  741|      1|	XMP_Assert ( sizeof(XMP_Uns16) == 2 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  742|      1|	XMP_Assert ( sizeof(XMP_Uns32) == 4 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  743|      1|	XMP_Assert ( sizeof(XMP_Uns64) == 8 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  744|       |	
  745|      1|	XMP_Assert ( sizeof(XMP_OptionBits) == 4 );	// Check that option masking work on all 32 bits.
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  746|      1|	XMP_OptionBits flag = ~0;
  747|       |
  748|      1|	XMP_Assert ( flag == (XMP_OptionBits)(-1L) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  749|      1|	XMP_Assert ( (flag ^ kXMP_PropHasLang) == 0xFFFFFFBFUL );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  750|      1|	XMP_Assert ( (flag & ~kXMP_PropHasLang) == 0xFFFFFFBFUL );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  751|       |	
  752|      1|	XMP_OptionBits opt1 = 0;	// Check the general option bit macros.
  753|      1|	XMP_OptionBits opt2 = flag;
  754|      1|	XMP_SetOption ( opt1, kXMP_PropValueIsArray );
  755|      1|	XMP_ClearOption ( opt2, kXMP_PropValueIsArray );
  756|      1|	XMP_Assert ( opt1 == ~opt2 );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  757|      1|	XMP_Assert ( XMP_TestOption ( opt1, kXMP_PropValueIsArray ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  758|      1|	XMP_Assert ( ! XMP_TestOption ( opt2, kXMP_PropValueIsArray ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  759|       |	
  760|      1|	XMP_Assert ( XMP_PropIsSimple ( ~kXMP_PropCompositeMask ) );	// Check the special option bit macros.
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  761|      1|	XMP_Assert ( ! XMP_PropIsSimple ( kXMP_PropValueIsStruct ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  762|      1|	XMP_Assert ( ! XMP_PropIsSimple ( kXMP_PropValueIsArray ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  763|       |
  764|      1|	XMP_Assert ( XMP_PropIsStruct ( kXMP_PropValueIsStruct ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  765|      1|	XMP_Assert ( XMP_PropIsArray  ( kXMP_PropValueIsArray ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  766|      1|	XMP_Assert ( ! XMP_PropIsStruct ( ~kXMP_PropValueIsStruct ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  767|      1|	XMP_Assert ( ! XMP_PropIsArray  ( ~kXMP_PropValueIsArray ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  768|       |	
  769|      1|	XMP_Assert ( XMP_ArrayIsUnordered ( ~kXMP_PropArrayIsOrdered ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  770|      1|	XMP_Assert ( XMP_ArrayIsOrdered   ( kXMP_PropArrayIsOrdered ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  771|      1|	XMP_Assert ( XMP_ArrayIsAlternate ( kXMP_PropArrayIsAlternate ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  772|      1|	XMP_Assert ( XMP_ArrayIsAltText   ( kXMP_PropArrayIsAltText ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  773|      1|	XMP_Assert ( ! XMP_ArrayIsUnordered ( kXMP_PropArrayIsOrdered ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  774|      1|	XMP_Assert ( ! XMP_ArrayIsOrdered   ( ~kXMP_PropArrayIsOrdered ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  775|      1|	XMP_Assert ( ! XMP_ArrayIsAlternate ( ~kXMP_PropArrayIsAlternate ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  776|      1|	XMP_Assert ( ! XMP_ArrayIsAltText   ( ~kXMP_PropArrayIsAltText ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  777|       |	
  778|      1|	XMP_Assert ( XMP_PropHasQualifiers ( kXMP_PropHasQualifiers ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  779|      1|	XMP_Assert ( XMP_PropIsQualifier   ( kXMP_PropIsQualifier ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  780|      1|	XMP_Assert ( XMP_PropHasLang       ( kXMP_PropHasLang ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  781|      1|	XMP_Assert ( ! XMP_PropHasQualifiers ( ~kXMP_PropHasQualifiers ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  782|      1|	XMP_Assert ( ! XMP_PropIsQualifier   ( ~kXMP_PropIsQualifier ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  783|      1|	XMP_Assert ( ! XMP_PropHasLang       ( ~kXMP_PropHasLang ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  784|       |	
  785|      1|	XMP_Assert ( XMP_NodeIsSchema ( kXMP_SchemaNode ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  786|      1|	XMP_Assert ( XMP_PropIsAlias  ( kXMP_PropIsAlias ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  787|      1|	XMP_Assert ( ! XMP_NodeIsSchema ( ~kXMP_SchemaNode ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  788|      1|	XMP_Assert ( ! XMP_PropIsAlias  ( ~kXMP_PropIsAlias ) );
  ------------------
  |  |  142|      1|	#define XMP_Assert(c)	((void) 0)
  ------------------
  789|       |	
  790|       |	#if 0	// Generally off, enable to hand check generated code.
  791|       |		extern XMP_OptionBits opt3, opt4;
  792|       |		if ( XMP_TestOption ( opt3, kXMP_PropValueIsArray ) ) opt4 = opt3;
  793|       |		if ( ! XMP_TestOption ( opt3, kXMP_PropValueIsStruct ) ) opt4 = opt3;
  794|       |		static bool ok1 = XMP_TestOption ( opt4, kXMP_PropValueIsArray );
  795|       |		static bool ok2 = ! XMP_TestOption ( opt4, kXMP_PropValueIsStruct );
  796|       |	#endif
  797|       |	
  798|       |	// Make sure the embedded info strings are referenced and kept.
  799|      1|	if ( (kXMPCore_EmbeddedVersion[0] == 0) || (kXMPCore_EmbeddedCopyright[0] == 0) ) return false;
  ------------------
  |  Branch (799:7): [True: 0, False: 1]
  |  Branch (799:45): [True: 0, False: 1]
  ------------------
  800|      1|	return true;
  801|       |
  802|      1|}	// Initialize
_ZN7XMPMeta9TerminateEv:
  813|      1|{
  814|      1|	--sXMP_InitCount;
  815|      1|	if ( sXMP_InitCount > 0 ) return;
  ------------------
  |  Branch (815:7): [True: 0, False: 1]
  ------------------
  816|       |
  817|       |	#if TraceXMPCalls
  818|       |		fprintf ( xmpOut, "XMP terminating\n" ); fflush ( xmpOut );
  819|       |		// fclose ( xmpOut );	// Coordinate with fopen in XMPMeta::Initialize.
  820|       |	#endif
  821|       |	
  822|      1|	XMPIterator::Terminate();
  823|      1|	XMPUtils::Terminate();
  824|      1|	EliminateGlobal ( sNamespaceURIToPrefixMap );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  825|      1|	EliminateGlobal ( sNamespacePrefixToURIMap );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  826|      1|	EliminateGlobal ( sRegisteredAliasMap );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  827|       |    
  828|      1|    EliminateGlobal ( xdefaultName );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  829|      1|    EliminateGlobal ( sOutputNS );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  830|      1|    EliminateGlobal ( sOutputStr );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  831|      1|	EliminateGlobal ( sExceptionMessage );
  ------------------
  |  |  809|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  832|       |
  833|      1|	XMP_TermMutex ( sXMPCoreLock );
  834|       |	
  835|      1|}	// Terminate
_ZN7XMPMeta6UnlockEj:
  844|   233k|{
  845|   233k|	UNUSED(options);
  846|       |
  847|       |    #if TraceXMPLocking
  848|       |    	fprintf ( xmpOut, "  Unlocking XMP toolkit, count = %d\n", sLockCount ); fflush ( xmpOut );
  849|       |	#endif
  850|   233k|    --sLockCount;
  851|   233k|    XMP_Assert ( sLockCount == 0 );
  ------------------
  |  |  142|   233k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  852|   233k|	XMP_ExitCriticalRegion ( sXMPCoreLock );
  853|       |
  854|   233k|}	// Unlock
_ZN7XMPMeta17RegisterNamespaceEPKcS1_:
 1041|  38.8k|{
 1042|  38.8k|	if ( (*namespaceURI == 0) || (*prefix == 0) ) {
  ------------------
  |  Branch (1042:7): [True: 0, False: 38.8k]
  |  Branch (1042:31): [True: 0, False: 38.8k]
  ------------------
 1043|      0|		XMP_Throw ( "Empty namespace URI or prefix", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1044|      0|	}
 1045|       |	
 1046|  38.8k|	XMP_VarString	nsURI ( namespaceURI );
 1047|  38.8k|	XMP_VarString	prfix ( prefix );
 1048|  38.8k|	if ( prfix[prfix.size()-1] != ':' ) prfix += ':';
  ------------------
  |  Branch (1048:7): [True: 38.8k, False: 0]
  ------------------
 1049|  38.8k|	VerifySimpleXMLName ( prefix, prefix+prfix.size()-1 );	// Exclude the colon.
 1050|       |	
 1051|       |        // Set the new namespace in both maps.
 1052|  38.8k|        (*sNamespaceURIToPrefixMap)[nsURI] = prfix;
 1053|  38.8k|        (*sNamespacePrefixToURIMap)[prfix] = nsURI;
 1054|       |	
 1055|  38.8k|}	// RegisterNamespace
_ZN7XMPMeta18GetNamespacePrefixEPKcPS1_Pj:
 1066|   310k|{
 1067|   310k|	bool	found	= false;
 1068|       |	
 1069|   310k|	XMP_Assert ( *namespaceURI != 0 ); 	// ! Enforced by wrapper.
  ------------------
  |  |  142|   310k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1070|   310k|	XMP_Assert ( (namespacePrefix != 0) && (prefixSize != 0) );	// ! Enforced by wrapper.
  ------------------
  |  |  142|   310k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1071|       |
 1072|   310k|	XMP_VarString    nsURI ( namespaceURI );
 1073|   310k|	XMP_StringMapPos uriPos	= sNamespaceURIToPrefixMap->find ( nsURI );
 1074|       |	
 1075|   310k|	if ( uriPos != sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (1075:7): [True: 310k, False: 0]
  ------------------
 1076|   310k|		*namespacePrefix = uriPos->second.c_str();
 1077|   310k|		*prefixSize = uriPos->second.size();
 1078|   310k|		found = true;
 1079|   310k|	}
 1080|       |	
 1081|   310k|	return found;
 1082|       |	
 1083|   310k|}	// GetNamespacePrefix
_ZNK7XMPMeta15CountArrayItemsEPKcS1_:
 1510|  3.70k|{
 1511|  3.70k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.70k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1512|       |
 1513|  3.70k|	XMP_ExpandedXPath	expPath;
 1514|  3.70k|	ExpandXPath ( schemaNS, arrayName, &expPath );
 1515|       |	
 1516|  3.70k|	const XMP_Node * arrayNode = FindConstNode ( &tree, expPath );
  ------------------
  |  |  301|  3.70k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.70k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
 1517|       |
 1518|  3.70k|	if ( arrayNode == 0 ) return 0;
  ------------------
  |  Branch (1518:7): [True: 0, False: 3.70k]
  ------------------
 1519|  3.70k|	if ( ! (arrayNode->options & kXMP_PropValueIsArray) ) XMP_Throw ( "The named property is not an array", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1519:7): [True: 0, False: 3.70k]
  ------------------
 1520|  3.70k|	return arrayNode->children.size();
 1521|       |	
 1522|  3.70k|}	// CountArrayItems

_ZN8XMPUtils10InitializeEv:
  640|      1|{
  641|      1|	sComposedPath	= new XMP_VarString();
  642|      1|	sConvertedValue = new XMP_VarString();
  643|      1|	sBase64Str		= new XMP_VarString();
  644|      1|	sCatenatedItems = new XMP_VarString();
  645|      1|	sStandardXMP    = new XMP_VarString();
  646|      1|	sExtendedXMP    = new XMP_VarString();
  647|      1|	sExtendedDigest = new XMP_VarString();
  648|       |
  649|       |	#if XMP_MacBuild && __MWERKS__
  650|       |		LookupTimeProcs();
  651|       |	#endif
  652|       |
  653|      1|	return true;
  654|       |
  655|      1|}	// Initialize
_ZN8XMPUtils9TerminateEv:
  666|      1|{
  667|      1|	EliminateGlobal ( sComposedPath );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  668|      1|	EliminateGlobal ( sConvertedValue );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  669|      1|	EliminateGlobal ( sBase64Str );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  670|      1|	EliminateGlobal ( sCatenatedItems );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  671|      1|	EliminateGlobal ( sStandardXMP );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  672|      1|	EliminateGlobal ( sExtendedXMP );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  673|      1|	EliminateGlobal ( sExtendedDigest );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  674|       |
  675|      1|	return;
  676|       |
  677|      1|}	// Terminate
_ZN8XMPUtils13ConvertToDateEPKcP12XMP_DateTime:
 1293|    178|{
 1294|    178|	if ( (strValue == 0) || (*strValue == 0) ) XMP_Throw ( "Empty convert-from string", kXMPErr_BadValue);
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1294:7): [True: 0, False: 178]
  |  Branch (1294:26): [True: 2, False: 176]
  ------------------
 1295|       |
 1296|    176|	size_t	 pos = 0;
 1297|    176|	XMP_Int32 temp;
 1298|       |
 1299|    176|	XMP_Assert ( sizeof(*binValue) == sizeof(XMP_DateTime) );
  ------------------
  |  |  142|    176|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1300|    176|	(void) memset ( binValue, 0, sizeof(*binValue) );	// AUDIT: Safe, using sizeof destination.
 1301|       |
 1302|    176|	bool timeOnly = ( (strValue[0] == 'T') ||
  ------------------
  |  Branch (1302:20): [True: 3, False: 173]
  ------------------
 1303|    173|					  ((strlen(strValue) >= 2) && (strValue[1] == ':')) ||
  ------------------
  |  Branch (1303:9): [True: 172, False: 1]
  |  Branch (1303:36): [True: 16, False: 156]
  ------------------
 1304|    157|					  ((strlen(strValue) >= 3) && (strValue[2] == ':')) );
  ------------------
  |  Branch (1304:9): [True: 155, False: 2]
  |  Branch (1304:36): [True: 82, False: 73]
  ------------------
 1305|       |
 1306|    176|	if ( ! timeOnly ) {
  ------------------
  |  Branch (1306:7): [True: 75, False: 101]
  ------------------
 1307|       |
 1308|     75|		if ( strValue[0] == '-' ) pos = 1;
  ------------------
  |  Branch (1308:8): [True: 4, False: 71]
  ------------------
 1309|       |
 1310|     75|		temp = GatherInt ( strValue, &pos, "Invalid year in date string" ); // Extract the year.
 1311|     75|		if ( (strValue[pos] != 0) && (strValue[pos] != '-') ) XMP_Throw ( "Invalid date string, after year", kXMPErr_BadParam );
  ------------------
  |  |  199|      4|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1311:8): [True: 65, False: 10]
  |  Branch (1311:32): [True: 4, False: 61]
  ------------------
 1312|     71|		if ( strValue[0] == '-' ) temp = -temp;
  ------------------
  |  Branch (1312:8): [True: 4, False: 67]
  ------------------
 1313|     71|		binValue->year = temp;
 1314|     71|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1314:8): [True: 3, False: 68]
  ------------------
 1315|       |
 1316|     68|		++pos;
 1317|     68|		temp = GatherInt ( strValue, &pos, "Invalid month in date string" );	// Extract the month.
 1318|     68|		if ( (temp < 1) || (temp > 12) ) XMP_Throw ( "Month is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1318:8): [True: 11, False: 57]
  |  Branch (1318:22): [True: 7, False: 50]
  ------------------
 1319|     60|		if ( (strValue[pos] != 0) && (strValue[pos] != '-') ) XMP_Throw ( "Invalid date string, after month", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1319:8): [True: 47, False: 13]
  |  Branch (1319:32): [True: 6, False: 41]
  ------------------
 1320|     54|		binValue->month = temp;
 1321|     54|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1321:8): [True: 3, False: 51]
  ------------------
 1322|       |
 1323|     51|		++pos;
 1324|     51|		temp = GatherInt ( strValue, &pos, "Invalid day in date string" );	// Extract the day.
 1325|     51|		if ( (temp < 1) || (temp > 31) ) XMP_Throw ( "Day is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1325:8): [True: 23, False: 28]
  |  Branch (1325:22): [True: 4, False: 24]
  ------------------
 1326|     45|		if ( (strValue[pos] != 0) && (strValue[pos] != 'T') ) XMP_Throw ( "Invalid date string, after day", kXMPErr_BadParam );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1326:8): [True: 23, False: 22]
  |  Branch (1326:32): [True: 2, False: 21]
  ------------------
 1327|     43|		binValue->day = temp;
 1328|     43|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1328:8): [True: 1, False: 42]
  ------------------
 1329|       |
 1330|       |		// Allow year, month, and day to all be zero; implies the date portion is missing.
 1331|     42|		if ( (binValue->year != 0) || (binValue->month != 0) || (binValue->day != 0) ) {
  ------------------
  |  Branch (1331:8): [True: 40, False: 2]
  |  Branch (1331:33): [True: 2, False: 0]
  |  Branch (1331:59): [True: 0, False: 0]
  ------------------
 1332|       |			// Temporary fix for bug 1269463, silently fix out of range month or day.
 1333|       |			// if ( (binValue->month < 1) || (binValue->month > 12) ) XMP_Throw ( "Month is out of range", kXMPErr_BadParam );
 1334|       |			// if ( (binValue->day < 1) || (binValue->day > 31) ) XMP_Throw ( "Day is out of range", kXMPErr_BadParam );
 1335|     21|			if ( binValue->month < 1 ) binValue->month = 1;
  ------------------
  |  Branch (1335:9): [True: 0, False: 21]
  ------------------
 1336|     21|			if ( binValue->month > 12 ) binValue->month = 12;
  ------------------
  |  Branch (1336:9): [True: 0, False: 21]
  ------------------
 1337|     21|			if ( binValue->day < 1 ) binValue->day = 1;
  ------------------
  |  Branch (1337:9): [True: 0, False: 21]
  ------------------
 1338|     21|			if ( binValue->day > 31 ) binValue->day = 31;
  ------------------
  |  Branch (1338:9): [True: 0, False: 21]
  ------------------
 1339|     21|		}
 1340|       |
 1341|     42|	}
 1342|       |
 1343|    143|	if ( strValue[pos] == 'T' ) {
  ------------------
  |  Branch (1343:7): [True: 24, False: 119]
  ------------------
 1344|     24|		++pos;
 1345|    119|	} else if ( ! timeOnly ) {
  ------------------
  |  Branch (1345:14): [True: 0, False: 119]
  ------------------
 1346|      0|		XMP_Throw ( "Invalid date string, missing 'T' after date", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1347|      0|	}
 1348|       |
 1349|    143|	temp = GatherInt ( strValue, &pos, "Invalid hour in date string" ); // Extract the hour.
 1350|    143|	if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after hour", kXMPErr_BadParam );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1350:7): [True: 3, False: 140]
  ------------------
 1351|    140|	if ( temp < 0 || temp > 23 ) temp = 23;	// *** 1269463: XMP_Throw ( "Hour is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1351:7): [True: 26, False: 114]
  |  Branch (1351:19): [True: 8, False: 106]
  ------------------
 1352|    140|	binValue->hour = temp;
 1353|       |	// Don't check for done, we have to work up to the time zone.
 1354|       |
 1355|    140|	++pos;
 1356|    140|	temp = GatherInt ( strValue, &pos, "Invalid minute in date string" );	// And the minute.
 1357|    140|	if ( (strValue[pos] != ':') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1357:7): [True: 35, False: 105]
  |  Branch (1357:33): [True: 33, False: 2]
  ------------------
 1358|    134|		 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) XMP_Throw ( "Invalid date string, after minute", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1358:4): [True: 25, False: 8]
  |  Branch (1358:30): [True: 10, False: 15]
  |  Branch (1358:56): [True: 6, False: 4]
  ------------------
 1359|    134|	if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Minute is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1359:7): [True: 31, False: 103]
  |  Branch (1359:19): [True: 22, False: 81]
  ------------------
 1360|    134|	binValue->minute = temp;
 1361|       |	// Don't check for done, we have to work up to the time zone.
 1362|       |
 1363|    134|	if ( strValue[pos] == ':' ) {
  ------------------
  |  Branch (1363:7): [True: 74, False: 60]
  ------------------
 1364|       |
 1365|     74|		++pos;
 1366|     74|		temp = GatherInt ( strValue, &pos, "Invalid whole seconds in date string" );	// Extract the whole seconds.
 1367|     74|		if ( (strValue[pos] != '.') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1367:8): [True: 38, False: 36]
  |  Branch (1367:34): [True: 37, False: 1]
  ------------------
 1368|     37|			 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1368:5): [True: 27, False: 10]
  |  Branch (1368:31): [True: 17, False: 10]
  |  Branch (1368:57): [True: 6, False: 11]
  ------------------
 1369|      6|			XMP_Throw ( "Invalid date string, after whole seconds", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1370|      0|		}
 1371|     68|		if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Whole second is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1371:8): [True: 5, False: 63]
  |  Branch (1371:20): [True: 27, False: 36]
  ------------------
 1372|     68|		binValue->second = temp;
 1373|       |		// Don't check for done, we have to work up to the time zone.
 1374|       |
 1375|     68|		if ( strValue[pos] == '.' ) {
  ------------------
  |  Branch (1375:8): [True: 31, False: 37]
  ------------------
 1376|       |
 1377|     31|			++pos;
 1378|     31|			size_t digits = pos;	// Will be the number of digits later.
 1379|       |
 1380|     31|			temp = GatherInt ( strValue, &pos, "Invalid fractional seconds in date string" );	// Extract the fractional seconds.
 1381|     31|			if ( (strValue[pos] != 'Z') && (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1381:9): [True: 24, False: 7]
  |  Branch (1381:35): [True: 22, False: 2]
  |  Branch (1381:61): [True: 16, False: 6]
  |  Branch (1381:87): [True: 3, False: 13]
  ------------------
 1382|      3|				XMP_Throw ( "Invalid date string, after fractional second", kXMPErr_BadParam );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1383|      0|			}
 1384|       |
 1385|     28|			digits = pos - digits;
 1386|  2.03k|			for ( ; digits > 9; --digits ) temp = temp / 10;
  ------------------
  |  Branch (1386:12): [True: 2.00k, False: 28]
  ------------------
 1387|     82|			for ( ; digits < 9; ++digits ) temp = temp * 10;
  ------------------
  |  Branch (1387:12): [True: 54, False: 28]
  ------------------
 1388|       |
 1389|     28|			if ( temp < 0 || temp >= 1000*1000*1000 ) XMP_Throw ( "Fractional second is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1389:9): [True: 4, False: 24]
  |  Branch (1389:21): [True: 0, False: 24]
  ------------------
 1390|     28|			binValue->nanoSecond = temp;
 1391|       |			// Don't check for done, we have to work up to the time zone.
 1392|       |
 1393|     28|		}
 1394|       |
 1395|     68|	}
 1396|       |
 1397|    125|	if ( strValue[pos] == 'Z' ) {
  ------------------
  |  Branch (1397:7): [True: 6, False: 119]
  ------------------
 1398|       |
 1399|      6|		++pos;
 1400|       |
 1401|    119|	} else if ( strValue[pos] != 0 ) {
  ------------------
  |  Branch (1401:14): [True: 51, False: 68]
  ------------------
 1402|       |
 1403|     51|		if ( strValue[pos] == '+' ) {
  ------------------
  |  Branch (1403:8): [True: 20, False: 31]
  ------------------
 1404|     20|			binValue->tzSign = kXMP_TimeEastOfUTC;
 1405|     31|		} else if ( strValue[pos] == '-' ) {
  ------------------
  |  Branch (1405:15): [True: 31, False: 0]
  ------------------
 1406|     31|			binValue->tzSign = kXMP_TimeWestOfUTC;
 1407|     31|		} else {
 1408|      0|			XMP_Throw ( "Time zone must begin with 'Z', '+', or '-'", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1409|      0|		}
 1410|       |
 1411|     51|		++pos;
 1412|     51|		temp = GatherInt ( strValue, &pos, "Invalid time zone hour in date string" );	// Extract the time zone hour.
 1413|     51|		if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after time zone hour", kXMPErr_BadParam );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1413:8): [True: 15, False: 36]
  ------------------
 1414|     36|		if ( temp < 0 || temp > 23 ) XMP_Throw ( "Time zone hour is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1414:8): [True: 7, False: 29]
  |  Branch (1414:20): [True: 2, False: 27]
  ------------------
 1415|     34|		binValue->tzHour = temp;
 1416|       |
 1417|     34|		++pos;
 1418|     34|		temp = GatherInt ( strValue, &pos, "Invalid time zone minute in date string" ); // Extract the time zone minute.
 1419|     34|		if ( temp < 0 || temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1419:8): [True: 10, False: 24]
  |  Branch (1419:20): [True: 3, False: 21]
  ------------------
 1420|     31|		binValue->tzMinute = temp;
 1421|       |
 1422|     68|	} else {
 1423|       |
 1424|     68|		XMPUtils::SetTimeZone( binValue );
 1425|       |
 1426|     68|	}
 1427|       |
 1428|    105|	if ( strValue[pos] != 0 ) XMP_Throw ( "Invalid date string, extra chars at end", kXMPErr_BadParam );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1428:7): [True: 8, False: 97]
  ------------------
 1429|       |
 1430|     97|}	// ConvertToDate
_ZN8XMPUtils11SetTimeZoneEP12XMP_DateTime:
 1946|     82|{
 1947|     82|	XMP_Assert ( xmpTime != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|     82|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1948|       |
 1949|     82|	if ( (xmpTime->tzSign != 0) || (xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0) ) {
  ------------------
  |  Branch (1949:7): [True: 0, False: 82]
  |  Branch (1949:33): [True: 0, False: 82]
  |  Branch (1949:59): [True: 0, False: 82]
  ------------------
 1950|      0|		XMP_Throw ( "SetTimeZone can only be used on \"zoneless\" times", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1951|      0|	}
 1952|       |
 1953|       |	// Create ansi_tt form of the input time. Need the ansi_tm form to make the ansi_tt form.
 1954|       |
 1955|     82|	ansi_tt ttTime;
 1956|     82|	ansi_tm tmLocal, tmUTC;
 1957|       |
 1958|     82|	if ( (xmpTime->year == 0) && (xmpTime->month == 0) && (xmpTime->day == 0) ) {
  ------------------
  |  Branch (1958:7): [True: 57, False: 25]
  |  Branch (1958:31): [True: 57, False: 0]
  |  Branch (1958:56): [True: 57, False: 0]
  ------------------
 1959|     57|		ansi_tt now = ansi_time(0);
  ------------------
  |  |   69|     57|	#define ansi_time		time
  ------------------
 1960|     57|		if ( now == -1 ) XMP_Throw ( "Failure from ANSI C time function", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1960:8): [True: 0, False: 57]
  ------------------
 1961|     57|		ansi_localtime ( &now, &tmLocal );
  ------------------
  |  |   74|     57|	#define ansi_localtime	localtime_r
  ------------------
 1962|     57|	} else {
 1963|     25|		if (xmpTime->year < std::numeric_limits<decltype(tmLocal.tm_year)>::min() + 1900) {
  ------------------
  |  Branch (1963:7): [True: 0, False: 25]
  ------------------
 1964|      0|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1965|     25|		} else if (xmpTime->year > std::numeric_limits<decltype(tmLocal.tm_year)>::max()) {
  ------------------
  |  Branch (1965:14): [True: 0, False: 25]
  ------------------
 1966|      0|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1967|     25|		} else {
 1968|     25|			tmLocal.tm_year = xmpTime->year - 1900;
 1969|     25|		}
 1970|     25|		tmLocal.tm_mon	 = xmpTime->month - 1;
 1971|     25|		tmLocal.tm_mday	 = xmpTime->day;
 1972|     25|	}
 1973|       |
 1974|     82|	tmLocal.tm_hour = xmpTime->hour;
 1975|     82|	tmLocal.tm_min = xmpTime->minute;
 1976|     82|	tmLocal.tm_sec = xmpTime->second;
 1977|     82|	tmLocal.tm_isdst = -1;	// Don't know if daylight time is in effect.
 1978|       |
 1979|     82|	ttTime = ansi_mktime ( &tmLocal );
  ------------------
  |  |   70|     82|	#define ansi_mktime		mktime
  ------------------
 1980|     82|	if ( ttTime == -1 ) XMP_Throw ( "Failure from ANSI C mktime function", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1980:7): [True: 0, False: 82]
  ------------------
 1981|       |
 1982|       |	// Convert back to a localized ansi_tm time and get the corresponding UTC ansi_tm time.
 1983|       |
 1984|     82|	ansi_localtime ( &ttTime, &tmLocal );
  ------------------
  |  |   74|     82|	#define ansi_localtime	localtime_r
  ------------------
 1985|     82|	ansi_gmtime ( &ttTime, &tmUTC );
  ------------------
  |  |   73|     82|	#define ansi_gmtime		gmtime_r
  ------------------
 1986|       |
 1987|       |	// Get the offset direction and amount.
 1988|       |
 1989|     82|	ansi_tm tmx = tmLocal;	// ! Note that mktime updates the ansi_tm parameter, messing up difftime!
 1990|     82|	ansi_tm tmy = tmUTC;
 1991|     82|	tmx.tm_isdst = tmy.tm_isdst = 0;
 1992|     82|	ansi_tt ttx = ansi_mktime ( &tmx );
  ------------------
  |  |   70|     82|	#define ansi_mktime		mktime
  ------------------
 1993|     82|	ansi_tt tty = ansi_mktime ( &tmy );
  ------------------
  |  |   70|     82|	#define ansi_mktime		mktime
  ------------------
 1994|     82|	double diffSecs;
 1995|       |
 1996|     82|	if ( (ttx != -1) && (tty != -1) ) {
  ------------------
  |  Branch (1996:7): [True: 82, False: 0]
  |  Branch (1996:22): [True: 82, False: 0]
  ------------------
 1997|     82|		diffSecs = ansi_difftime ( ttx, tty );
  ------------------
  |  |   71|     82|	#define ansi_difftime	difftime
  ------------------
 1998|     82|	} else {
 1999|       |		#if XMP_MacBuild
 2000|       |			// Looks like Apple's mktime is buggy - see W1140533. But the offset is visible.
 2001|       |			diffSecs = tmLocal.tm_gmtoff;
 2002|       |		#else
 2003|       |			// Win and UNIX don't have a visible offset. Make sure we know about the failure,
 2004|       |			// then try using the current date/time as a close fallback.
 2005|      0|			ttTime = ansi_time(0);
  ------------------
  |  |   69|      0|	#define ansi_time		time
  ------------------
 2006|      0|			if ( ttTime == -1 ) XMP_Throw ( "Failure from ANSI C time function", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (2006:9): [True: 0, False: 0]
  ------------------
 2007|      0|			ansi_localtime ( &ttTime, &tmx );
  ------------------
  |  |   74|      0|	#define ansi_localtime	localtime_r
  ------------------
 2008|      0|			ansi_gmtime ( &ttTime, &tmy );
  ------------------
  |  |   73|      0|	#define ansi_gmtime		gmtime_r
  ------------------
 2009|      0|			tmx.tm_isdst = tmy.tm_isdst = 0;
 2010|      0|			ttx = ansi_mktime ( &tmx );
  ------------------
  |  |   70|      0|	#define ansi_mktime		mktime
  ------------------
 2011|      0|			tty = ansi_mktime ( &tmy );
  ------------------
  |  |   70|      0|	#define ansi_mktime		mktime
  ------------------
 2012|      0|			if ( (ttx == -1) || (tty == -1) ) XMP_Throw ( "Failure from ANSI C mktime function", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (2012:9): [True: 0, False: 0]
  |  Branch (2012:24): [True: 0, False: 0]
  ------------------
 2013|      0|			diffSecs = ansi_difftime ( ttx, tty );
  ------------------
  |  |   71|      0|	#define ansi_difftime	difftime
  ------------------
 2014|      0|		#endif
 2015|      0|	}
 2016|       |
 2017|     82|	if ( diffSecs > 0.0 ) {
  ------------------
  |  Branch (2017:7): [True: 0, False: 82]
  ------------------
 2018|      0|		xmpTime->tzSign = kXMP_TimeEastOfUTC;
 2019|     82|	} else if ( diffSecs == 0.0 ) {
  ------------------
  |  Branch (2019:14): [True: 82, False: 0]
  ------------------
 2020|     82|		xmpTime->tzSign = kXMP_TimeIsUTC;
 2021|     82|	} else {
 2022|      0|		xmpTime->tzSign = kXMP_TimeWestOfUTC;
 2023|      0|		diffSecs = -diffSecs;
 2024|      0|	}
 2025|     82|	xmpTime->tzHour = XMP_Int32 ( diffSecs / 3600.0 );
 2026|     82|	xmpTime->tzMinute = XMP_Int32 ( (diffSecs / 60.0) - (xmpTime->tzHour * 60.0) );
 2027|       |
 2028|       |	// *** Save the tm_isdst flag in a qualifier?
 2029|       |
 2030|     82|	XMP_Assert ( (0 <= xmpTime->tzHour) && (xmpTime->tzHour <= 23) );
  ------------------
  |  |  142|     82|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2031|     82|	XMP_Assert ( (0 <= xmpTime->tzMinute) && (xmpTime->tzMinute <= 59) );
  ------------------
  |  |  142|     82|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2032|     82|	XMP_Assert ( (-1 <= xmpTime->tzSign) && (xmpTime->tzSign <= +1) );
  ------------------
  |  |  142|     82|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2033|     82|	XMP_Assert ( (xmpTime->tzSign == 0) ? ((xmpTime->tzHour == 0) && (xmpTime->tzMinute == 0)) :
  ------------------
  |  |  142|     82|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2034|     82|										  ((xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0)) );
 2035|       |
 2036|     82|}	// SetTimeZone
_ZN8XMPUtils16ConvertToUTCTimeEP12XMP_DateTime:
 2045|     54|{
 2046|     54|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2047|       |
 2048|     54|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2049|     54|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2050|     54|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2051|     54|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2052|     54|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2053|       |
 2054|     54|	if ( time->tzSign == kXMP_TimeEastOfUTC ) {
  ------------------
  |  Branch (2054:7): [True: 12, False: 42]
  ------------------
 2055|       |		// We are before (east of) GMT, subtract the offset from the time.
 2056|     12|		time->hour -= time->tzHour;
 2057|     12|		time->minute -= time->tzMinute;
 2058|     42|	} else if ( time->tzSign == kXMP_TimeWestOfUTC ) {
  ------------------
  |  Branch (2058:14): [True: 7, False: 35]
  ------------------
 2059|       |		// We are behind (west of) GMT, add the offset to the time.
 2060|      7|		time->hour += time->tzHour;
 2061|      7|		time->minute += time->tzMinute;
 2062|      7|	}
 2063|       |
 2064|     54|	AdjustTimeOverflow ( time );
 2065|     54|	time->tzSign = time->tzHour = time->tzMinute = 0;
 2066|       |
 2067|     54|}	// ConvertToUTCTime
_ZN8XMPUtils18ConvertToLocalTimeEP12XMP_DateTime:
 2076|     54|{
 2077|     54|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2078|       |
 2079|     54|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2080|     54|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2081|     54|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2082|     54|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|     54|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2083|     54|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2084|       |
 2085|     54|	ConvertToUTCTime ( time );	// The existing time zone might not be the local one.
 2086|     54|	SetTimeZone ( time );		// Fill in the local timezone offset, then adjust the time.
 2087|       |
 2088|     54|	if ( time->tzSign > 0 ) {
  ------------------
  |  Branch (2088:7): [True: 0, False: 54]
  ------------------
 2089|       |		// We are before (east of) GMT, add the offset to the time.
 2090|      0|		time->hour += time->tzHour;
 2091|      0|		time->minute += time->tzMinute;
 2092|     54|	} else if ( time->tzSign < 0 ) {
  ------------------
  |  Branch (2092:14): [True: 0, False: 54]
  ------------------
 2093|       |		// We are behind (west of) GMT, subtract the offset from the time.
 2094|      0|		time->hour -= time->tzHour;
 2095|      0|		time->minute -= time->tzMinute;
 2096|      0|	}
 2097|       |
 2098|     54|	AdjustTimeOverflow ( time );
 2099|       |
 2100|     54|}	// ConvertToLocalTime
XMPUtils.cpp:_ZL9GatherIntPKcPmS0_:
  368|    596|{
  369|    596|	size_t	 pos   = *_pos;
  370|    596|	XMP_Int32 value = 0;
  371|       |
  372|       |	// Limits for overflow checking. Assuming that the maximum value of XMP_Int32
  373|       |	// is 2147483647, then tens_upperbound == 214748364 and ones_upperbound == 7.
  374|       |	// Most of the time, we can just check that value < tens_upperbound to confirm
  375|       |	// that the calculation won't overflow, which makes the bounds checking more
  376|       |	// efficient for the common case.
  377|    596|	const XMP_Int32 tens_upperbound = std::numeric_limits<XMP_Int32>::max() / 10;
  378|    596|	const XMP_Int32 ones_upperbound = std::numeric_limits<XMP_Int32>::max() % 10;
  379|       |
  380|  11.9k|	for ( char ch = strValue[pos]; ('0' <= ch) && (ch <= '9'); ++pos, ch = strValue[pos] ) {
  ------------------
  |  Branch (380:33): [True: 11.6k, False: 273]
  |  Branch (380:48): [True: 11.3k, False: 300]
  ------------------
  381|  11.3k|		const XMP_Int32 digit = ch - '0';
  382|  11.3k|		if (value >= tens_upperbound) {
  ------------------
  |  Branch (382:7): [True: 23, False: 11.3k]
  ------------------
  383|     23|			if (value > tens_upperbound || digit > ones_upperbound) {
  ------------------
  |  Branch (383:8): [True: 23, False: 0]
  |  Branch (383:35): [True: 0, False: 0]
  ------------------
  384|     23|				XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     23|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  385|      0|			}
  386|     23|		}
  387|  11.3k|		value = (value * 10) + digit;
  388|  11.3k|	}
  389|       |
  390|    573|	if ( pos == *_pos ) XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     27|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (390:7): [True: 27, False: 546]
  ------------------
  391|    546|	*_pos = pos;
  392|    546|	return value;
  393|       |
  394|    573|}	// GatherInt
XMPUtils.cpp:_ZL18AdjustTimeOverflowP12XMP_DateTime:
  214|    108|{
  215|    108|	enum { kBillion = 1000*1000*1000L };
  216|       |
  217|       |	// ----------------------------------------------------------------------------------------------
  218|       |	// To be safe against pathalogical overflow we first adjust from month to second, then from
  219|       |	// nanosecond back up to month. This leaves each value closer to zero before propagating into it.
  220|       |	// For example if the hour and minute are both near max, adjusting minutes first can cause the
  221|       |	// hour to overflow.
  222|       |
  223|       |	// ! Photoshop 8 creates "time only" values with zeros for year, month, and day.
  224|       |
  225|    108|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (225:7): [True: 44, False: 64]
  |  Branch (225:28): [True: 0, False: 64]
  |  Branch (225:50): [True: 0, False: 64]
  ------------------
  226|       |
  227|     47|		while ( time->month < 1 ) {
  ------------------
  |  Branch (227:11): [True: 3, False: 44]
  ------------------
  228|      3|			time->year -= 1;
  229|      3|			time->month += 12;
  230|      3|		}
  231|       |
  232|     44|		while ( time->month > 12 ) {
  ------------------
  |  Branch (232:11): [True: 0, False: 44]
  ------------------
  233|      0|			time->year += 1;
  234|      0|			time->month -= 12;
  235|      0|		}
  236|       |
  237|     50|		while ( time->day < 1 ) {
  ------------------
  |  Branch (237:11): [True: 6, False: 44]
  ------------------
  238|      6|			time->month -= 1;
  239|      6|			if ( time->month < 1 ) {	// ! Keep the months in range for indexing daysInMonth!
  ------------------
  |  Branch (239:9): [True: 1, False: 5]
  ------------------
  240|      1|				time->year -= 1;
  241|      1|				time->month += 12;
  242|      1|			}
  243|      6|			time->day += DaysInMonth ( time->year, time->month );	// ! Decrement month before so index here is right!
  244|      6|		}
  245|       |
  246|     44|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (246:11): [True: 0, False: 44]
  ------------------
  247|      0|			time->day -= DaysInMonth ( time->year, time->month );	// ! Increment month after so index here is right!
  248|      0|			time->month += 1;
  249|      0|			if ( time->month > 12 ) {
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|				time->year += 1;
  251|      0|				time->month -= 12;
  252|      0|			}
  253|      0|		}
  254|       |
  255|     44|	}
  256|       |
  257|    110|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (257:10): [True: 2, False: 108]
  ------------------
  258|      2|		time->day -= 1;
  259|      2|		time->hour += 24;
  260|      2|	}
  261|       |
  262|    110|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (262:10): [True: 2, False: 108]
  ------------------
  263|      2|		time->day += 1;
  264|      2|		time->hour -= 24;
  265|      2|	}
  266|       |
  267|    118|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (267:10): [True: 10, False: 108]
  ------------------
  268|     10|		time->hour -= 1;
  269|     10|		time->minute += 60;
  270|     10|	}
  271|       |
  272|    109|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (272:10): [True: 1, False: 108]
  ------------------
  273|      1|		time->hour += 1;
  274|      1|		time->minute -= 60;
  275|      1|	}
  276|       |
  277|    108|	while ( time->second < 0 ) {
  ------------------
  |  Branch (277:10): [True: 0, False: 108]
  ------------------
  278|      0|		time->minute -= 1;
  279|      0|		time->second += 60;
  280|      0|	}
  281|       |
  282|    108|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (282:10): [True: 0, False: 108]
  ------------------
  283|      0|		time->minute += 1;
  284|      0|		time->second -= 60;
  285|      0|	}
  286|       |
  287|    108|	while ( time->nanoSecond < 0 ) {
  ------------------
  |  Branch (287:10): [True: 0, False: 108]
  ------------------
  288|      0|		time->second -= 1;
  289|      0|		time->nanoSecond += kBillion;
  290|      0|	}
  291|       |
  292|    108|	while ( time->nanoSecond >= kBillion ) {
  ------------------
  |  Branch (292:10): [True: 0, False: 108]
  ------------------
  293|      0|		time->second += 1;
  294|      0|		time->nanoSecond -= kBillion;
  295|      0|	}
  296|       |
  297|    108|	while ( time->second < 0 ) {
  ------------------
  |  Branch (297:10): [True: 0, False: 108]
  ------------------
  298|      0|		time->minute -= 1;
  299|      0|		time->second += 60;
  300|      0|	}
  301|       |
  302|    108|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (302:10): [True: 0, False: 108]
  ------------------
  303|      0|		time->minute += 1;
  304|      0|		time->second -= 60;
  305|      0|	}
  306|       |
  307|    108|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (307:10): [True: 0, False: 108]
  ------------------
  308|      0|		time->hour -= 1;
  309|      0|		time->minute += 60;
  310|      0|	}
  311|       |
  312|    108|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (312:10): [True: 0, False: 108]
  ------------------
  313|      0|		time->hour += 1;
  314|      0|		time->minute -= 60;
  315|      0|	}
  316|       |
  317|    109|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (317:10): [True: 1, False: 108]
  ------------------
  318|      1|		time->day -= 1;
  319|      1|		time->hour += 24;
  320|      1|	}
  321|       |
  322|    108|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (322:10): [True: 0, False: 108]
  ------------------
  323|      0|		time->day += 1;
  324|      0|		time->hour -= 24;
  325|      0|	}
  326|       |
  327|    108|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (327:7): [True: 44, False: 64]
  |  Branch (327:28): [True: 0, False: 64]
  |  Branch (327:50): [True: 2, False: 62]
  ------------------
  328|       |
  329|     48|		while ( time->month < 1 ) { // Make sure the months are OK first, for DaysInMonth.
  ------------------
  |  Branch (329:11): [True: 2, False: 46]
  ------------------
  330|      2|			time->year -= 1;
  331|      2|			time->month += 12;
  332|      2|		}
  333|       |
  334|     46|		while ( time->month > 12 ) {
  ------------------
  |  Branch (334:11): [True: 0, False: 46]
  ------------------
  335|      0|			time->year += 1;
  336|      0|			time->month -= 12;
  337|      0|		}
  338|       |
  339|     46|		while ( time->day < 1 ) {
  ------------------
  |  Branch (339:11): [True: 0, False: 46]
  ------------------
  340|      0|			time->month -= 1;
  341|      0|			if ( time->month < 1 ) {
  ------------------
  |  Branch (341:9): [True: 0, False: 0]
  ------------------
  342|      0|				time->year -= 1;
  343|      0|				time->month += 12;
  344|      0|			}
  345|      0|			time->day += DaysInMonth ( time->year, time->month );
  346|      0|		}
  347|       |
  348|     46|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (348:11): [True: 0, False: 46]
  ------------------
  349|      0|			time->day -= DaysInMonth ( time->year, time->month );
  350|      0|			time->month += 1;
  351|      0|			if ( time->month > 12 ) {
  ------------------
  |  Branch (351:9): [True: 0, False: 0]
  ------------------
  352|      0|				time->year += 1;
  353|      0|				time->month -= 12;
  354|      0|			}
  355|      0|		}
  356|       |
  357|     46|	}
  358|       |
  359|    108|}	// AdjustTimeOverflow
XMPUtils.cpp:_ZL11DaysInMonthii:
  195|     96|{
  196|       |
  197|     96|	static short	daysInMonth[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
  198|       |									   // Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
  199|       |
  200|     96|	int days = daysInMonth [ month ];
  201|     96|	if ( (month == 2) && IsLeapYear ( year ) ) days += 1;
  ------------------
  |  Branch (201:7): [True: 8, False: 88]
  |  Branch (201:23): [True: 4, False: 4]
  ------------------
  202|       |
  203|     96|	return days;
  204|       |
  205|     96|}	// DaysInMonth
XMPUtils.cpp:_ZL10IsLeapYearl:
  176|      8|{
  177|       |	// This code uses the Gregorian calendar algorithm:
  178|       |	// https://en.wikipedia.org/wiki/Leap_year#Algorithm
  179|       |
  180|      8|	if ( (year % 4) != 0 ) return false;	// Not a multiple of 4.
  ------------------
  |  Branch (180:7): [True: 4, False: 4]
  ------------------
  181|      4|	if ( (year % 100) != 0 ) return true;	// A multiple of 4 but not a multiple of 100.
  ------------------
  |  Branch (181:7): [True: 4, False: 0]
  ------------------
  182|      0|	if ( (year % 400) == 0 ) return true;	// A multiple of 400.
  ------------------
  |  Branch (182:7): [True: 0, False: 0]
  ------------------
  183|       |
  184|      0|	return false;							// A multiple of 100 but not a multiple of 400.
  185|       |
  186|      0|}	// IsLeapYear

