LLVMFuzzerTestOneInput:
    7|  25.6k|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.6k|  Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
   10|       |
   11|  25.6k|  try {
   12|  25.6k|    Exiv2::DataBuf data_copy(data, size);
   13|  25.6k|    Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(data_copy.c_data(), size);
   14|  25.6k|    assert(image.get() != 0);
   15|       |
   16|  25.6k|    image->readMetadata();
   17|       |
   18|  25.6k|    Exiv2::PreviewManager pm(*image);
   19|  25.6k|    std::ostringstream os;
   20|  25.6k|    Exiv2::PreviewPropertiesList list = pm.getPreviewProperties();
   21|  25.6k|    for (const auto& pos : list) {
  ------------------
  |  Branch (21:26): [True: 9.68k, False: 25.6k]
  ------------------
   22|  9.68k|      os << pos.mimeType_ << "\n";
   23|       |
   24|  9.68k|      if (pos.width_ != 0 && pos.height_ != 0)
  ------------------
  |  Branch (24:11): [True: 6.82k, False: 2.86k]
  |  Branch (24:30): [True: 6.60k, False: 221]
  ------------------
   25|  6.60k|        os << pos.width_ << " " << pos.height_ << " ";
   26|       |
   27|  9.68k|      os << pos.size_ << "\n";
   28|  9.68k|    }
   29|       |
   30|  25.6k|  } catch (...) {
   31|       |    // Exiv2 throws an exception if the metadata is invalid.
   32|  9.19k|  }
   33|       |
   34|  25.6k|  return 0;
   35|  25.6k|}

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

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

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

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

_ZN5Exiv28ExifData5beginEv:
  437|  8.79k|  iterator begin() {
  438|  8.79k|    return exifMetadata_.begin();
  439|  8.79k|  }
_ZN5Exiv28ExifData3endEv:
  441|   405k|  iterator end() {
  442|   405k|    return exifMetadata_.end();
  443|   405k|  }
_ZNK5Exiv28ExifData5beginEv:
  454|  4.41k|  [[nodiscard]] const_iterator begin() const {
  455|  4.41k|    return exifMetadata_.begin();
  456|  4.41k|  }
_ZNK5Exiv28ExifData3endEv:
  458|   706k|  [[nodiscard]] const_iterator end() const {
  459|   706k|    return exifMetadata_.end();
  460|   706k|  }
_ZNK5Exiv28ExifData5emptyEv:
  467|  2.45k|  [[nodiscard]] bool empty() const {
  468|  2.45k|    return exifMetadata_.empty();
  469|  2.45k|  }

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

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

_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.38M|  bool operator==(uint64_t id) const {
   80|  4.38M|    return id == _id;
   81|  4.38M|  }
_ZNK5Exiv28Internal11MatroskaTag9isSkippedEv:
   83|   102k|  [[nodiscard]] bool isSkipped() const {
   84|   102k|    return _process == Skip;
   85|   102k|  }
_ZNK5Exiv28Internal11MatroskaTag11isCompositeEv:
   86|  68.0k|  [[nodiscard]] bool isComposite() const {
   87|  68.0k|    return _process == Composite;
   88|  68.0k|  }

_ZN5Exiv29MetadatumC2Ev:
  261|  2.63M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  5.43M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|  68.0k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  3.93M|  [[nodiscard]] auto begin() noexcept {
  151|  3.93M|    return pData_.begin();
  152|  3.93M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  1.66k|  [[nodiscard]] auto end() noexcept {
  155|  1.66k|    return pData_.end();
  156|  1.66k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  15.4k|  [[nodiscard]] auto begin() const noexcept {
  159|  15.4k|    return pData_.begin();
  160|  15.4k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  15.4k|  [[nodiscard]] auto end() const noexcept {
  163|  15.4k|    return pData_.end();
  164|  15.4k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  1.29M|  [[nodiscard]] size_t size() const {
  167|  1.29M|    return pData_.size();
  168|  1.29M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  20.4k|  [[nodiscard]] bool empty() const {
  195|  20.4k|    return pData_.empty();
  196|  20.4k|  }
_ZN5Exiv27DataBufC2Ev:
  126|   595k|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  34.2k|const T* find(T (&src)[N], const K& key) {
  448|  34.2k|  static_assert(N > 0, "Passed zero length find");
  449|  34.2k|  auto rc = std::find(src, src + N, key);
  450|  34.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 34.2k]
  ------------------
  451|  34.2k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  95.0k|std::string toString(const T& arg) {
  467|  95.0k|  return toStringHelper(arg, std::is_integral<T>());
  468|  95.0k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  95.0k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  95.0k|  return std::to_string(arg);
  457|  95.0k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  3.66M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  3.66M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 2.31M, False: 1.34M]
  ------------------
  229|  2.31M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  2.31M|  }
  231|  1.34M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  3.66M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|  57.2k|const T* find(T (&src)[N], const K& key) {
  448|  57.2k|  static_assert(N > 0, "Passed zero length find");
  449|  57.2k|  auto rc = std::find(src, src + N, key);
  450|  57.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 53.0k, False: 4.18k]
  ------------------
  451|  57.2k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  1.52k|const T* find(T (&src)[N], const K& key) {
  448|  1.52k|  static_assert(N > 0, "Passed zero length find");
  449|  1.52k|  auto rc = std::find(src, src + N, key);
  450|  1.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.24k, False: 277]
  ------------------
  451|  1.52k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|  48.0k|const T* find(T (&src)[N], const K& key) {
  448|  48.0k|  static_assert(N > 0, "Passed zero length find");
  449|  48.0k|  auto rc = std::find(src, src + N, key);
  450|  48.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 36.0k, False: 11.9k]
  ------------------
  451|  48.0k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|   973k|const T* find(T (&src)[N], const K& key) {
  448|   973k|  static_assert(N > 0, "Passed zero length find");
  449|   973k|  auto rc = std::find(src, src + N, key);
  450|   973k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 24, False: 973k]
  ------------------
  451|   973k|}
_ZN5Exiv24findIKNS_8mimeTypeEiLm6EEEPKT_RAT1__S3_RKT0_:
  447|    140|const T* find(T (&src)[N], const K& key) {
  448|    140|  static_assert(N > 0, "Passed zero length find");
  449|    140|  auto rc = std::find(src, src + N, key);
  450|    140|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 134, False: 6]
  ------------------
  451|    140|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  1.76M|const T* find(T (&src)[N], const K& key) {
  448|  1.76M|  static_assert(N > 0, "Passed zero length find");
  449|  1.76M|  auto rc = std::find(src, src + N, key);
  450|  1.76M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 750k, False: 1.01M]
  ------------------
  451|  1.76M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|    144|T stringTo(const std::string& s, bool& ok) {
  483|    144|  std::istringstream is(s);
  484|    144|  T tmp = T();
  485|    144|  ok = static_cast<bool>(is >> tmp);
  486|    144|  std::string rest;
  487|    144|  is >> std::skipws >> rest;
  488|    144|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 50, False: 94]
  ------------------
  489|     50|    ok = false;
  490|    144|  return tmp;
  491|    144|}
_ZN5Exiv28stringToIfEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     74|T stringTo(const std::string& s, bool& ok) {
  483|     74|  std::istringstream is(s);
  484|     74|  T tmp = T();
  485|     74|  ok = static_cast<bool>(is >> tmp);
  486|     74|  std::string rest;
  487|     74|  is >> std::skipws >> rest;
  488|     74|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 42, False: 32]
  ------------------
  489|     42|    ok = false;
  490|     74|  return tmp;
  491|     74|}
_ZN5Exiv28stringToINSt3__14pairIiiEEEET_RKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERb:
  482|     73|T stringTo(const std::string& s, bool& ok) {
  483|     73|  std::istringstream is(s);
  484|     73|  T tmp = T();
  485|     73|  ok = static_cast<bool>(is >> tmp);
  486|     73|  std::string rest;
  487|     73|  is >> std::skipws >> rest;
  488|     73|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 14, False: 59]
  ------------------
  489|     14|    ok = false;
  490|     73|  return tmp;
  491|     73|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  16.3k|std::string toString(const T& arg) {
  467|  16.3k|  return toStringHelper(arg, std::is_integral<T>());
  468|  16.3k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  16.3k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  16.3k|  return std::to_string(arg);
  457|  16.3k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|    948|std::string toString(const T& arg) {
  467|    948|  return toStringHelper(arg, std::is_integral<T>());
  468|    948|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|    948|std::string toStringHelper(const T& arg, std::true_type) {
  456|    948|  return std::to_string(arg);
  457|    948|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   150k|std::string toString(const T& arg) {
  467|   150k|  return toStringHelper(arg, std::is_integral<T>());
  468|   150k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   150k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   150k|  return std::to_string(arg);
  457|   150k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.68k|std::string toString(const T& arg) {
  467|  1.68k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.68k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  1.68k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.68k|  std::ostringstream os;
  462|  1.68k|  os << arg;
  463|  1.68k|  return os.str();
  464|  1.68k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   148k|std::string toString(const T& arg) {
  467|   148k|  return toStringHelper(arg, std::is_integral<T>());
  468|   148k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|   148k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   148k|  std::ostringstream os;
  462|   148k|  os << arg;
  463|   148k|  return os.str();
  464|   148k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  11.7k|std::string toString(const T& arg) {
  467|  11.7k|  return toStringHelper(arg, std::is_integral<T>());
  468|  11.7k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  11.7k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  11.7k|  return std::to_string(arg);
  457|  11.7k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  1.32k|const T* find(T (&src)[N], const K& key) {
  448|  1.32k|  static_assert(N > 0, "Passed zero length find");
  449|  1.32k|  auto rc = std::find(src, src + N, key);
  450|  1.32k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 918, False: 402]
  ------------------
  451|  1.32k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|  1.15k|const T* find(T (&src)[N], const K& key) {
  448|  1.15k|  static_assert(N > 0, "Passed zero length find");
  449|  1.15k|  auto rc = std::find(src, src + N, key);
  450|  1.15k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 501, False: 658]
  ------------------
  451|  1.15k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    417|const T* find(T (&src)[N], const K& key) {
  448|    417|  static_assert(N > 0, "Passed zero length find");
  449|    417|  auto rc = std::find(src, src + N, key);
  450|    417|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 243, False: 174]
  ------------------
  451|    417|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|  69.8k|const T* find(T (&src)[N], const K& key) {
  448|  69.8k|  static_assert(N > 0, "Passed zero length find");
  449|  69.8k|  auto rc = std::find(src, src + N, key);
  450|  69.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.69k, False: 68.2k]
  ------------------
  451|  69.8k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  3.95k|const T* find(T (&src)[N], const K& key) {
  448|  3.95k|  static_assert(N > 0, "Passed zero length find");
  449|  3.95k|  auto rc = std::find(src, src + N, key);
  450|  3.95k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.20k, False: 1.75k]
  ------------------
  451|  3.95k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  11.9k|const T* find(T (&src)[N], const K& key) {
  448|  11.9k|  static_assert(N > 0, "Passed zero length find");
  449|  11.9k|  auto rc = std::find(src, src + N, key);
  450|  11.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 9.61k, False: 2.31k]
  ------------------
  451|  11.9k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  4.89k|const T* find(T (&src)[N], const K& key) {
  448|  4.89k|  static_assert(N > 0, "Passed zero length find");
  449|  4.89k|  auto rc = std::find(src, src + N, key);
  450|  4.89k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.37k, False: 1.51k]
  ------------------
  451|  4.89k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  1.95k|std::string toString(const T& arg) {
  467|  1.95k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.95k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  1.95k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.95k|  std::ostringstream os;
  462|  1.95k|  os << arg;
  463|  1.95k|  return os.str();
  464|  1.95k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.73k|std::string toString(const T& arg) {
  467|  1.73k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.73k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.73k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.73k|  return std::to_string(arg);
  457|  1.73k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|  1.11M|std::string toString(const T& arg) {
  467|  1.11M|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.11M|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|  1.11M|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.11M|  std::ostringstream os;
  462|  1.11M|  os << arg;
  463|  1.11M|  return os.str();
  464|  1.11M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|    370|const T* find(T (&src)[N], const K& key) {
  448|    370|  static_assert(N > 0, "Passed zero length find");
  449|    370|  auto rc = std::find(src, src + N, key);
  450|    370|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 284, False: 86]
  ------------------
  451|    370|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|  4.19k|const T* find(T (&src)[N], const K& key) {
  448|  4.19k|  static_assert(N > 0, "Passed zero length find");
  449|  4.19k|  auto rc = std::find(src, src + N, key);
  450|  4.19k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.66k, False: 1.52k]
  ------------------
  451|  4.19k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|  4.19k|const T* find(T (&src)[N], const K& key) {
  448|  4.19k|  static_assert(N > 0, "Passed zero length find");
  449|  4.19k|  auto rc = std::find(src, src + N, key);
  450|  4.19k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.80k, False: 395]
  ------------------
  451|  4.19k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|  51.1k|const T* find(T (&src)[N], const K& key) {
  448|  51.1k|  static_assert(N > 0, "Passed zero length find");
  449|  51.1k|  auto rc = std::find(src, src + N, key);
  450|  51.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 42.7k, False: 8.32k]
  ------------------
  451|  51.1k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  17.0k|const T* find(T (&src)[N], const K& key) {
  448|  17.0k|  static_assert(N > 0, "Passed zero length find");
  449|  17.0k|  auto rc = std::find(src, src + N, key);
  450|  17.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.66k, False: 12.4k]
  ------------------
  451|  17.0k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  2.74k|const T* find(T (&src)[N], const K& key) {
  448|  2.74k|  static_assert(N > 0, "Passed zero length find");
  449|  2.74k|  auto rc = std::find(src, src + N, key);
  450|  2.74k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.28k, False: 461]
  ------------------
  451|  2.74k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  2.73k|const T* find(T (&src)[N], const K& key) {
  448|  2.73k|  static_assert(N > 0, "Passed zero length find");
  449|  2.73k|  auto rc = std::find(src, src + N, key);
  450|  2.73k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.87k, False: 862]
  ------------------
  451|  2.73k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|    428|const T* find(T (&src)[N], const K& key) {
  448|    428|  static_assert(N > 0, "Passed zero length find");
  449|    428|  auto rc = std::find(src, src + N, key);
  450|    428|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 62, False: 366]
  ------------------
  451|    428|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   485k|const T* find(T (&src)[N], const K& key) {
  448|   485k|  static_assert(N > 0, "Passed zero length find");
  449|   485k|  auto rc = std::find(src, src + N, key);
  450|   485k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 463k, False: 21.7k]
  ------------------
  451|   485k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|  90.9k|const T* find(T (&src)[N], const K& key) {
  448|  90.9k|  static_assert(N > 0, "Passed zero length find");
  449|  90.9k|  auto rc = std::find(src, src + N, key);
  450|  90.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 87.7k, False: 3.16k]
  ------------------
  451|  90.9k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  3.09k|const T* find(T (&src)[N], const K& key) {
  448|  3.09k|  static_assert(N > 0, "Passed zero length find");
  449|  3.09k|  auto rc = std::find(src, src + N, key);
  450|  3.09k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 634, False: 2.46k]
  ------------------
  451|  3.09k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  1.43k|const T* find(T (&src)[N], const K& key) {
  448|  1.43k|  static_assert(N > 0, "Passed zero length find");
  449|  1.43k|  auto rc = std::find(src, src + N, key);
  450|  1.43k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 339, False: 1.09k]
  ------------------
  451|  1.43k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  4.08M|const T* find(T (&src)[N], const K& key) {
  448|  4.08M|  static_assert(N > 0, "Passed zero length find");
  449|  4.08M|  auto rc = std::find(src, src + N, key);
  450|  4.08M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 4.08M]
  ------------------
  451|  4.08M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  1.97M|const T* find(T (&src)[N], const K& key) {
  448|  1.97M|  static_assert(N > 0, "Passed zero length find");
  449|  1.97M|  auto rc = std::find(src, src + N, key);
  450|  1.97M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 1.97M]
  ------------------
  451|  1.97M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  1.01M|const T* find(T (&src)[N], const K& key) {
  448|  1.01M|  static_assert(N > 0, "Passed zero length find");
  449|  1.01M|  auto rc = std::find(src, src + N, key);
  450|  1.01M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.00M, False: 10.8k]
  ------------------
  451|  1.01M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  12.1k|const T* find(T (&src)[N], const K& key) {
  448|  12.1k|  static_assert(N > 0, "Passed zero length find");
  449|  12.1k|  auto rc = std::find(src, src + N, key);
  450|  12.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.82k, False: 7.31k]
  ------------------
  451|  12.1k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|    408|const T* find(T (&src)[N], const K& key) {
  448|    408|  static_assert(N > 0, "Passed zero length find");
  449|    408|  auto rc = std::find(src, src + N, key);
  450|    408|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 157, False: 251]
  ------------------
  451|    408|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     30|T stringTo(const std::string& s, bool& ok) {
  483|     30|  std::istringstream is(s);
  484|     30|  T tmp = T();
  485|     30|  ok = static_cast<bool>(is >> tmp);
  486|     30|  std::string rest;
  487|     30|  is >> std::skipws >> rest;
  488|     30|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 20, False: 10]
  ------------------
  489|     20|    ok = false;
  490|     30|  return tmp;
  491|     30|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     29|const T* find(T (&src)[N], const K& key) {
  448|     29|  static_assert(N > 0, "Passed zero length find");
  449|     29|  auto rc = std::find(src, src + N, key);
  450|     29|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 29, False: 0]
  ------------------
  451|     29|}

_ZNK5Exiv25Value6typeIdEv:
   85|  1.60M|  TypeId typeId() const {
   86|  1.60M|    return type_;
   87|  1.60M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  2.74M|  UniquePtr clone() const {
   94|  2.74M|    return UniquePtr(clone_());
   95|  2.74M|  }
_ZNK5Exiv25Value2okEv:
  181|  3.19k|  bool ok() const {
  182|  3.19k|    return ok_;
  183|  3.19k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  88.4k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  88.4k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 30.6k, False: 57.8k]
  ------------------
  797|  30.6k|      return str1.size() > str2.size();
  798|       |
  799|  57.8k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  57.8k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  88.4k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  57.6k|inline TypeId getType<uint16_t>() {
 1084|  57.6k|  return unsignedShort;
 1085|  57.6k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  3.23k|inline TypeId getType<uint32_t>() {
 1089|  3.23k|  return unsignedLong;
 1090|  3.23k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  6.54k|inline TypeId getType<URational>() {
 1094|  6.54k|  return unsignedRational;
 1095|  6.54k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  13.0k|inline TypeId getType<int16_t>() {
 1099|  13.0k|  return signedShort;
 1100|  13.0k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  9.10k|inline TypeId getType<int32_t>() {
 1104|  9.10k|  return signedLong;
 1105|  9.10k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  3.88k|inline TypeId getType<Rational>() {
 1109|  3.88k|  return signedRational;
 1110|  3.88k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  2.90k|inline TypeId getType<float>() {
 1114|  2.90k|  return tiffFloat;
 1115|  2.90k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  5.24k|inline TypeId getType<double>() {
 1119|  5.24k|  return tiffDouble;
 1120|  5.24k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.39M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.39M|  return getUShort(buf, byteOrder);
 1316|  1.39M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|   560k|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|   560k|  return getULong(buf, byteOrder);
 1321|   560k|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   498k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   498k|  return getURational(buf, byteOrder);
 1326|   498k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   308k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   308k|  return getShort(buf, byteOrder);
 1331|   308k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   100k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   100k|  return getLong(buf, byteOrder);
 1336|   100k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   235k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   235k|  return getRational(buf, byteOrder);
 1341|   235k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  80.7k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  80.7k|  return getFloat(buf, byteOrder);
 1346|  80.7k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|  34.3k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|  34.3k|  return getDouble(buf, byteOrder);
 1351|  34.3k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   163k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   163k|  return us2Data(buf, t, byteOrder);
 1374|   163k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|   112k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|   112k|  return ul2Data(buf, t, byteOrder);
 1382|   112k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|  18.5k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|  18.5k|  return ur2Data(buf, t, byteOrder);
 1390|  18.5k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  13.5k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  13.5k|  return s2Data(buf, t, byteOrder);
 1398|  13.5k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   147k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   147k|  return l2Data(buf, t, byteOrder);
 1406|   147k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  86.9k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  86.9k|  return r2Data(buf, t, byteOrder);
 1414|  86.9k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  20.6k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  20.6k|  return f2Data(buf, t, byteOrder);
 1422|  20.6k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|  5.35k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|  5.35k|  return d2Data(buf, t, byteOrder);
 1430|  5.35k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.82k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.82k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.82k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  6.89k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  6.89k|  return float_to_integer_helper<uint32_t>(n);
 1555|  6.89k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  1.32k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  1.32k|  return float_to_integer_helper<int64_t>(n);
 1560|  1.32k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  4.55k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  4.55k|  return float_to_integer_helper<uint32_t>(n);
 1564|  4.55k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  2.83k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  2.83k|  return rational_to_integer_helper<int64_t>(n);
 1569|  2.83k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  7.27k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  7.27k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  7.27k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  2.02k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  2.02k|  return rational_to_integer_helper<int64_t>(n);
 1578|  2.02k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  4.67k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  4.67k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  4.67k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.82k|  I float_to_integer_helper(size_t n) const {
 1213|  1.82k|    const auto v = value_.at(n);
 1214|  1.82k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.38k, False: 437]
  ------------------
 1215|  1.38k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 881, False: 508]
  ------------------
 1216|    881|      return static_cast<I>(std::lround(v));
 1217|    881|    }
 1218|    945|    return 0;
 1219|  1.82k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  6.89k|  I float_to_integer_helper(size_t n) const {
 1213|  6.89k|    const auto v = value_.at(n);
 1214|  6.89k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.55k, False: 1.33k]
  ------------------
 1215|  5.55k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.85k, False: 2.70k]
  ------------------
 1216|  2.85k|      return static_cast<I>(std::lround(v));
 1217|  2.85k|    }
 1218|  4.04k|    return 0;
 1219|  6.89k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  1.32k|  I float_to_integer_helper(size_t n) const {
 1213|  1.32k|    const auto v = value_.at(n);
 1214|  1.32k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.19k, False: 137]
  ------------------
 1215|  1.19k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 890, False: 301]
  ------------------
 1216|    890|      return static_cast<I>(std::lround(v));
 1217|    890|    }
 1218|    438|    return 0;
 1219|  1.32k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  4.55k|  I float_to_integer_helper(size_t n) const {
 1213|  4.55k|    const auto v = value_.at(n);
 1214|  4.55k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.91k, False: 638]
  ------------------
 1215|  3.91k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.15k, False: 760]
  ------------------
 1216|  3.15k|      return static_cast<I>(std::lround(v));
 1217|  3.15k|    }
 1218|  1.39k|    return 0;
 1219|  4.55k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  2.83k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.83k|    auto a = value_.at(n).first;
 1225|  2.83k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.83k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 837, False: 1.99k]
  ------------------
 1229|    837|      return 0;
 1230|    837|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.99k|#ifdef __cpp_if_constexpr
 1234|  1.99k|    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.99k|      const auto imin = std::numeric_limits<I>::min();
 1240|  1.99k|      const auto imax = std::numeric_limits<I>::max();
 1241|  1.99k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 1.99k]
  |  Branch (1241:23): [True: 0, False: 1.99k]
  |  Branch (1241:35): [True: 0, False: 1.99k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  1.99k|#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.99k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.83k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  7.27k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.27k|    auto a = value_.at(n).first;
 1225|  7.27k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.27k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.91k, False: 5.36k]
  ------------------
 1229|  1.91k|      return 0;
 1230|  1.91k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.36k|#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|  5.36k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  5.36k|      const auto imax = std::numeric_limits<I>::max();
 1257|  5.36k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 638, False: 4.72k]
  ------------------
 1258|    638|        return 0;
 1259|    638|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  4.72k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  4.72k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  4.72k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 4.72k]
  |  Branch (1263:25): [True: 0, False: 4.72k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  4.72k|    }
 1267|       |
 1268|  4.72k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.27k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  2.02k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.02k|    auto a = value_.at(n).first;
 1225|  2.02k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.02k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 394, False: 1.63k]
  ------------------
 1229|    394|      return 0;
 1230|    394|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.63k|#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.63k|    } 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.63k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  1.63k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 1.63k]
  |  Branch (1251:23): [True: 0, False: 1.63k]
  ------------------
 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.63k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.02k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  4.67k|  I rational_to_integer_helper(size_t n) const {
 1224|  4.67k|    auto a = value_.at(n).first;
 1225|  4.67k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  4.67k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 702, False: 3.97k]
  ------------------
 1229|    702|      return 0;
 1230|    702|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  3.97k|#ifdef __cpp_if_constexpr
 1234|  3.97k|    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|  3.97k|      const auto imin = std::numeric_limits<I>::min();
 1240|  3.97k|      const auto imax = std::numeric_limits<I>::max();
 1241|  3.97k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 3.97k]
  |  Branch (1241:23): [True: 0, False: 3.97k]
  |  Branch (1241:35): [True: 0, False: 3.97k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  3.97k|#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|  3.97k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  4.67k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  57.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  57.6k|}
_ZN5Exiv25ValueD2Ev:
   43|  3.85M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  55.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  55.7k|  value_.clear();
 1469|  55.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  55.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 55.7k, False: 0]
  |  Branch (1470:17): [True: 628, False: 55.1k]
  ------------------
 1471|    628|    len = (len / ts) * ts;
 1472|  1.45M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.39M, False: 55.7k]
  ------------------
 1473|  1.39M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.39M|  }
 1475|  55.7k|  return 0;
 1476|  55.7k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.86k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.86k|  std::istringstream is(buf);
 1481|  1.86k|  T tmp;
 1482|  1.86k|  ValueList val;
 1483|  3.94k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 2.07k, False: 1.86k]
  ------------------
 1484|  2.07k|    val.push_back(tmp);
 1485|  1.86k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 1.86k]
  ------------------
 1486|      0|    return 1;
 1487|  1.86k|  value_ = std::move(val);
 1488|  1.86k|  return 0;
 1489|  1.86k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.55k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.55k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.00k, False: 555]
  ------------------
 1651|  1.00k|    pDataArea_ = Blob(buf, buf + len);
 1652|    555|  else
 1653|    555|    pDataArea_.clear();
 1654|  1.55k|  return 0;
 1655|  1.55k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  6.12k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.12k|  size_t offset = 0;
 1494|   163k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 163k, False: 6.12k]
  ------------------
 1495|   163k|    offset += toData(buf + offset, val, byteOrder);
 1496|   163k|  }
 1497|  6.12k|  return offset;
 1498|  6.12k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   674k|size_t ValueType<T>::count() const {
 1502|   674k|  return value_.size();
 1503|   674k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  13.3k|size_t ValueType<T>::size() const {
 1507|  13.3k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  13.3k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    512|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    512|  auto end = value_.end();
 1518|    512|  auto i = value_.begin();
 1519|   137k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 136k, False: 512]
  ------------------
 1520|   136k|    os << std::setprecision(15) << *i;
 1521|   136k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 136k, False: 299]
  ------------------
 1522|   136k|      os << " ";
 1523|   136k|  }
 1524|    512|  return os;
 1525|    512|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   585k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   585k|  ok_ = true;
 1537|   585k|  return static_cast<int64_t>(value_.at(n));
 1538|   585k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   595k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   595k|  ok_ = true;
 1542|   595k|  return static_cast<uint32_t>(value_.at(n));
 1543|   595k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  5.94k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.94k|  return pDataArea_.size();
 1641|  5.94k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    693|DataBuf ValueType<T>::dataArea() const {
 1645|    693|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    693|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   133k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   133k|  return new ValueType<T>(*this);
 1513|   133k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   133k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   133k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.60k, False: 129k]
  ------------------
 1449|  3.60k|    pDataArea_ = rhs.pDataArea_;
 1450|   133k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  2.36M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  45.4k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  45.4k|  value_.clear();
 1469|  45.4k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  45.4k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 45.4k, False: 0]
  |  Branch (1470:17): [True: 36, False: 45.4k]
  ------------------
 1471|     36|    len = (len / ts) * ts;
 1472|   605k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 560k, False: 45.4k]
  ------------------
 1473|   560k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   560k|  }
 1475|  45.4k|  return 0;
 1476|  45.4k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    473|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    473|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 355, False: 118]
  ------------------
 1651|    355|    pDataArea_ = Blob(buf, buf + len);
 1652|    118|  else
 1653|    118|    pDataArea_.clear();
 1654|    473|  return 0;
 1655|    473|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  15.0k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  15.0k|  size_t offset = 0;
 1494|   112k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 112k, False: 15.0k]
  ------------------
 1495|   112k|    offset += toData(buf + offset, val, byteOrder);
 1496|   112k|  }
 1497|  15.0k|  return offset;
 1498|  15.0k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   116k|size_t ValueType<T>::count() const {
 1502|   116k|  return value_.size();
 1503|   116k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  31.1k|size_t ValueType<T>::size() const {
 1507|  31.1k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  31.1k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  4.04k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  4.04k|  auto end = value_.end();
 1518|  4.04k|  auto i = value_.begin();
 1519|  21.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 17.5k, False: 4.04k]
  ------------------
 1520|  17.5k|    os << std::setprecision(15) << *i;
 1521|  17.5k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 13.7k, False: 3.78k]
  ------------------
 1522|  13.7k|      os << " ";
 1523|  17.5k|  }
 1524|  4.04k|  return os;
 1525|  4.04k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  13.0k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  13.0k|  ok_ = true;
 1537|  13.0k|  return static_cast<int64_t>(value_.at(n));
 1538|  13.0k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  83.4k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  83.4k|  ok_ = true;
 1542|  83.4k|  return static_cast<uint32_t>(value_.at(n));
 1543|  83.4k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  5.17k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.17k|  return pDataArea_.size();
 1641|  5.17k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    322|DataBuf ValueType<T>::dataArea() const {
 1645|    322|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    322|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   127k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   127k|  return new ValueType<T>(*this);
 1513|   127k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   127k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   127k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.39k, False: 125k]
  ------------------
 1449|  1.39k|    pDataArea_ = rhs.pDataArea_;
 1450|   127k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  6.54k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  6.54k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  6.52k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  6.52k|  value_.clear();
 1469|  6.52k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  6.52k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 6.52k, False: 0]
  |  Branch (1470:17): [True: 0, False: 6.52k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   505k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 498k, False: 6.52k]
  ------------------
 1473|   498k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   498k|  }
 1475|  6.52k|  return 0;
 1476|  6.52k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    446|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    446|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 246, False: 200]
  ------------------
 1651|    246|    pDataArea_ = Blob(buf, buf + len);
 1652|    200|  else
 1653|    200|    pDataArea_.clear();
 1654|    446|  return 0;
 1655|    446|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  1.62k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.62k|  size_t offset = 0;
 1494|  18.5k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 18.5k, False: 1.62k]
  ------------------
 1495|  18.5k|    offset += toData(buf + offset, val, byteOrder);
 1496|  18.5k|  }
 1497|  1.62k|  return offset;
 1498|  1.62k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  14.7k|size_t ValueType<T>::count() const {
 1502|  14.7k|  return value_.size();
 1503|  14.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  4.23k|size_t ValueType<T>::size() const {
 1507|  4.23k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.23k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    530|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    530|  auto end = value_.end();
 1518|    530|  auto i = value_.begin();
 1519|  5.01k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.48k, False: 530]
  ------------------
 1520|  4.48k|    os << std::setprecision(15) << *i;
 1521|  4.48k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.17k, False: 309]
  ------------------
 1522|  4.17k|      os << " ";
 1523|  4.48k|  }
 1524|    530|  return os;
 1525|    530|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  2.29k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.29k|  return pDataArea_.size();
 1641|  2.29k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|     10|DataBuf ValueType<T>::dataArea() const {
 1645|     10|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     10|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  20.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  20.7k|  return new ValueType<T>(*this);
 1513|  20.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  20.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  20.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 592, False: 20.1k]
  ------------------
 1449|    592|    pDataArea_ = rhs.pDataArea_;
 1450|  20.7k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  13.0k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  13.0k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  5.52k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.52k|  value_.clear();
 1469|  5.52k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.52k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.52k, False: 0]
  |  Branch (1470:17): [True: 64, False: 5.45k]
  ------------------
 1471|     64|    len = (len / ts) * ts;
 1472|   313k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 308k, False: 5.52k]
  ------------------
 1473|   308k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   308k|  }
 1475|  5.52k|  return 0;
 1476|  5.52k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  7.49k|int ValueType<T>::read(const std::string& buf) {
 1480|  7.49k|  std::istringstream is(buf);
 1481|  7.49k|  T tmp;
 1482|  7.49k|  ValueList val;
 1483|   179k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 171k, False: 7.49k]
  ------------------
 1484|   171k|    val.push_back(tmp);
 1485|  7.49k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 7.49k]
  ------------------
 1486|      0|    return 1;
 1487|  7.49k|  value_ = std::move(val);
 1488|  7.49k|  return 0;
 1489|  7.49k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|  1.15k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.15k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 857, False: 300]
  ------------------
 1651|    857|    pDataArea_ = Blob(buf, buf + len);
 1652|    300|  else
 1653|    300|    pDataArea_.clear();
 1654|  1.15k|  return 0;
 1655|  1.15k|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  1.95k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.95k|  size_t offset = 0;
 1494|  13.5k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 13.5k, False: 1.95k]
  ------------------
 1495|  13.5k|    offset += toData(buf + offset, val, byteOrder);
 1496|  13.5k|  }
 1497|  1.95k|  return offset;
 1498|  1.95k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  18.7k|size_t ValueType<T>::count() const {
 1502|  18.7k|  return value_.size();
 1503|  18.7k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  4.50k|size_t ValueType<T>::size() const {
 1507|  4.50k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.50k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    395|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    395|  auto end = value_.end();
 1518|    395|  auto i = value_.begin();
 1519|   526k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 526k, False: 395]
  ------------------
 1520|   526k|    os << std::setprecision(15) << *i;
 1521|   526k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 526k, False: 323]
  ------------------
 1522|   526k|      os << " ";
 1523|   526k|  }
 1524|    395|  return os;
 1525|    395|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|    461|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|    461|  ok_ = true;
 1537|    461|  return static_cast<int64_t>(value_.at(n));
 1538|    461|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  7.19k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  7.19k|  ok_ = true;
 1542|  7.19k|  return static_cast<uint32_t>(value_.at(n));
 1543|  7.19k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  3.25k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.25k|  return pDataArea_.size();
 1641|  3.25k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    614|DataBuf ValueType<T>::dataArea() const {
 1645|    614|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    614|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  26.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  26.3k|  return new ValueType<T>(*this);
 1513|  26.3k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  26.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  26.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.51k, False: 23.8k]
  ------------------
 1449|  2.51k|    pDataArea_ = rhs.pDataArea_;
 1450|  26.3k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  9.10k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  9.10k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  9.10k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  9.10k|  value_.clear();
 1469|  9.10k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  9.10k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 9.10k, False: 0]
  |  Branch (1470:17): [True: 92, False: 9.01k]
  ------------------
 1471|     92|    len = (len / ts) * ts;
 1472|   109k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 100k, False: 9.10k]
  ------------------
 1473|   100k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   100k|  }
 1475|  9.10k|  return 0;
 1476|  9.10k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    453|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    453|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 290, False: 163]
  ------------------
 1651|    290|    pDataArea_ = Blob(buf, buf + len);
 1652|    163|  else
 1653|    163|    pDataArea_.clear();
 1654|    453|  return 0;
 1655|    453|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  4.87k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  4.87k|  size_t offset = 0;
 1494|   147k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 147k, False: 4.87k]
  ------------------
 1495|   147k|    offset += toData(buf + offset, val, byteOrder);
 1496|   147k|  }
 1497|  4.87k|  return offset;
 1498|  4.87k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  19.4k|size_t ValueType<T>::count() const {
 1502|  19.4k|  return value_.size();
 1503|  19.4k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|  10.6k|size_t ValueType<T>::size() const {
 1507|  10.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  10.6k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    519|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    519|  auto end = value_.end();
 1518|    519|  auto i = value_.begin();
 1519|  13.4k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 12.9k, False: 519]
  ------------------
 1520|  12.9k|    os << std::setprecision(15) << *i;
 1521|  12.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 12.6k, False: 302]
  ------------------
 1522|  12.6k|      os << " ";
 1523|  12.9k|  }
 1524|    519|  return os;
 1525|    519|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  1.88k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  1.88k|  ok_ = true;
 1537|  1.88k|  return static_cast<int64_t>(value_.at(n));
 1538|  1.88k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  5.25k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  5.25k|  ok_ = true;
 1542|  5.25k|  return static_cast<uint32_t>(value_.at(n));
 1543|  5.25k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  1.67k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.67k|  return pDataArea_.size();
 1641|  1.67k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    191|DataBuf ValueType<T>::dataArea() const {
 1645|    191|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    191|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  31.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  31.3k|  return new ValueType<T>(*this);
 1513|  31.3k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  31.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  31.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 936, False: 30.4k]
  ------------------
 1449|    936|    pDataArea_ = rhs.pDataArea_;
 1450|  31.3k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  3.88k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.88k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  3.88k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  3.88k|  value_.clear();
 1469|  3.88k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  3.88k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 3.88k, False: 0]
  |  Branch (1470:17): [True: 0, False: 3.88k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   239k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 235k, False: 3.88k]
  ------------------
 1473|   235k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   235k|  }
 1475|  3.88k|  return 0;
 1476|  3.88k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    521|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    521|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 146, False: 375]
  ------------------
 1651|    146|    pDataArea_ = Blob(buf, buf + len);
 1652|    375|  else
 1653|    375|    pDataArea_.clear();
 1654|    521|  return 0;
 1655|    521|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  2.89k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.89k|  size_t offset = 0;
 1494|  86.9k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 86.9k, False: 2.89k]
  ------------------
 1495|  86.9k|    offset += toData(buf + offset, val, byteOrder);
 1496|  86.9k|  }
 1497|  2.89k|  return offset;
 1498|  2.89k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  12.8k|size_t ValueType<T>::count() const {
 1502|  12.8k|  return value_.size();
 1503|  12.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  6.50k|size_t ValueType<T>::size() const {
 1507|  6.50k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  6.50k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    510|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    510|  auto end = value_.end();
 1518|    510|  auto i = value_.begin();
 1519|  8.51M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 8.51M, False: 510]
  ------------------
 1520|  8.51M|    os << std::setprecision(15) << *i;
 1521|  8.51M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 8.51M, False: 282]
  ------------------
 1522|  8.51M|      os << " ";
 1523|  8.51M|  }
 1524|    510|  return os;
 1525|    510|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|    566|size_t ValueType<T>::sizeDataArea() const {
 1640|    566|  return pDataArea_.size();
 1641|    566|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     15|DataBuf ValueType<T>::dataArea() const {
 1645|     15|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     15|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  15.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  15.5k|  return new ValueType<T>(*this);
 1513|  15.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  15.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  15.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 111, False: 15.4k]
  ------------------
 1449|    111|    pDataArea_ = rhs.pDataArea_;
 1450|  15.5k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  2.90k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.90k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  2.90k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  2.90k|  value_.clear();
 1469|  2.90k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  2.90k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 2.90k, False: 0]
  |  Branch (1470:17): [True: 0, False: 2.90k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  83.6k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 80.7k, False: 2.90k]
  ------------------
 1473|  80.7k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  80.7k|  }
 1475|  2.90k|  return 0;
 1476|  2.90k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    266|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    266|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 107, False: 159]
  ------------------
 1651|    107|    pDataArea_ = Blob(buf, buf + len);
 1652|    159|  else
 1653|    159|    pDataArea_.clear();
 1654|    266|  return 0;
 1655|    266|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  1.41k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.41k|  size_t offset = 0;
 1494|  20.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 20.6k, False: 1.41k]
  ------------------
 1495|  20.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  20.6k|  }
 1497|  1.41k|  return offset;
 1498|  1.41k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  9.30k|size_t ValueType<T>::count() const {
 1502|  9.30k|  return value_.size();
 1503|  9.30k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  3.74k|size_t ValueType<T>::size() const {
 1507|  3.74k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  3.74k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    608|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    608|  auto end = value_.end();
 1518|    608|  auto i = value_.begin();
 1519|  23.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 22.9k, False: 608]
  ------------------
 1520|  22.9k|    os << std::setprecision(15) << *i;
 1521|  22.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 22.5k, False: 398]
  ------------------
 1522|  22.5k|      os << " ";
 1523|  22.9k|  }
 1524|    608|  return os;
 1525|    608|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|    225|size_t ValueType<T>::sizeDataArea() const {
 1640|    225|  return pDataArea_.size();
 1641|    225|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|      9|DataBuf ValueType<T>::dataArea() const {
 1645|      9|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      9|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  10.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  10.6k|  return new ValueType<T>(*this);
 1513|  10.6k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  10.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  10.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 171, False: 10.5k]
  ------------------
 1449|    171|    pDataArea_ = rhs.pDataArea_;
 1450|  10.6k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  5.24k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.24k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  5.24k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.24k|  value_.clear();
 1469|  5.24k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.24k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.24k, False: 0]
  |  Branch (1470:17): [True: 0, False: 5.24k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  39.6k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 34.3k, False: 5.24k]
  ------------------
 1473|  34.3k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  34.3k|  }
 1475|  5.24k|  return 0;
 1476|  5.24k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    381|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    381|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 147, False: 234]
  ------------------
 1651|    147|    pDataArea_ = Blob(buf, buf + len);
 1652|    234|  else
 1653|    234|    pDataArea_.clear();
 1654|    381|  return 0;
 1655|    381|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|    919|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    919|  size_t offset = 0;
 1494|  5.35k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 5.35k, False: 919]
  ------------------
 1495|  5.35k|    offset += toData(buf + offset, val, byteOrder);
 1496|  5.35k|  }
 1497|    919|  return offset;
 1498|    919|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  14.5k|size_t ValueType<T>::count() const {
 1502|  14.5k|  return value_.size();
 1503|  14.5k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  2.06k|size_t ValueType<T>::size() const {
 1507|  2.06k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.06k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    358|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    358|  auto end = value_.end();
 1518|    358|  auto i = value_.begin();
 1519|  1.00k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 643, False: 358]
  ------------------
 1520|    643|    os << std::setprecision(15) << *i;
 1521|    643|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 487, False: 156]
  ------------------
 1522|    487|      os << " ";
 1523|    643|  }
 1524|    358|  return os;
 1525|    358|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  1.67k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.67k|  return pDataArea_.size();
 1641|  1.67k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|      6|DataBuf ValueType<T>::dataArea() const {
 1645|      6|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      6|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  14.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  14.5k|  return new ValueType<T>(*this);
 1513|  14.5k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  14.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  14.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 527, False: 14.0k]
  ------------------
 1449|    527|    pDataArea_ = rhs.pDataArea_;
 1450|  14.5k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|  4.51M|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  3.23k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.23k|}

_ZNK5Exiv27XmpData9usePacketEv:
  216|  4.38k|  [[nodiscard]] bool usePacket() const {
  217|  4.38k|    return usePacket_;
  218|  4.38k|  }
_ZN5Exiv27XmpData9usePacketEb:
  221|  44.6k|  bool usePacket(bool b) {
  222|  44.6k|    bool r = usePacket_;
  223|  44.6k|    usePacket_ = b;
  224|  44.6k|    return r;
  225|  44.6k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  227|  44.6k|  void setPacket(std::string xmpPacket) {
  228|  44.6k|    xmpPacket_ = std::move(xmpPacket);
  229|  44.6k|    usePacket(false);
  230|  44.6k|  }
_ZN5Exiv27XmpDataC2Ev:
  140|  39.2k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  395|  25.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  25.6k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  25.6k|  return *this;
  405|  25.6k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  395|   148k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   148k|    setValue(Exiv2::toString(value));
  404|   148k|  return *this;
  405|   148k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  395|  11.7k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  11.7k|    setValue(Exiv2::toString(value));
  404|  11.7k|  return *this;
  405|  11.7k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  395|  16.3k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  16.3k|    setValue(Exiv2::toString(value));
  404|  16.3k|  return *this;
  405|  16.3k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  395|  1.95k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  1.95k|    setValue(Exiv2::toString(value));
  404|  1.95k|  return *this;
  405|  1.95k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  395|  2.99k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  2.99k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  2.99k|  return *this;
  405|  2.99k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  395|  1.73k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  1.73k|    setValue(Exiv2::toString(value));
  404|  1.73k|  return *this;
  405|  1.73k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  395|  1.68k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  1.68k|    setValue(Exiv2::toString(value));
  404|  1.68k|  return *this;
  405|  1.68k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  395|    314|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|    314|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    314|  return *this;
  405|    314|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  395|  95.0k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  95.0k|    setValue(Exiv2::toString(value));
  404|  95.0k|  return *this;
  405|  95.0k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  395|    948|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|    948|    setValue(Exiv2::toString(value));
  404|    948|  return *this;
  405|    948|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  395|   144k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   144k|    setValue(Exiv2::toString(value));
  404|   144k|  return *this;
  405|   144k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  395|  28.3k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  28.3k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  28.3k|  return *this;
  405|  28.3k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  395|   150k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   150k|    setValue(Exiv2::toString(value));
  404|   150k|  return *this;
  405|   150k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  395|    435|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|    435|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    435|  return *this;
  405|    435|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  9.90k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  9.90k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 2.13k, False: 7.76k]
  |  Branch (43:36): [True: 2.10k, False: 26]
  |  Branch (43:62): [True: 2.09k, False: 12]
  |  Branch (43:88): [True: 2.08k, False: 11]
  ------------------
   44|  9.90k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  12.0k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  12.0k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  12.0k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  12.0k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  12.0k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  12.0k|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  14.5k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  14.5k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 10.8k, False: 3.73k]
  ------------------
   63|  10.8k|    return data1_ < other.data1_;
   64|  3.73k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 91, False: 3.64k]
  ------------------
   65|     91|    return data2_ < other.data2_;
   66|  3.64k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 49, False: 3.59k]
  ------------------
   67|     49|    return data3_ < other.data3_;
   68|  3.59k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  3.64k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  183|    695|    Image(ImageType::asf, mdNone, std::move(io), params), max_recursion_depth_(params.max_recursion_depth()) {
  184|    695|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  186|    713|std::string AsfVideo::mimeType() const {
  187|    713|  return "video/asf";
  188|    713|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  193|    695|void AsfVideo::readMetadata() {
  194|    695|  if (io_->open() != 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 695]
  ------------------
  195|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  196|       |
  197|       |  // Ensure that this is the correct image type
  198|    695|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 695]
  ------------------
  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|    695|  IoCloser closer(*io_);
  205|    695|  clearMetadata();
  206|    695|  io_->seek(0, BasicIo::beg);
  207|    695|  height_ = width_ = 1;
  208|       |
  209|    695|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  210|    695|  xmpData()["Xmp.video.MimeType"] = mimeType();
  211|       |
  212|    695|  decodeBlock(0);
  213|       |
  214|    695|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  215|    695|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  217|  2.29k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  218|  2.29k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (218:7): [True: 2.29k, False: 0]
  ------------------
  219|  2.29k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  220|       |
  221|  2.29k|    size_ = readQWORDTag(io);
  222|  2.29k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (222:9): [True: 431, False: 1.86k]
  ------------------
  223|    431|      remaining_size_ = size_ - GUID - QWORD;
  224|  2.29k|  }
  225|  2.29k|}
_ZN5Exiv28AsfVideo11decodeBlockEm:
  227|  2.36k|void AsfVideo::decodeBlock(size_t depth) {
  228|  2.36k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  229|  2.36k|  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.36k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  235|  2.36k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  236|       |
  237|  2.36k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (237:7): [True: 1.78k, False: 588]
  ------------------
  238|  1.78k|    if (tag->second == "Header")
  ------------------
  |  Branch (238:9): [True: 1.22k, False: 559]
  ------------------
  239|  1.22k|      decodeHeader(depth + 1);
  240|    559|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (240:14): [True: 0, False: 559]
  ------------------
  241|      0|      fileProperties();
  242|    559|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (242:14): [True: 0, False: 559]
  ------------------
  243|      0|      streamProperties();
  244|    559|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (244:14): [True: 0, False: 559]
  ------------------
  245|      0|      headerExtension();
  246|    559|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (246:14): [True: 0, False: 559]
  ------------------
  247|      0|      codecList();
  248|    559|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (248:14): [True: 0, False: 559]
  ------------------
  249|      0|      extendedContentDescription();
  250|    559|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (250:14): [True: 535, False: 24]
  ------------------
  251|    535|      contentDescription();
  252|     24|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (252:14): [True: 0, False: 24]
  ------------------
  253|      0|      extendedStreamProperties();
  254|     24|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (254:14): [True: 0, False: 24]
  ------------------
  255|      0|      DegradableJPEGMedia();
  256|     24|    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|     24|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  260|     24|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|     24|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  262|     24|    }
  263|  1.78k|  } 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|    588|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  267|    588|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  268|    588|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  269|    588|  }
  270|       |
  271|  2.36k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEm:
  273|  1.22k|void AsfVideo::decodeHeader(size_t depth) {
  274|  1.22k|  Internal::enforce(depth <= max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|  1.22k|  DataBuf nbHeadersBuf(DWORD + 1);
  276|  1.22k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  277|       |
  278|  1.22k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  279|  1.22k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  1.22k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  281|  1.22k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  282|  2.89k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (282:24): [True: 1.67k, False: 1.22k]
  ------------------
  283|  1.67k|    decodeBlock(depth);
  284|  1.67k|  }
  285|  1.22k|}
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  432|    535|void AsfVideo::contentDescription() {
  433|    535|  uint16_t title_length = readWORDTag(io_);
  434|    535|  uint16_t author_length = readWORDTag(io_);
  435|    535|  uint16_t copyright_length = readWORDTag(io_);
  436|    535|  uint16_t desc_length = readWORDTag(io_);
  437|    535|  uint16_t rating_length = readWORDTag(io_);
  438|       |
  439|    535|  if (title_length)
  ------------------
  |  Branch (439:7): [True: 307, False: 228]
  ------------------
  440|    307|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  441|       |
  442|    535|  if (author_length)
  ------------------
  |  Branch (442:7): [True: 258, False: 277]
  ------------------
  443|    258|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  444|       |
  445|    535|  if (copyright_length)
  ------------------
  |  Branch (445:7): [True: 326, False: 209]
  ------------------
  446|    326|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  447|       |
  448|    535|  if (desc_length)
  ------------------
  |  Branch (448:7): [True: 261, False: 274]
  ------------------
  449|    261|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  450|       |
  451|    535|  if (rating_length)
  ------------------
  |  Branch (451:7): [True: 299, False: 236]
  ------------------
  452|    299|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  453|       |
  454|    535|}  // AsfVideo::extendedContentDescription
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  472|    695|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  473|    695|  auto image = std::make_unique<AsfVideo>(std::move(io), params);
  474|    695|  if (!image->good()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 695]
  ------------------
  475|      0|    return nullptr;
  476|      0|  }
  477|    695|  return image;
  478|    695|}
_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: 297, False: 9.90k]
  ------------------
  485|    297|    return false;
  486|    297|  }
  487|       |
  488|  9.90k|  bool matched = isASFType(buf);
  489|  9.90k|  if (!advance || !matched) {
  ------------------
  |  Branch (489:7): [True: 9.90k, False: 0]
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|  9.90k|    iIo.seek(0, BasicIo::beg);
  491|  9.90k|  }
  492|       |
  493|  9.90k|  return matched;
  494|  10.1k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  9.90k|static bool isASFType(const byte buf[]) {
  179|  9.90k|  return Header == AsfVideo::GUIDTag(buf);
  180|  9.90k|}

_ZN5Exiv27BasicIoD2Ev:
   60|  43.9k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   62|  2.84M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   63|  2.84M|  const size_t nread = read(buf, rcount);
   64|  2.84M|  Internal::enforce(nread == rcount, err);
   65|  2.84M|  Internal::enforce(!error(), err);
   66|  2.84M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   68|  14.8k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   69|  14.8k|  const int r = seek(offset, pos);
   70|  14.8k|  Internal::enforce(r == 0, err);
   71|  14.8k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  624|  35.2k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  625|  35.2k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  678|   351k|void MemIo::Impl::reserve(size_t wcount) {
  679|   351k|  const size_t need = wcount + idx_;
  680|   351k|  size_t blockSize = 32 * 1024;  // 32768
  681|   351k|  const size_t maxBlockSize = 4 * 1024 * 1024;
  682|       |
  683|   351k|  if (!isMalloced_) {
  ------------------
  |  Branch (683:7): [True: 4.38k, False: 347k]
  ------------------
  684|       |    // Minimum size for 1st block
  685|  4.38k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  686|  4.38k|    auto data = static_cast<byte*>(std::malloc(size));
  687|  4.38k|    if (!data) {
  ------------------
  |  Branch (687:9): [True: 0, False: 4.38k]
  ------------------
  688|      0|      throw Error(ErrorCode::kerMallocFailed);
  689|      0|    }
  690|  4.38k|    if (data_) {
  ------------------
  |  Branch (690:9): [True: 0, False: 4.38k]
  ------------------
  691|      0|      std::memcpy(data, data_, size_);
  692|      0|    }
  693|  4.38k|    data_ = data;
  694|  4.38k|    sizeAlloced_ = size;
  695|  4.38k|    isMalloced_ = true;
  696|  4.38k|  }
  697|       |
  698|   351k|  if (need > size_) {
  ------------------
  |  Branch (698:7): [True: 335k, False: 15.9k]
  ------------------
  699|   335k|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (699:9): [True: 109, False: 335k]
  ------------------
  700|    109|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  701|       |      // Allocate in blocks
  702|    109|      size_t want = blockSize * (1 + need / blockSize);
  703|    109|      data_ = static_cast<byte*>(std::realloc(data_, want));
  704|    109|      if (!data_) {
  ------------------
  |  Branch (704:11): [True: 0, False: 109]
  ------------------
  705|      0|        throw Error(ErrorCode::kerMallocFailed);
  706|      0|      }
  707|    109|      sizeAlloced_ = want;
  708|    109|    }
  709|   335k|    size_ = need;
  710|   335k|  }
  711|   351k|}
_ZN5Exiv25MemIoC2Ev:
  713|  8.76k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  714|  8.76k|}
_ZN5Exiv25MemIoC2EPKhm:
  716|  35.2k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  717|  35.2k|}
_ZN5Exiv25MemIoD2Ev:
  719|  43.9k|MemIo::~MemIo() {
  720|  43.9k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (720:7): [True: 4.38k, False: 39.6k]
  ------------------
  721|  4.38k|    std::free(p_->data_);
  722|  4.38k|  }
  723|  43.9k|}
_ZN5Exiv25MemIo5writeEPKhm:
  725|   346k|size_t MemIo::write(const byte* data, size_t wcount) {
  726|   346k|  p_->reserve(wcount);
  727|   346k|  if (data) {
  ------------------
  |  Branch (727:7): [True: 330k, False: 15.9k]
  ------------------
  728|   330k|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  729|   330k|  }
  730|   346k|  p_->idx_ += wcount;
  731|   346k|  return wcount;
  732|   346k|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  734|  4.29k|void MemIo::transfer(BasicIo& src) {
  735|  4.29k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (735:12): [True: 4.29k, False: 0]
  ------------------
  736|       |    // Optimization if src is another instance of MemIo
  737|  4.29k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (737:9): [True: 0, False: 4.29k]
  ------------------
  738|      0|      std::free(p_->data_);
  739|      0|    }
  740|  4.29k|    p_->idx_ = 0;
  741|  4.29k|    p_->data_ = memIo->p_->data_;
  742|  4.29k|    p_->size_ = memIo->p_->size_;
  743|  4.29k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  744|  4.29k|    memIo->p_->idx_ = 0;
  745|  4.29k|    memIo->p_->data_ = nullptr;
  746|  4.29k|    memIo->p_->size_ = 0;
  747|  4.29k|    memIo->p_->isMalloced_ = false;
  748|  4.29k|  } else {
  749|       |    // Generic reopen to reset position to start
  750|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (750:9): [True: 0, False: 0]
  ------------------
  751|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  752|      0|    }
  753|      0|    p_->idx_ = 0;
  754|      0|    write(src);
  755|      0|    src.close();
  756|      0|  }
  757|  4.29k|  if (error() || src.error())
  ------------------
  |  Branch (757:7): [True: 0, False: 4.29k]
  |  Branch (757:18): [True: 0, False: 4.29k]
  ------------------
  758|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  759|  4.29k|}
_ZN5Exiv25MemIo4putbEh:
  779|  5.28k|int MemIo::putb(byte data) {
  780|  5.28k|  p_->reserve(1);
  781|  5.28k|  p_->data_[p_->idx_++] = data;
  782|  5.28k|  return data;
  783|  5.28k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  785|   889k|int MemIo::seek(int64_t offset, Position pos) {
  786|   889k|  int64_t newIdx = 0;
  787|       |
  788|   889k|  switch (pos) {
  ------------------
  |  Branch (788:11): [True: 889k, False: 0]
  ------------------
  789|   651k|    case BasicIo::cur:
  ------------------
  |  Branch (789:5): [True: 651k, False: 238k]
  ------------------
  790|   651k|      newIdx = p_->idx_ + offset;
  791|   651k|      break;
  792|   238k|    case BasicIo::beg:
  ------------------
  |  Branch (792:5): [True: 238k, False: 651k]
  ------------------
  793|   238k|      newIdx = offset;
  794|   238k|      break;
  795|    149|    case BasicIo::end:
  ------------------
  |  Branch (795:5): [True: 149, False: 889k]
  ------------------
  796|    149|      newIdx = p_->size_ + offset;
  797|    149|      break;
  798|   889k|  }
  799|       |
  800|   889k|  if (newIdx < 0)
  ------------------
  |  Branch (800:7): [True: 0, False: 889k]
  ------------------
  801|      0|    return 1;
  802|       |
  803|   889k|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (803:7): [True: 2.98k, False: 886k]
  ------------------
  804|  2.98k|    p_->eof_ = true;
  805|  2.98k|    return 1;
  806|  2.98k|  }
  807|       |
  808|   886k|  p_->idx_ = static_cast<size_t>(newIdx);
  809|   886k|  p_->eof_ = false;
  810|   886k|  return 0;
  811|   889k|}
_ZN5Exiv25MemIo4mmapEb:
  813|  36.7k|byte* MemIo::mmap(bool /*isWriteable*/) {
  814|  36.7k|  return p_->data_;
  815|  36.7k|}
_ZNK5Exiv25MemIo4tellEv:
  821|   496k|size_t MemIo::tell() const {
  822|   496k|  return p_->idx_;
  823|   496k|}
_ZNK5Exiv25MemIo4sizeEv:
  825|   240k|size_t MemIo::size() const {
  826|   240k|  return p_->size_;
  827|   240k|}
_ZN5Exiv25MemIo4openEv:
  829|   122k|int MemIo::open() {
  830|   122k|  p_->idx_ = 0;
  831|   122k|  p_->eof_ = false;
  832|   122k|  return 0;
  833|   122k|}
_ZNK5Exiv25MemIo6isopenEv:
  835|  87.1k|bool MemIo::isopen() const {
  836|  87.1k|  return true;
  837|  87.1k|}
_ZN5Exiv25MemIo5closeEv:
  839|  87.1k|int MemIo::close() {
  840|  87.1k|  return 0;
  841|  87.1k|}
_ZN5Exiv25MemIo4readEm:
  843|  65.5k|DataBuf MemIo::read(size_t rcount) {
  844|  65.5k|  DataBuf buf(rcount);
  845|  65.5k|  size_t readCount = read(buf.data(), buf.size());
  846|  65.5k|  buf.resize(readCount);
  847|  65.5k|  return buf;
  848|  65.5k|}
_ZN5Exiv25MemIo4readEPhm:
  850|  3.87M|size_t MemIo::read(byte* buf, size_t rcount) {
  851|  3.87M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  852|  3.87M|  const auto allow = std::min<size_t>(rcount, avail);
  853|  3.87M|  if (allow > 0) {
  ------------------
  |  Branch (853:7): [True: 3.73M, False: 137k]
  ------------------
  854|  3.73M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  855|  3.73M|  }
  856|  3.87M|  p_->idx_ += allow;
  857|  3.87M|  if (rcount > avail) {
  ------------------
  |  Branch (857:7): [True: 12.0k, False: 3.86M]
  ------------------
  858|  12.0k|    p_->eof_ = true;
  859|  12.0k|  }
  860|  3.87M|  return allow;
  861|  3.87M|}
_ZN5Exiv25MemIo4getbEv:
  863|   843k|int MemIo::getb() {
  864|   843k|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (864:7): [True: 754, False: 843k]
  ------------------
  865|    754|    p_->eof_ = true;
  866|    754|    return EOF;
  867|    754|  }
  868|   843k|  return p_->data_[p_->idx_++];
  869|   843k|}
_ZNK5Exiv25MemIo5errorEv:
  871|  3.63M|int MemIo::error() const {
  872|  3.63M|  return 0;
  873|  3.63M|}
_ZNK5Exiv25MemIo3eofEv:
  875|   916k|bool MemIo::eof() const {
  876|   916k|  return p_->eof_;
  877|   916k|}
_ZNK5Exiv25MemIo4pathEv:
  879|  14.7k|const std::string& MemIo::path() const noexcept {
  880|  14.7k|  static std::string _path{"MemIo"};
  881|  14.7k|  return _path;
  882|  14.7k|}
_ZN5Exiv25MemIo4ImplC2Ev:
  604|  8.76k|  Impl() = default;                     //!< Default constructor

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

_ZN5Exiv28BmpImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   27|    612|    Image(ImageType::bmp, mdNone, std::move(io), params) {
   28|    612|}
_ZNK5Exiv28BmpImage8mimeTypeEv:
   30|      3|std::string BmpImage::mimeType() const {
   31|       |  // "image/bmp" is a Generic Bitmap
   32|      3|  return "image/x-ms-bmp";  // Microsoft Bitmap
   33|      3|}
_ZN5Exiv28BmpImage12readMetadataEv:
   47|    602|void BmpImage::readMetadata() {
   48|       |#ifdef EXIV2_DEBUG_MESSAGES
   49|       |  std::cerr << "Exiv2::BmpImage::readMetadata: Reading Windows bitmap file " << io_->path() << "\n";
   50|       |#endif
   51|    602|  if (io_->open() != 0) {
  ------------------
  |  Branch (51:7): [True: 0, False: 602]
  ------------------
   52|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   53|      0|  }
   54|    602|  IoCloser closer(*io_);
   55|       |
   56|       |  // Ensure that this is the correct image type
   57|    602|  if (!isBmpType(*io_, false)) {
  ------------------
  |  Branch (57:7): [True: 0, False: 602]
  ------------------
   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|    602|  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|    602|  byte buf[26];
   84|    602|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (84:7): [True: 602, False: 0]
  ------------------
   85|    602|    pixelWidth_ = getULong(buf + 18, littleEndian);
   86|    602|    pixelHeight_ = getULong(buf + 22, littleEndian);
   87|    602|  }
   88|    602|}
_ZN5Exiv214newBmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
   97|    612|Image::UniquePtr newBmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
   98|    612|  auto image = std::make_unique<BmpImage>(std::move(io), params);
   99|    612|  if (!image->good()) {
  ------------------
  |  Branch (99:7): [True: 10, False: 602]
  ------------------
  100|     10|    return nullptr;
  101|     10|  }
  102|    602|  return image;
  103|    612|}
_ZN5Exiv29isBmpTypeERNS_7BasicIoEb:
  105|  15.9k|bool isBmpType(BasicIo& iIo, bool advance) {
  106|  15.9k|  const int32_t len = 2;
  107|  15.9k|  const std::array<byte, len> BmpImageId{'B', 'M'};
  108|  15.9k|  std::array<byte, len> buf;
  109|  15.9k|  iIo.read(buf.data(), len);
  110|  15.9k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (110:7): [True: 0, False: 15.9k]
  |  Branch (110:22): [True: 297, False: 15.6k]
  ------------------
  111|    297|    return false;
  112|    297|  }
  113|  15.6k|  bool matched = buf == BmpImageId;
  114|  15.6k|  if (!advance || !matched) {
  ------------------
  |  Branch (114:7): [True: 15.6k, False: 0]
  |  Branch (114:19): [True: 0, False: 0]
  ------------------
  115|  15.6k|    iIo.seek(-len, BasicIo::cur);
  116|  15.6k|  }
  117|  15.6k|  return matched;
  118|  15.9k|}

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|  38.5k|  static constexpr auto tagList() {
   39|  38.5k|    return tagInfo_;
   40|  38.5k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  34.5k|  static constexpr auto tagListCs() {
   43|  34.5k|    return tagInfoCs_;
   44|  34.5k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|    518|  static constexpr auto tagListSi() {
   47|    518|    return tagInfoSi_;
   48|    518|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  1.02k|  static constexpr auto tagListCf() {
   55|  1.02k|    return tagInfoCf_;
   56|  1.02k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|    417|  static constexpr auto tagListPi() {
   59|    417|    return tagInfoPi_;
   60|    417|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    278|  static constexpr auto tagListTi() {
   63|    278|    return tagInfoTi_;
   64|    278|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|  1.06k|  static constexpr auto tagListFi() {
   67|  1.06k|    return tagInfoFi_;
   68|  1.06k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|  5.06k|  static constexpr auto tagListPa() {
   51|  5.06k|    return tagInfoPa_;
   52|  5.06k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    741|  static constexpr auto tagListPr() {
   71|    741|    return tagInfoPr_;
   72|    741|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    853|  static constexpr auto tagListVigCor2() {
  135|    853|    return tagInfoVigCor2_;
  136|    853|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    273|  static constexpr auto tagListLiOp() {
  139|    273|    return tagInfoLiOp_;
  140|    273|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    358|  static constexpr auto tagListAfMiAdj() {
  127|    358|    return tagInfoAfMiAdj_;
  128|    358|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|   213k|  static constexpr auto tagListLe() {
  143|   213k|    return tagInfoLe_;
  144|   213k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    269|  static constexpr auto tagListAm() {
  147|    269|    return tagInfoAm_;
  148|    269|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    462|  static constexpr auto tagListFil() {
  155|    462|    return tagInfoFil_;
  156|    462|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    198|  static constexpr auto tagListMe() {
  151|    198|    return tagInfoMe_;
  152|    198|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    252|  static constexpr auto tagListHdr() {
  159|    252|    return tagInfoHdr_;
  160|    252|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    298|  static constexpr auto tagListAfC() {
  163|    298|    return tagInfoAfC_;
  164|    298|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|     85|  static constexpr auto tagListRawB() {
  167|     85|    return tagInfoRawB_;
  168|     85|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  1.76k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  1.76k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  1.76k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  1.76k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.52k|void Converter::cnvFromXmp() {
  511|   443k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 443k, False: 3.52k]
  ------------------
  512|   443k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 366k, False: 77.4k]
  |  Branch (512:37): [True: 183k, False: 183k]
  |  Branch (512:52): [True: 77.4k, False: 183k]
  |  Branch (512:79): [True: 38.7k, False: 38.7k]
  ------------------
  513|   221k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   221k|    }
  515|   443k|  }
  516|  3.52k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  3.86k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  3.86k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  3.86k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 3.86k, False: 0]
  ------------------
  524|  3.86k|    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|    589|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    589|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    589|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 589, False: 0]
  ------------------
  534|    589|    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|   158k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   158k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   158k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 158k, False: 343]
  ------------------
  847|   158k|    return;
  848|    343|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 343]
  ------------------
  849|      0|    return;
  850|    343|  std::string value;
  851|    343|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 0, False: 343]
  ------------------
  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|    343|  ExifKey key(to);
  859|    343|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 343, False: 0]
  ------------------
  860|    343|    exifData_->add(ed);
  861|    343|  }
  862|    343|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 343]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    343|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.76k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.76k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.76k]
  ------------------
  868|      0|    return;
  869|  1.76k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.76k, False: 0]
  ------------------
  871|  1.76k|    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.76k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.76k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.76k]
  ------------------
  887|      0|    return;
  888|  1.76k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.76k, False: 0]
  ------------------
  890|  1.76k|    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.04k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  7.04k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  7.04k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 7.04k, False: 0]
  ------------------
  912|  7.04k|    return;
  913|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 0]
  ------------------
  914|      0|    return;
  915|      0|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|      0|  std::string value = pos->toString();
  917|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 0]
  ------------------
  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|      0|  XMP_DateTime datetime;
  924|      0|  try {
  925|      0|    SXMPUtils::ConvertToDate(value, &datetime);
  926|      0|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 0, False: 0]
  ------------------
  927|      0|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|      0|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  930|      0|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|      0|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 0, False: 0]
  ------------------
  933|      0|        const char* subsecTag = nullptr;
  934|      0|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 0, False: 0]
  ------------------
  935|      0|          subsecTag = "Exif.Photo.SubSecTime";
  936|      0|        } 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|      0|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 0, False: 0]
  ------------------
  942|      0|          prepareExifTarget(subsecTag, true);
  943|      0|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|      0|        }
  945|      0|      }
  946|      0|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|      0|      URational rhour(datetime.hour, 1);
  950|      0|      URational rmin(datetime.minute, 1);
  951|      0|      URational rsec(datetime.second, 1);
  952|      0|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 0]
  ------------------
  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|      0|      std::ostringstream array;
  964|      0|      array << rhour << " " << rmin << " " << rsec;
  965|      0|      (*exifData_)[to] = array.str();
  966|       |
  967|      0|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|      0|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|      0|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  970|      0|    }
  971|      0|  }
  972|      0|#ifndef SUPPRESS_WARNINGS
  973|      0|  catch (const XMP_Error& e) {
  974|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\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()
  ------------------
  975|      0|    return;
  976|      0|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|      0|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 0]
  ------------------
  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|      0|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  3.52k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.52k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.52k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.52k, False: 0]
  ------------------
  995|  3.52k|    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.76k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.76k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.76k, False: 0]
  ------------------
 1015|  1.76k|    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.76k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.76k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.76k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.76k, False: 0]
  ------------------
 1035|  1.76k|    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.04k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  7.04k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  7.04k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 7.04k, False: 0]
  ------------------
 1105|  7.04k|    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|  38.7k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  38.7k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  38.7k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 38.1k, False: 589]
  ------------------
 1196|  38.1k|    return;
 1197|    589|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 589]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    589|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 194, False: 395]
  |  Branch (1200:35): [True: 193, False: 202]
  ------------------
 1201|    387|    std::string value;
 1202|    387|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 112, False: 275]
  ------------------
 1203|    112|#ifndef SUPPRESS_WARNINGS
 1204|    112|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    112|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 112]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    112|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    112|#endif
 1206|    112|      return;
 1207|    112|    }
 1208|    275|    (*iptcData_)[to] = value;
 1209|    275|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    275|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 275]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    275|    return;
 1213|    387|  }
 1214|       |
 1215|    202|  size_t count = pos->count();
 1216|    202|  bool added = false;
 1217|  2.39k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 2.19k, False: 202]
  ------------------
 1218|  2.19k|    std::string value = pos->toString(i);
 1219|  2.19k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 2.19k]
  ------------------
 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|  2.19k|    IptcKey key(to);
 1226|  2.19k|    Iptcdatum id(key);
 1227|  2.19k|    id.setValue(value);
 1228|  2.19k|    iptcData_->add(id);
 1229|  2.19k|    added = true;
 1230|  2.19k|  }
 1231|    202|  if (added)
  ------------------
  |  Branch (1231:7): [True: 187, False: 15]
  ------------------
 1232|    187|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    202|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 202]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    202|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.76k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.76k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.76k|  converter.cnvFromXmp();
 1333|  1.76k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.76k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.76k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.76k|  converter.cnvFromXmp();
 1371|  1.76k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  1.73k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  1.73k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 0, False: 1.73k]
  ------------------
 1382|      0|    return true;  // nothing to do
 1383|  1.73k|#ifdef EXV_HAVE_ICONV
 1384|  1.73k|  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.73k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  1.73k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  1.73k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 1.73k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  1.73k|  bool ret = true;
 1407|  1.73k|  auto cd = iconv_open(to.data(), from.data());
 1408|  1.73k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 1.73k]
  ------------------
 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.73k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  1.73k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  1.73k|#endif
 1420|  1.73k|  size_t inbytesleft = str.length();
 1421|  7.17k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 6.34k, False: 824]
  ------------------
 1422|  6.34k|    char outbuf[256];
 1423|  6.34k|    char* outptr = outbuf;
 1424|  6.34k|    size_t outbytesleft = sizeof(outbuf);
 1425|  6.34k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  6.34k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  6.34k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 5.86k, False: 478]
  |  Branch (1427:53): [True: 908, False: 4.96k]
  ------------------
 1428|    908|#ifndef SUPPRESS_WARNINGS
 1429|    908|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|    908|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 908]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    908|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|    908|#endif
 1431|    908|      ret = false;
 1432|    908|      break;
 1433|    908|    }
 1434|  5.43k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  5.43k|  }
 1436|       |
 1437|  1.73k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 1.73k, False: 0]
  ------------------
 1438|  1.73k|    iconv_close(cd);
 1439|       |
 1440|  1.73k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 824, False: 908]
  ------------------
 1441|    824|    str = std::move(outstr);
 1442|  1.73k|  return ret;
 1443|  1.73k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|    730|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|    730|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 206, False: 524]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    206|    value = pos->toString(0);
 1596|    206|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 176, False: 30]
  |  Branch (1596:31): [True: 64, False: 112]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|     64|      value = pos->toString();
 1600|     64|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 64, False: 0]
  |  Branch (1600:32): [True: 64, False: 0]
  ------------------
 1601|     64|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|     64|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 64, False: 0]
  ------------------
 1603|     64|          value = value.substr(first_space_pos + 1);
 1604|     64|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|     64|      }
 1608|     64|    }
 1609|    524|  } else {
 1610|    524|    value = pos->toString();
 1611|    524|  }
 1612|    730|  return pos->value().ok();
 1613|    730|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  33.8k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  33.8k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  33.8k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  33.8k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 33.8k]
  |  Branch (18:17): [True: 0, False: 33.8k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  33.8k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 3.93k, False: 29.9k]
  |  Branch (22:26): [True: 3.89k, False: 36]
  ------------------
   23|  3.89k|    setByteOrder(littleEndian);
   24|  30.0k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 6.82k, False: 23.1k]
  |  Branch (24:33): [True: 6.77k, False: 50]
  ------------------
   25|  6.77k|    setByteOrder(bigEndian);
   26|  23.2k|  } else {
   27|  23.2k|    return false;
   28|  23.2k|  }
   29|  10.6k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 894, False: 9.77k]
  ------------------
   30|    894|    return false;
   31|  9.77k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  9.77k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 9.47k, False: 300]
  ------------------
   33|  9.47k|    return false;
   34|    300|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|    300|  return true;
   37|  9.77k|}

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

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

_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  127|  8.47k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  128|  8.47k|  return doAdd(std::move(component));
  129|  8.47k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  135|  8.47k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  136|  8.47k|  return components_.emplace_back(std::move(component));
  137|  8.47k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  141|    544|void CiffHeader::read(const byte* pData, size_t size) {
  142|    544|  if (size < 14)
  ------------------
  |  Branch (142:7): [True: 0, False: 544]
  ------------------
  143|      0|    throw Error(ErrorCode::kerNotACrwImage);
  144|       |
  145|    544|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (145:7): [True: 333, False: 211]
  |  Branch (145:26): [True: 333, False: 0]
  ------------------
  146|    333|    byteOrder_ = littleEndian;
  147|    333|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (147:14): [True: 211, False: 0]
  |  Branch (147:33): [True: 211, False: 0]
  ------------------
  148|    211|    byteOrder_ = bigEndian;
  149|    211|  } else {
  150|      0|    throw Error(ErrorCode::kerNotACrwImage);
  151|      0|  }
  152|    544|  offset_ = getULong(pData + 2, byteOrder_);
  153|    544|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (153:7): [True: 14, False: 530]
  |  Branch (153:23): [True: 50, False: 480]
  ------------------
  154|     64|    throw Error(ErrorCode::kerNotACrwImage);
  155|    480|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (155:7): [True: 0, False: 480]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotACrwImage);
  157|      0|  }
  158|       |
  159|    480|  pPadding_.clear();
  160|    480|  if (offset_ > 14) {
  ------------------
  |  Branch (160:7): [True: 343, False: 137]
  ------------------
  161|    343|    pPadding_.resize(offset_ - 14);
  162|    343|    padded_ = offset_ - 14;
  163|    343|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  164|    343|  }
  165|       |
  166|    480|  pRootDir_ = std::make_unique<CiffDirectory>();
  167|    480|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  168|    480|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  170|  8.66k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  171|  8.66k|  doRead(pData, size, start, byteOrder);
  172|  8.66k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  174|  8.66k|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|  8.66k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (176:11): [True: 8.66k, False: 0]
  |  Branch (176:25): [True: 8.66k, False: 0]
  ------------------
  177|  8.66k|  tag_ = getUShort(pData + start, byteOrder);
  178|       |
  179|  8.66k|  DataLocId dl = dataLocation();
  180|       |
  181|  8.66k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (181:7): [True: 5.21k, False: 3.45k]
  ------------------
  182|  5.21k|    size_ = getULong(pData + start + 2, byteOrder);
  183|  5.21k|    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|  5.21k|    if (offset_ < start) {
  ------------------
  |  Branch (190:9): [True: 4.57k, False: 640]
  ------------------
  191|       |      // Sub-region is before in memory.
  192|  4.57k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  193|  4.57k|    } else {
  194|       |      // Sub-region is after in memory.
  195|    640|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  196|    640|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  197|    640|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  198|    640|    }
  199|  5.21k|  }
  200|  8.66k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (200:7): [True: 3.43k, False: 5.23k]
  ------------------
  201|  3.43k|    size_ = 8;
  202|  3.43k|    offset_ = start + 2;
  203|  3.43k|  }
  204|  8.66k|  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|  8.66k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  212|  2.27k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  213|  2.27k|  CiffComponent::doRead(pData, size, start, byteOrder);
  214|       |#ifdef EXIV2_DEBUG_MESSAGES
  215|       |  std::cout << "Reading directory 0x" << std::hex << tag() << "\n";
  216|       |#endif
  217|  2.27k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (217:7): [True: 0, False: 2.27k]
  ------------------
  218|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  219|       |
  220|  2.27k|  readDirectory(pData + offset(), this->size(), byteOrder);
  221|       |#ifdef EXIV2_DEBUG_MESSAGES
  222|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  223|       |#endif
  224|  2.27k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  226|  2.73k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  227|  2.73k|  if (size < 4)
  ------------------
  |  Branch (227:7): [True: 26, False: 2.70k]
  ------------------
  228|     26|    throw Error(ErrorCode::kerCorruptedMetadata);
  229|  2.70k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  230|  2.70k|  if (o > size - 2)
  ------------------
  |  Branch (230:7): [True: 33, False: 2.67k]
  ------------------
  231|     33|    throw Error(ErrorCode::kerCorruptedMetadata);
  232|  2.67k|  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.67k|  o += 2;
  237|  2.67k|  if (count * 10u > size - o)
  ------------------
  |  Branch (237:7): [True: 23, False: 2.65k]
  ------------------
  238|     23|    throw Error(ErrorCode::kerCorruptedMetadata);
  239|       |
  240|  11.3k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (240:24): [True: 8.66k, False: 2.65k]
  ------------------
  241|  8.66k|    uint16_t tag = getUShort(pData + o, byteOrder);
  242|  8.66k|    auto m = [this, tag]() -> UniquePtr {
  243|  8.66k|      if (this->typeId(tag) == TypeId::directory)
  244|  8.66k|        return std::make_unique<CiffDirectory>();
  245|  8.66k|      return std::make_unique<CiffEntry>();
  246|  8.66k|    }();
  247|  8.66k|    m->setDir(this->tag());
  248|  8.66k|    m->read(pData, size, o, byteOrder);
  249|  8.66k|    add(std::move(m));
  250|  8.66k|    o += 10;
  251|  8.66k|  }
  252|  2.65k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  254|    221|void CiffHeader::decode(Image& image) const {
  255|       |  // Nothing to decode from the header itself, just add correct byte order
  256|    221|  if (pRootDir_)
  ------------------
  |  Branch (256:7): [True: 221, False: 0]
  ------------------
  257|    221|    pRootDir_->decode(image, byteOrder_);
  258|    221|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  260|  6.70k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  261|  6.70k|  doDecode(image, byteOrder);
  262|  6.70k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  264|  4.85k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  265|  4.85k|  CrwMap::decode(*this, image, byteOrder);
  266|  4.85k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  268|  1.84k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  269|  6.48k|  for (auto&& component : components_) {
  ------------------
  |  Branch (269:25): [True: 6.48k, False: 1.84k]
  ------------------
  270|  6.48k|    component->decode(image, byteOrder);
  271|  6.48k|  }
  272|  1.84k|}  // CiffDirectory::doDecode
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  436|  10.0k|TypeId CiffComponent::typeId(uint16_t tag) {
  437|  10.0k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (437:11): [True: 9.97k, False: 78]
  ------------------
  438|  3.37k|    case 0x0000:
  ------------------
  |  Branch (438:5): [True: 3.37k, False: 6.68k]
  ------------------
  439|  3.37k|      return unsignedByte;
  440|  1.38k|    case 0x0800:
  ------------------
  |  Branch (440:5): [True: 1.38k, False: 8.67k]
  ------------------
  441|  1.38k|      return asciiString;
  442|    703|    case 0x1000:
  ------------------
  |  Branch (442:5): [True: 703, False: 9.35k]
  ------------------
  443|    703|      return unsignedShort;
  444|    929|    case 0x1800:
  ------------------
  |  Branch (444:5): [True: 929, False: 9.12k]
  ------------------
  445|    929|      return unsignedLong;
  446|  1.31k|    case 0x2000:
  ------------------
  |  Branch (446:5): [True: 1.31k, False: 8.73k]
  ------------------
  447|  1.31k|      return undefined;
  448|    245|    case 0x2800:
  ------------------
  |  Branch (448:5): [True: 245, False: 9.81k]
  ------------------
  449|  2.27k|    case 0x3000:
  ------------------
  |  Branch (449:5): [True: 2.02k, False: 8.02k]
  ------------------
  450|  2.27k|      return directory;
  451|  10.0k|  }
  452|     78|  return invalidTypeId;
  453|  10.0k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  455|  8.66k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  456|  8.66k|  switch (tag & 0xc000) {
  457|  5.21k|    case 0x0000:
  ------------------
  |  Branch (457:5): [True: 5.21k, False: 3.45k]
  ------------------
  458|  5.21k|      return DataLocId::valueData;
  459|  3.43k|    case 0x4000:
  ------------------
  |  Branch (459:5): [True: 3.43k, False: 5.23k]
  ------------------
  460|  3.43k|      return DataLocId::directoryData;
  461|     14|    default:
  ------------------
  |  Branch (461:5): [True: 14, False: 8.65k]
  ------------------
  462|     14|      throw Error(ErrorCode::kerCorruptedMetadata);
  463|  8.66k|  }
  464|  8.66k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  471|    221|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  472|    221|  if (!pRootDir_)
  ------------------
  |  Branch (472:7): [True: 0, False: 221]
  ------------------
  473|      0|    return nullptr;
  474|    221|  return pRootDir_->findComponent(crwTagId, crwDir);
  475|    221|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  477|  6.69k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  478|  6.69k|  return doFindComponent(crwTagId, crwDir);
  479|  6.69k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  481|  4.85k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  482|  4.85k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (482:7): [True: 21, False: 4.83k]
  |  Branch (482:30): [True: 3, False: 18]
  ------------------
  483|      3|    return this;
  484|      3|  }
  485|  4.85k|  return nullptr;
  486|  4.85k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  488|  1.84k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  489|  6.47k|  for (auto&& component : components_) {
  ------------------
  |  Branch (489:25): [True: 6.47k, False: 1.84k]
  ------------------
  490|  6.47k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (490:14): [True: 3, False: 6.47k]
  ------------------
  491|      3|      return cc;
  492|  6.47k|  }
  493|  1.84k|  return nullptr;
  494|  1.84k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  605|  4.85k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  606|  4.85k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  607|  4.85k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (607:7): [True: 546, False: 4.31k]
  |  Branch (607:14): [True: 546, False: 0]
  ------------------
  608|    546|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  609|    546|  }
  610|  4.85k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  612|  4.85k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  613|  99.9k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (613:19): [True: 99.9k, False: 4.31k]
  ------------------
  614|  99.9k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (614:9): [True: 11.3k, False: 88.5k]
  |  Branch (614:34): [True: 546, False: 10.7k]
  ------------------
  615|    546|      return &crw;
  616|    546|    }
  617|  99.9k|  }
  618|  4.31k|  return nullptr;
  619|  4.85k|}  // CrwMap::crwMapping
_ZN5Exiv28Internal6CrwMap12decode0x0805ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  622|     16|                          ByteOrder /*byteOrder*/) {
  623|     16|  auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
  624|     16|  image.setComment(s);
  625|     16|}  // CrwMap::decode0x0805
_ZN5Exiv28Internal6CrwMap12decode0x080aERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  628|    113|                          ByteOrder byteOrder) {
  629|    113|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (629:7): [True: 0, False: 113]
  ------------------
  630|      0|    return;
  631|       |
  632|       |  // Make
  633|    113|  ExifKey key1("Exif.Image.Make");
  634|    113|  auto value1 = Value::create(ciffComponent.typeId());
  635|    113|  uint32_t i = 0;
  636|    510|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (636:10): [True: 477, False: 33]
  ------------------
  637|    477|    ++i;
  638|    477|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (638:9): [True: 80, False: 397]
  ------------------
  639|     80|      break;
  640|     80|    }
  641|    477|  }
  642|    113|  value1->read(ciffComponent.pData(), i, byteOrder);
  643|    113|  image.exifData().add(key1, value1.get());
  644|       |
  645|       |  // Model
  646|    113|  ExifKey key2("Exif.Image.Model");
  647|    113|  auto value2 = Value::create(ciffComponent.typeId());
  648|    113|  uint32_t j = i;
  649|    352|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (649:10): [True: 282, False: 70]
  ------------------
  650|    282|    ++i;
  651|    282|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (651:9): [True: 43, False: 239]
  ------------------
  652|     43|      break;
  653|     43|    }
  654|    282|  }
  655|    113|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  656|    113|  image.exifData().add(key2, value2.get());
  657|    113|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  660|     46|                         ByteOrder byteOrder) {
  661|     46|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (661:7): [True: 0, False: 46]
  ------------------
  662|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  663|      0|    return;
  664|      0|  }
  665|       |
  666|     46|  int64_t aperture = 0;
  667|     46|  int64_t shutterSpeed = 0;
  668|       |
  669|     46|  auto ifdId = [pCrwMapping] {
  670|     46|    if (pCrwMapping->tag_ == 0x0001)
  671|     46|      return IfdId::canonCsId;
  672|     46|    if (pCrwMapping->tag_ == 0x0004)
  673|     46|      return IfdId::canonSiId;
  674|     46|    if (pCrwMapping->tag_ == 0x000f)
  675|     46|      return IfdId::canonCfId;
  676|     46|    if (pCrwMapping->tag_ == 0x0012)
  677|     46|      return IfdId::canonPiId;
  678|     46|    return IfdId::ifdIdNotSet;
  679|     46|  }();
  680|       |
  681|     46|  std::string groupName(Internal::groupName(ifdId));
  682|     46|  const size_t component_size = ciffComponent.size();
  683|     46|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  684|     46|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  685|     46|          ErrorCode::kerCorruptedMetadata);
  686|     46|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  687|     46|  uint16_t c = 1;
  688|    184|  while (c < num_components) {
  ------------------
  |  Branch (688:10): [True: 138, False: 46]
  ------------------
  689|    138|    uint16_t n = 1;
  690|    138|    ExifKey key(c, groupName);
  691|    138|    UShortValue value;
  692|    138|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (692:9): [True: 36, False: 102]
  |  Branch (692:38): [True: 0, False: 36]
  |  Branch (692:49): [True: 0, False: 0]
  ------------------
  693|      0|      n = 3;
  694|    138|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  695|    138|    image.exifData().add(key, &value);
  696|    138|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (696:9): [True: 33, False: 105]
  |  Branch (696:38): [True: 0, False: 33]
  ------------------
  697|      0|      aperture = value.toInt64();
  698|    138|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (698:9): [True: 33, False: 105]
  |  Branch (698:38): [True: 0, False: 33]
  ------------------
  699|      0|      shutterSpeed = value.toInt64();
  700|    138|    c += n;
  701|    138|  }
  702|       |
  703|     46|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (703:7): [True: 11, False: 35]
  ------------------
  704|       |    // Exif.Photo.FNumber
  705|     11|    float f = fnumber(canonEv(aperture));
  706|     11|    auto [r, s] = floatToRationalCast(f);
  707|     11|    auto ur = URational(r, s);
  708|     11|    URationalValue fn;
  709|     11|    fn.value_.push_back(ur);
  710|     11|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  711|       |
  712|       |    // Exif.Photo.ExposureTime
  713|     11|    ur = exposureTime(canonEv(shutterSpeed));
  714|     11|    URationalValue et;
  715|     11|    et.value_.push_back(ur);
  716|     11|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  717|     11|  }
  718|     46|}  // 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|     14|                          ByteOrder byteOrder) {
  749|     14|  if (ciffComponent.typeId() != unsignedLong || ciffComponent.size() < 28) {
  ------------------
  |  Branch (749:7): [True: 0, False: 14]
  |  Branch (749:49): [True: 14, False: 0]
  ------------------
  750|     14|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  751|     14|    return;
  752|     14|  }
  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|     20|                          ByteOrder /*byteOrder*/) {
  772|     20|  ExifThumb exifThumb(image.exifData());
  773|     20|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  774|     20|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  777|    329|                         ByteOrder byteOrder) {
  778|       |  // create a key and value pair
  779|    329|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  780|    329|  Value::UniquePtr value;
  781|    329|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (781:7): [True: 329, False: 0]
  ------------------
  782|    329|    value = Value::create(ciffComponent.typeId());
  783|    329|    size_t size = 0;
  784|    329|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (784:9): [True: 21, False: 308]
  ------------------
  785|     21|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  786|    308|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (786:16): [True: 122, False: 186]
  ------------------
  787|       |      // determine size from the data, by looking for the first 0
  788|    122|      uint32_t i = 0;
  789|    654|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (789:14): [True: 612, False: 42]
  ------------------
  790|    612|        ++i;
  791|    612|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (791:13): [True: 80, False: 532]
  ------------------
  792|     80|          break;
  793|     80|        }
  794|    612|      }
  795|    122|      size = i;
  796|    186|    } else {
  797|       |      // by default, use the size from the directory entry
  798|    186|      size = ciffComponent.size();
  799|    186|    }
  800|    329|    enforce(size <= ciffComponent.size(), ErrorCode::kerCorruptedMetadata);
  801|    329|    value->read(ciffComponent.pData(), size, byteOrder);
  802|    329|  }
  803|       |  // Add metadatum to exif data
  804|    329|  image.exifData().add(key, value.get());
  805|    329|}  // CrwMap::decodeBasic
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  242|  8.66k|    auto m = [this, tag]() -> UniquePtr {
  243|  8.66k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (243:11): [True: 2.27k, False: 6.39k]
  ------------------
  244|  2.27k|        return std::make_unique<CiffDirectory>();
  245|  6.39k|      return std::make_unique<CiffEntry>();
  246|  8.66k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderEENK3$_0clEv:
  669|     46|  auto ifdId = [pCrwMapping] {
  670|     46|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (670:9): [True: 12, False: 34]
  ------------------
  671|     12|      return IfdId::canonCsId;
  672|     34|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (672:9): [True: 11, False: 23]
  ------------------
  673|     11|      return IfdId::canonSiId;
  674|     23|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (674:9): [True: 10, False: 13]
  ------------------
  675|     10|      return IfdId::canonCfId;
  676|     13|    if (pCrwMapping->tag_ == 0x0012)
  ------------------
  |  Branch (676:9): [True: 13, False: 0]
  ------------------
  677|     13|      return IfdId::canonPiId;
  678|      0|    return IfdId::ifdIdNotSet;
  679|     13|  }();

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

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   116k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   116k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 57.3k, False: 59.6k]
  |  Branch (378:31): [True: 16.1k, False: 41.2k]
  ------------------
  379|  16.1k|    return -1;
  380|   100k|  const DataSet* dataSet = records_[recordId];
  381|   100k|  int idx;
  382|  1.48M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 1.39M, False: 88.9k]
  ------------------
  383|  1.39M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 11.8k, False: 1.38M]
  ------------------
  384|  11.8k|      return -1;
  385|  1.39M|  }
  386|  88.9k|  return idx;
  387|   100k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  3.51k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  3.51k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 3.05k, False: 462]
  |  Branch (390:31): [True: 0, False: 3.05k]
  ------------------
  391|      0|    return -1;
  392|  3.51k|  const DataSet* dataSet = records_[recordId];
  393|  3.51k|  int idx;
  394|  89.8k|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 86.3k, False: 3.51k]
  ------------------
  395|  86.3k|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 86.3k]
  ------------------
  396|      0|      return -1;
  397|  86.3k|  }
  398|  3.51k|  return idx;
  399|  3.51k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  38.9k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  38.9k|  int idx = dataSetIdx(number, recordId);
  403|  38.9k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 9.34k, False: 29.6k]
  ------------------
  404|  9.34k|    return unknownDataSet.type_;
  405|  29.6k|  return records_[recordId][idx].type_;
  406|  38.9k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|  39.6k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|  39.6k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 30.3k, False: 9.34k]
  ------------------
  410|  30.3k|    return records_[recordId][idx].name_;
  411|       |
  412|  9.34k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  9.34k|#define stringFormat std::format
  ------------------
  413|  39.6k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  38.3k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  38.3k|  int idx = dataSetIdx(number, recordId);
  438|  38.3k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 9.34k, False: 28.9k]
  ------------------
  439|  9.34k|    return unknownDataSet.repeatable_;
  440|  28.9k|  return records_[recordId][idx].repeatable_;
  441|  38.3k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  3.51k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  3.51k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 3.51k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  3.51k|    return records_[recordId][idx].number_;
  447|  3.51k|  }
  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|  39.6k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|  39.6k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 20.0k, False: 19.6k]
  |  Branch (454:31): [True: 14.2k, False: 5.38k]
  ------------------
  455|  34.2k|    return recordInfo_[recordId].name_;
  456|  34.2k|  }
  457|       |
  458|  5.38k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  5.38k|#define stringFormat std::format
  ------------------
  459|  39.6k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  3.51k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  3.51k|  uint16_t i;
  470|  3.98k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 3.98k, False: 0]
  ------------------
  471|  3.98k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 3.51k, False: 462]
  ------------------
  472|  3.51k|      break;
  473|  3.98k|  }
  474|  3.51k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 3.51k]
  ------------------
  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|  3.51k|  return i;
  480|  3.51k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  3.51k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  3.51k|  decomposeKey();
  492|  3.51k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  36.1k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  36.1k|  makeKey();
  496|  36.1k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   285k|uint16_t IptcKey::tag() const {
  523|   285k|  return tag_;
  524|   285k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|  98.4k|uint16_t IptcKey::record() const {
  531|  98.4k|  return record_;
  532|  98.4k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|  68.0k|IptcKey::UniquePtr IptcKey::clone() const {
  535|  68.0k|  return UniquePtr(clone_());
  536|  68.0k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|  68.0k|IptcKey* IptcKey::clone_() const {
  539|  68.0k|  return new IptcKey(*this);
  540|  68.0k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  3.51k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  3.51k|  auto posDot1 = key_.find('.');
  545|  3.51k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  3.51k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 3.51k]
  |  Branch (547:39): [True: 0, False: 3.51k]
  ------------------
  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|  3.51k|  const std::string familyName = key_.substr(0, posDot1);
  553|  3.51k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 3.51k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  3.51k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  3.51k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  3.51k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  3.51k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  3.51k|  recordName = IptcDataSets::recordName(recId);
  565|  3.51k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  3.51k|  tag_ = dataSet;
  568|  3.51k|  record_ = recId;
  569|  3.51k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  3.51k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  36.1k|void IptcKey::makeKey() {
  573|  36.1k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  36.1k|         IptcDataSets::dataSetName(tag_, record_);
  575|  36.1k|}

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

_ZN5Exiv28EpsImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1027|  3.39k|    Image(ImageType::eps, mdXmp, std::move(io), params) {
 1028|       |  // LogMsg::setLevel(LogMsg::debug);
 1029|  3.39k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (1029:7): [True: 0, False: 3.39k]
  |  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.39k|}
_ZNK5Exiv28EpsImage8mimeTypeEv:
 1043|  4.65k|std::string EpsImage::mimeType() const {
 1044|  4.65k|  return "application/postscript";
 1045|  4.65k|}
_ZN5Exiv28EpsImage12readMetadataEv:
 1051|  3.39k|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.39k|  readWriteEpsMetadata(*io_, xmpPacket_, nativePreviews_, /* write = */ false);
 1058|       |
 1059|       |  // decode XMP metadata
 1060|  3.39k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_) > 1) {
  ------------------
  |  Branch (1060:7): [True: 440, False: 2.95k]
  |  Branch (1060:30): [True: 190, False: 250]
  ------------------
 1061|    190|#ifndef SUPPRESS_WARNINGS
 1062|    190|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    190|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 190]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    190|  LogMsg(LogMsg::warn).os()
  ------------------
 1063|    190|#endif
 1064|    190|    throw Error(ErrorCode::kerFailedToReadImageData);
 1065|    190|  }
 1066|       |
 1067|       |#ifdef DEBUG
 1068|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Finished reading EPS file " << io_->path() << "\n";
 1069|       |#endif
 1070|  3.39k|}
_ZN5Exiv214newEpsInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1095|  3.39k|Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1096|  3.39k|  auto image = std::make_unique<EpsImage>(std::move(io), params);
 1097|  3.39k|  if (!image->good()) {
  ------------------
  |  Branch (1097:7): [True: 0, False: 3.39k]
  ------------------
 1098|      0|    return nullptr;
 1099|      0|  }
 1100|  3.39k|  return image;
 1101|  3.39k|}
_ZN5Exiv29isEpsTypeERNS_7BasicIoEb:
 1103|  24.1k|bool isEpsType(BasicIo& iIo, bool advance) {
 1104|       |  // read as many bytes as needed for the longest (DOS) EPS signature
 1105|  24.1k|  constexpr auto bufSize = [] {
 1106|  24.1k|    auto f = [](const auto& a, const auto& b) { return a.size() < b.size(); };
 1107|  24.1k|    return std::max_element(epsFirstLine.begin(), epsFirstLine.end(), f)->size();
 1108|  24.1k|  }();
 1109|  24.1k|  const size_t restore = iIo.tell();  // save
 1110|  24.1k|  DataBuf buf = iIo.read(bufSize);
 1111|  24.1k|  if (iIo.error() || buf.size() != bufSize) {
  ------------------
  |  Branch (1111:7): [True: 0, False: 24.1k]
  |  Branch (1111:22): [True: 0, False: 24.1k]
  ------------------
 1112|      0|    iIo.seek(restore, BasicIo::beg);
 1113|      0|    return false;
 1114|      0|  }
 1115|       |  // check for all possible (DOS) EPS signatures
 1116|  24.1k|  bool matched = (buf.cmpBytes(0, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
 1117|  24.1k|  if (!matched) {
  ------------------
  |  Branch (1117:7): [True: 23.1k, False: 1.02k]
  ------------------
 1118|  61.6k|    for (auto&& eps : epsFirstLine) {
  ------------------
  |  Branch (1118:21): [True: 61.6k, False: 17.3k]
  ------------------
 1119|  61.6k|      if (buf.cmpBytes(0, eps.data(), eps.size()) == 0) {
  ------------------
  |  Branch (1119:11): [True: 5.76k, False: 55.9k]
  ------------------
 1120|  5.76k|        matched = true;
 1121|  5.76k|        break;
 1122|  5.76k|      }
 1123|  61.6k|    }
 1124|  23.1k|  }
 1125|       |  // seek back if possible and requested
 1126|  24.1k|  if (!advance || !matched) {
  ------------------
  |  Branch (1126:7): [True: 24.1k, False: 0]
  |  Branch (1126:19): [True: 0, False: 0]
  ------------------
 1127|  24.1k|    iIo.seek(restore, BasicIo::beg);
 1128|  24.1k|  }
 1129|  24.1k|  return matched;
 1130|  24.1k|}
epsimage.cpp:_ZN12_GLOBAL__N_120readWriteEpsMetadataERN5Exiv27BasicIoERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS3_6vectorINS0_13NativePreviewENS7_ISC_EEEEb:
  224|  3.39k|void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList& nativePreviews, bool write) {
  225|       |  // open input file
  226|  3.39k|  if (io.open() != 0) {
  ------------------
  |  Branch (226:7): [True: 0, False: 3.39k]
  ------------------
  227|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  228|      0|  }
  229|  3.39k|  IoCloser closer(io);
  230|       |
  231|       |  // read from input file via memory map
  232|  3.39k|  const byte* data = io.mmap();
  233|       |
  234|       |  // default positions and sizes
  235|  3.39k|  const size_t size = io.size();
  236|  3.39k|  size_t posEps = 0;
  237|  3.39k|  size_t posEndEps = size;
  238|  3.39k|  uint32_t posWmf = 0;
  239|  3.39k|  uint32_t sizeWmf = 0;
  240|  3.39k|  uint32_t posTiff = 0;
  241|  3.39k|  uint32_t sizeTiff = 0;
  242|       |
  243|  3.39k|  ErrorCode errcode = write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData;
  ------------------
  |  Branch (243:23): [True: 0, False: 3.39k]
  ------------------
  244|       |
  245|       |  // check for DOS EPS
  246|  3.39k|  const bool dosEps =
  247|  3.39k|      (size >= dosEpsSignature.size() && memcmp(data, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
  ------------------
  |  Branch (247:8): [True: 3.39k, False: 0]
  |  Branch (247:42): [True: 511, False: 2.88k]
  ------------------
  248|  3.39k|  if (dosEps) {
  ------------------
  |  Branch (248:7): [True: 511, False: 2.88k]
  ------------------
  249|       |#ifdef DEBUG
  250|       |    EXV_DEBUG << "readWriteEpsMetadata: Found DOS EPS signature\n";
  251|       |#endif
  252|       |
  253|    511|    enforce(size >= 30, errcode);
  254|    511|    posEps = getULong(data + 4, littleEndian);
  255|    511|    posEndEps = getULong(data + 8, littleEndian) + posEps;
  256|    511|    posWmf = getULong(data + 12, littleEndian);
  257|    511|    sizeWmf = getULong(data + 16, littleEndian);
  258|    511|    posTiff = getULong(data + 20, littleEndian);
  259|    511|    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|    511|    if (uint16_t checksum = getUShort(data + 28, littleEndian); checksum != 0xFFFF) {
  ------------------
  |  Branch (266:65): [True: 462, False: 49]
  ------------------
  267|       |#ifdef DEBUG
  268|       |      EXV_DEBUG << "readWriteEpsMetadata: DOS EPS checksum is not FFFF\n";
  269|       |#endif
  270|    462|    }
  271|    511|    if ((posWmf != 0 || sizeWmf != 0) && (posTiff != 0 || sizeTiff != 0)) {
  ------------------
  |  Branch (271:10): [True: 367, False: 144]
  |  Branch (271:25): [True: 58, False: 86]
  |  Branch (271:43): [True: 314, False: 100]
  |  Branch (271:59): [True: 68, False: 32]
  ------------------
  272|    382|#ifndef SUPPRESS_WARNINGS
  273|    382|      EXV_WARNING << "DOS EPS file has both WMF and TIFF section. Only one of those is allowed.\n";
  ------------------
  |  |  138|    382|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 382]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    382|  LogMsg(LogMsg::warn).os()
  ------------------
  274|    382|#endif
  275|    382|      if (write)
  ------------------
  |  Branch (275:11): [True: 0, False: 382]
  ------------------
  276|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  277|    382|    }
  278|    511|    if (sizeWmf == 0 && sizeTiff == 0) {
  ------------------
  |  Branch (278:9): [True: 206, False: 305]
  |  Branch (278:25): [True: 59, False: 147]
  ------------------
  279|     59|#ifndef SUPPRESS_WARNINGS
  280|     59|      EXV_WARNING << "DOS EPS file has neither WMF nor TIFF section. Exactly one of those is required.\n";
  ------------------
  |  |  138|     59|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 59]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     59|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     59|#endif
  282|     59|      if (write)
  ------------------
  |  Branch (282:11): [True: 0, False: 59]
  ------------------
  283|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  284|     59|    }
  285|    511|    enforce(30 <= posEps, errcode);
  286|    511|    enforce(sizeWmf == 0 || 30 <= posWmf, errcode);
  ------------------
  |  Branch (286:13): [True: 229, False: 282]
  |  Branch (286:29): [True: 223, False: 59]
  ------------------
  287|    511|    enforce(sizeTiff == 0 || 30 <= posTiff, errcode);
  ------------------
  |  Branch (287:13): [True: 166, False: 345]
  |  Branch (287:30): [True: 287, False: 58]
  ------------------
  288|       |
  289|    511|    enforce(posEps <= posEndEps && posEndEps <= size, errcode);
  ------------------
  |  Branch (289:13): [True: 358, False: 153]
  |  Branch (289:36): [True: 170, False: 188]
  ------------------
  290|    511|    enforce(posWmf <= size && sizeWmf <= size - posWmf, errcode);
  ------------------
  |  Branch (290:13): [True: 146, False: 365]
  |  Branch (290:31): [True: 114, False: 32]
  ------------------
  291|    511|    enforce(posTiff <= size && sizeTiff <= size - posTiff, errcode);
  ------------------
  |  Branch (291:13): [True: 77, False: 434]
  |  Branch (291:32): [True: 55, False: 22]
  ------------------
  292|    511|  }
  293|       |
  294|       |  // check first line
  295|  3.39k|  std::string firstLine;
  296|  3.39k|  const size_t posSecondLine = readLine(firstLine, data, posEps, posEndEps);
  297|       |#ifdef DEBUG
  298|       |  EXV_DEBUG << "readWriteEpsMetadata: First line: " << firstLine << "\n";
  299|       |#endif
  300|  3.39k|  auto it = std::find(epsFirstLine.begin(), epsFirstLine.end(), firstLine);
  301|  3.39k|  if (it == epsFirstLine.end()) {
  ------------------
  |  Branch (301:7): [True: 93, False: 3.29k]
  ------------------
  302|     93|    throw Error(ErrorCode::kerNotAnImage, "EPS");
  303|     93|  }
  304|       |
  305|       |  // determine line ending style of the first line
  306|  3.29k|  if (posSecondLine >= posEndEps) {
  ------------------
  |  Branch (306:7): [True: 15, False: 3.28k]
  ------------------
  307|     15|#ifndef SUPPRESS_WARNINGS
  308|     15|    EXV_WARNING << "Premature end of file after first line.\n";
  ------------------
  |  |  138|     15|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 15]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     15|  LogMsg(LogMsg::warn).os()
  ------------------
  309|     15|#endif
  310|     15|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (310:17): [True: 0, False: 15]
  ------------------
  311|     15|  }
  312|  3.28k|  const std::string lineEnding(reinterpret_cast<const char*>(data + posEps + firstLine.size()),
  313|  3.28k|                               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.28k|  size_t posLanguageLevel = posEndEps;
  328|  3.28k|  size_t posContainsXmp = posEndEps;
  329|  3.28k|  size_t posPages = posEndEps;
  330|  3.28k|  size_t posExiv2Version = posEndEps;
  331|  3.28k|  size_t posExiv2Website = posEndEps;
  332|  3.28k|  size_t posEndComments = posEndEps;
  333|  3.28k|  size_t posAi7Thumbnail = posEndEps;
  334|  3.28k|  size_t posAi7ThumbnailEndData = posEndEps;
  335|  3.28k|  size_t posBeginPhotoshop = posEndEps;
  336|  3.28k|  size_t posEndPhotoshop = posEndEps;
  337|  3.28k|  size_t posPage = posEndEps;
  338|  3.28k|  size_t posBeginPageSetup = posEndEps;
  339|  3.28k|  size_t posEndPageSetup = posEndEps;
  340|  3.28k|  size_t posPageTrailer = posEndEps;
  341|  3.28k|  size_t posEof = posEndEps;
  342|  3.28k|  std::vector<std::pair<size_t, size_t>> removableEmbeddings;
  343|  3.28k|  size_t depth = 0;
  344|  3.28k|  const size_t maxDepth = std::numeric_limits<size_t>::max();
  345|  3.28k|  bool illustrator8 = false;
  346|  3.28k|  bool corelDraw = false;
  347|  3.28k|  bool implicitPage = false;
  348|  3.28k|  bool implicitPageSetup = false;
  349|  3.28k|  bool implicitPageTrailer = false;
  350|  3.28k|  bool inDefaultsPreviewPrologSetup = false;
  351|  3.28k|  bool inRemovableEmbedding = false;
  352|  3.28k|  std::string removableEmbeddingEndLine;
  353|  3.28k|  size_t removableEmbeddingsWithUnmarkedTrailer = 0;
  354|   469k|  for (size_t pos = posEps; pos < posEof;) {
  ------------------
  |  Branch (354:29): [True: 466k, False: 3.22k]
  ------------------
  355|   466k|    const size_t startPos = pos;
  356|   466k|    std::string line;
  357|   466k|    pos = readLine(line, data, startPos, posEndEps);
  358|       |#ifdef DEBUG
  359|       |    bool significantLine = true;
  360|       |#endif
  361|       |    // nested documents
  362|   466k|    if (posPage == posEndEps && (line.starts_with("%%IncludeDocument:") || line.starts_with("%%BeginDocument:"))) {
  ------------------
  |  Branch (362:9): [True: 217k, False: 249k]
  |  Branch (362:34): [True: 17, False: 217k]
  |  Branch (362:76): [True: 11, False: 217k]
  ------------------
  363|     28|#ifndef SUPPRESS_WARNINGS
  364|     28|      EXV_WARNING << "Nested document at invalid position: " << startPos << "\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()
  ------------------
  365|     28|#endif
  366|     28|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (366:19): [True: 0, False: 28]
  ------------------
  367|     28|    }
  368|   466k|    if (line.starts_with("%%BeginDocument:")) {
  ------------------
  |  Branch (368:9): [True: 475, False: 466k]
  ------------------
  369|    475|      if (depth == maxDepth) {
  ------------------
  |  Branch (369:11): [True: 0, False: 475]
  ------------------
  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|    475|      depth++;
  376|   466k|    } else if (line.starts_with("%%EndDocument")) {
  ------------------
  |  Branch (376:16): [True: 205, False: 466k]
  ------------------
  377|    205|      if (depth == 0) {
  ------------------
  |  Branch (377:11): [True: 10, False: 195]
  ------------------
  378|     10|#ifndef SUPPRESS_WARNINGS
  379|     10|        EXV_WARNING << "Unmatched EndDocument at position: " << startPos << "\n";
  ------------------
  |  |  138|     10|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 10]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     10|  LogMsg(LogMsg::warn).os()
  ------------------
  380|     10|#endif
  381|     10|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (381:21): [True: 0, False: 10]
  ------------------
  382|     10|      }
  383|    195|      depth--;
  384|   466k|    } else {
  385|       |#ifdef DEBUG
  386|       |      significantLine = false;
  387|       |#endif
  388|   466k|    }
  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|   466k|    if (depth != 0)
  ------------------
  |  Branch (395:9): [True: 1.60k, False: 465k]
  ------------------
  396|  1.60k|      continue;
  397|       |    // explicit "Begin" comments
  398|   465k|    if (line.starts_with("%%BeginPreview:")) {
  ------------------
  |  Branch (398:9): [True: 1.07k, False: 464k]
  ------------------
  399|  1.07k|      inDefaultsPreviewPrologSetup = true;
  400|   464k|    } else if (line == "%%BeginDefaults") {
  ------------------
  |  Branch (400:16): [True: 267, False: 463k]
  ------------------
  401|    267|      inDefaultsPreviewPrologSetup = true;
  402|   463k|    } else if (line == "%%BeginProlog") {
  ------------------
  |  Branch (402:16): [True: 2.70k, False: 461k]
  ------------------
  403|  2.70k|      inDefaultsPreviewPrologSetup = true;
  404|   461k|    } else if (line == "%%BeginSetup") {
  ------------------
  |  Branch (404:16): [True: 210, False: 460k]
  ------------------
  405|    210|      inDefaultsPreviewPrologSetup = true;
  406|   460k|    } else if (posPage == posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (406:16): [True: 213k, False: 247k]
  |  Branch (406:40): [True: 101, False: 213k]
  ------------------
  407|    101|      posPage = startPos;
  408|   460k|    } else if (posPage != posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (408:16): [True: 247k, False: 213k]
  |  Branch (408:40): [True: 21, False: 247k]
  ------------------
  409|     21|      if (implicitPage) {
  ------------------
  |  Branch (409:11): [True: 10, False: 11]
  ------------------
  410|     10|#ifndef SUPPRESS_WARNINGS
  411|     10|        EXV_WARNING << "Page at position " << startPos << " conflicts with implicit page at position: " << posPage
  ------------------
  |  |  138|     10|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 10]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     10|  LogMsg(LogMsg::warn).os()
  ------------------
  412|      0|                    << "\n";
  413|     10|#endif
  414|     10|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (414:21): [True: 0, False: 10]
  ------------------
  415|     10|      }
  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|   460k|    } else if (line == "%%BeginPageSetup") {
  ------------------
  |  Branch (420:16): [True: 199, False: 460k]
  ------------------
  421|    199|      posBeginPageSetup = startPos;
  422|   460k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: Before %%EndPageSetup") {
  ------------------
  |  Branch (422:16): [True: 228k, False: 231k]
  |  Branch (422:41): [True: 982, False: 227k]
  ------------------
  423|    982|      inRemovableEmbedding = true;
  424|    982|      removableEmbeddings.emplace_back(startPos, startPos);
  425|    982|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  426|   459k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: After %%PageTrailer") {
  ------------------
  |  Branch (426:16): [True: 227k, False: 231k]
  |  Branch (426:41): [True: 1.03k, False: 226k]
  ------------------
  427|  1.03k|      inRemovableEmbedding = true;
  428|  1.03k|      removableEmbeddings.emplace_back(startPos, startPos);
  429|  1.03k|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  430|   458k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageSetup End \"AI11EPS\"") {
  ------------------
  |  Branch (430:16): [True: 226k, False: 231k]
  |  Branch (430:41): [True: 1.29k, False: 225k]
  ------------------
  431|  1.29k|      inRemovableEmbedding = true;
  432|  1.29k|      removableEmbeddings.emplace_back(startPos, startPos);
  433|  1.29k|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageSetup End \"AI11EPS\"";
  434|   457k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageTrailer Start \"AI11EPS\"") {
  ------------------
  |  Branch (434:16): [True: 225k, False: 231k]
  |  Branch (434:41): [True: 357, False: 225k]
  ------------------
  435|    357|      inRemovableEmbedding = true;
  436|    357|      removableEmbeddings.emplace_back(startPos, startPos);
  437|    357|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageTrailer Start \"AI11EPS\"";
  438|   456k|    } else if (!inRemovableEmbedding && line == "%begin_xml_code") {
  ------------------
  |  Branch (438:16): [True: 225k, False: 231k]
  |  Branch (438:41): [True: 22.7k, False: 202k]
  ------------------
  439|  22.7k|      inRemovableEmbedding = true;
  440|  22.7k|      removableEmbeddings.emplace_back(startPos, startPos);
  441|  22.7k|      removableEmbeddingEndLine = "%end_xml_code";
  442|  22.7k|      removableEmbeddingsWithUnmarkedTrailer++;
  443|   434k|    } else {
  444|       |#ifdef DEBUG
  445|       |      significantLine = false;
  446|       |#endif
  447|   434k|    }
  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|   465k|    if (line == "%%EOF" || line == "%begin_xml_code" || line.size() < 2 || line.front() != '%' || '\x21' > line[1] ||
  ------------------
  |  Branch (455:9): [True: 11, False: 465k]
  |  Branch (455:28): [True: 30.9k, False: 434k]
  |  Branch (455:57): [True: 67.5k, False: 366k]
  |  Branch (455:76): [True: 173k, False: 193k]
  |  Branch (455:99): [True: 2.83k, False: 190k]
  ------------------
  456|   274k|        line[1] > '\x7e') {
  ------------------
  |  Branch (456:9): [True: 267, False: 190k]
  ------------------
  457|   274k|      if (posEndComments == posEndEps) {
  ------------------
  |  Branch (457:11): [True: 2.02k, False: 272k]
  ------------------
  458|  2.02k|        posEndComments = startPos;
  459|       |#ifdef DEBUG
  460|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndComments at position: " << startPos << "\n";
  461|       |#endif
  462|  2.02k|      }
  463|   274k|    }
  464|   465k|    if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding &&
  ------------------
  |  Branch (464:9): [True: 217k, False: 247k]
  |  Branch (464:33): [True: 200k, False: 17.4k]
  |  Branch (464:64): [True: 13.0k, False: 186k]
  |  Branch (464:97): [True: 3.62k, False: 9.45k]
  ------------------
  465|  3.62k|        !onlyWhitespaces(line)) {
  ------------------
  |  Branch (465:9): [True: 1.69k, False: 1.93k]
  ------------------
  466|  1.69k|      posPage = startPos;
  467|  1.69k|      implicitPage = true;
  468|       |#ifdef DEBUG
  469|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page at position: " << startPos << "\n";
  470|       |#endif
  471|  1.69k|    }
  472|   465k|    if (posBeginPageSetup == posEndEps &&
  ------------------
  |  Branch (472:9): [True: 218k, False: 246k]
  ------------------
  473|   218k|        (implicitPage || (posPage != posEndEps && !inRemovableEmbedding && !line.empty() && line.front() != '%'))) {
  ------------------
  |  Branch (473:10): [True: 1.67k, False: 216k]
  |  Branch (473:27): [True: 1.39k, False: 215k]
  |  Branch (473:51): [True: 1.11k, False: 282]
  |  Branch (473:76): [True: 814, False: 300]
  |  Branch (473:93): [True: 45, False: 769]
  ------------------
  474|  1.72k|      posBeginPageSetup = startPos;
  475|  1.72k|      implicitPageSetup = true;
  476|       |#ifdef DEBUG
  477|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  478|       |#endif
  479|  1.72k|    }
  480|   465k|    if (posEndPageSetup == posEndEps && implicitPageSetup && !inRemovableEmbedding && !line.empty() &&
  ------------------
  |  Branch (480:9): [True: 223k, False: 241k]
  |  Branch (480:41): [True: 6.96k, False: 216k]
  |  Branch (480:62): [True: 4.86k, False: 2.09k]
  |  Branch (480:87): [True: 4.00k, False: 865]
  ------------------
  481|  4.00k|        line.front() != '%') {
  ------------------
  |  Branch (481:9): [True: 1.41k, False: 2.58k]
  ------------------
  482|  1.41k|      posEndPageSetup = startPos;
  483|       |#ifdef DEBUG
  484|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  485|       |#endif
  486|  1.41k|    }
  487|   465k|    if (!line.empty() && line.front() != '%')
  ------------------
  |  Branch (487:9): [True: 400k, False: 64.5k]
  |  Branch (487:26): [True: 175k, False: 224k]
  ------------------
  488|   175k|      continue;  // performance optimization
  489|   289k|    if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
  ------------------
  |  Branch (489:9): [True: 11, False: 289k]
  |  Branch (489:28): [True: 334, False: 289k]
  |  Branch (489:51): [True: 225, False: 288k]
  ------------------
  490|    570|      if (posBeginPageSetup == posEndEps) {
  ------------------
  |  Branch (490:11): [True: 27, False: 543]
  ------------------
  491|     27|        posBeginPageSetup = startPos;
  492|     27|        implicitPageSetup = true;
  493|       |#ifdef DEBUG
  494|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  495|       |#endif
  496|     27|      }
  497|    570|      if (posEndPageSetup == posEndEps) {
  ------------------
  |  Branch (497:11): [True: 45, False: 525]
  ------------------
  498|     45|        posEndPageSetup = startPos;
  499|     45|        implicitPageSetup = true;
  500|       |#ifdef DEBUG
  501|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  502|       |#endif
  503|     45|      }
  504|    570|    }
  505|   289k|    if ((line == "%%EOF" || line == "%%Trailer") && posPageTrailer == posEndEps) {
  ------------------
  |  Branch (505:10): [True: 11, False: 289k]
  |  Branch (505:29): [True: 334, False: 289k]
  |  Branch (505:53): [True: 64, False: 281]
  ------------------
  506|     64|      posPageTrailer = startPos;
  507|     64|      implicitPageTrailer = true;
  508|       |#ifdef DEBUG
  509|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit PageTrailer at position: " << startPos << "\n";
  510|       |#endif
  511|     64|    }
  512|       |    // remaining explicit comments
  513|   289k|    if (posEndComments == posEndEps && posLanguageLevel == posEndEps && line.starts_with("%%LanguageLevel:")) {
  ------------------
  |  Branch (513:9): [True: 18.0k, False: 271k]
  |  Branch (513:40): [True: 17.1k, False: 900]
  |  Branch (513:73): [True: 32, False: 17.1k]
  ------------------
  514|     32|      posLanguageLevel = startPos;
  515|   289k|    } else if (posEndComments == posEndEps && posContainsXmp == posEndEps && line.starts_with("%ADO_ContainsXMP:")) {
  ------------------
  |  Branch (515:16): [True: 18.0k, False: 271k]
  |  Branch (515:47): [True: 17.2k, False: 755]
  |  Branch (515:78): [True: 675, False: 16.5k]
  ------------------
  516|    675|      posContainsXmp = startPos;
  517|   288k|    } else if (posEndComments == posEndEps && posPages == posEndEps && line.starts_with("%%Pages:")) {
  ------------------
  |  Branch (517:16): [True: 17.3k, False: 271k]
  |  Branch (517:47): [True: 16.7k, False: 592]
  |  Branch (517:72): [True: 63, False: 16.6k]
  ------------------
  518|     63|      posPages = startPos;
  519|   288k|    } else if (posEndComments == posEndEps && posExiv2Version == posEndEps && line.starts_with("%Exiv2Version:")) {
  ------------------
  |  Branch (519:16): [True: 17.2k, False: 271k]
  |  Branch (519:47): [True: 16.9k, False: 373]
  |  Branch (519:79): [True: 32, False: 16.8k]
  ------------------
  520|     32|      posExiv2Version = startPos;
  521|   288k|    } else if (posEndComments == posEndEps && posExiv2Website == posEndEps && line.starts_with("%Exiv2Website:")) {
  ------------------
  |  Branch (521:16): [True: 17.2k, False: 271k]
  |  Branch (521:47): [True: 16.8k, False: 441]
  |  Branch (521:79): [True: 25, False: 16.7k]
  ------------------
  522|     25|      posExiv2Website = startPos;
  523|   288k|    } else if (posEndComments == posEndEps && line.starts_with("%%Creator: Adobe Illustrator") &&
  ------------------
  |  Branch (523:16): [True: 17.2k, False: 271k]
  |  Branch (523:47): [True: 925, False: 16.3k]
  ------------------
  524|    925|               firstLine == "%!PS-Adobe-3.0 EPSF-3.0") {
  ------------------
  |  Branch (524:16): [True: 361, False: 564]
  ------------------
  525|    361|      illustrator8 = true;
  526|   288k|    } else if (posEndComments == posEndEps && line.starts_with("%AI7_Thumbnail:")) {
  ------------------
  |  Branch (526:16): [True: 16.8k, False: 271k]
  |  Branch (526:47): [True: 911, False: 15.9k]
  ------------------
  527|    911|      posAi7Thumbnail = startPos;
  528|   287k|    } else if (posEndComments == posEndEps && posAi7Thumbnail != posEndEps && posAi7ThumbnailEndData == posEndEps &&
  ------------------
  |  Branch (528:16): [True: 15.9k, False: 271k]
  |  Branch (528:47): [True: 4.51k, False: 11.4k]
  |  Branch (528:79): [True: 3.99k, False: 518]
  ------------------
  529|  3.99k|               line == "%%EndData") {
  ------------------
  |  Branch (529:16): [True: 383, False: 3.61k]
  ------------------
  530|    383|      posAi7ThumbnailEndData = startPos;
  531|   286k|    } else if (posEndComments == posEndEps && line == "%%EndComments") {
  ------------------
  |  Branch (531:16): [True: 15.5k, False: 271k]
  |  Branch (531:47): [True: 10, False: 15.5k]
  ------------------
  532|     10|      posEndComments = startPos;
  533|   286k|    } else if (inDefaultsPreviewPrologSetup && line.starts_with("%%BeginResource: procset wCorel")) {
  ------------------
  |  Branch (533:16): [True: 195k, False: 91.8k]
  |  Branch (533:48): [True: 2.29k, False: 192k]
  ------------------
  534|  2.29k|      corelDraw = true;
  535|   284k|    } else if (line == "%%EndPreview") {
  ------------------
  |  Branch (535:16): [True: 831, False: 283k]
  ------------------
  536|    831|      inDefaultsPreviewPrologSetup = false;
  537|   283k|    } else if (line == "%%EndDefaults") {
  ------------------
  |  Branch (537:16): [True: 917, False: 282k]
  ------------------
  538|    917|      inDefaultsPreviewPrologSetup = false;
  539|   282k|    } else if (line == "%%EndProlog") {
  ------------------
  |  Branch (539:16): [True: 514, False: 282k]
  ------------------
  540|    514|      inDefaultsPreviewPrologSetup = false;
  541|   282k|    } else if (line == "%%EndSetup") {
  ------------------
  |  Branch (541:16): [True: 219, False: 282k]
  ------------------
  542|    219|      inDefaultsPreviewPrologSetup = false;
  543|   282k|    } else if (posEndPageSetup == posEndEps && line == "%%EndPageSetup") {
  ------------------
  |  Branch (543:16): [True: 160k, False: 122k]
  |  Branch (543:48): [True: 26, False: 160k]
  ------------------
  544|     26|      posEndPageSetup = startPos;
  545|   282k|    } else if (posPageTrailer == posEndEps && line == "%%PageTrailer") {
  ------------------
  |  Branch (545:16): [True: 233k, False: 48.8k]
  |  Branch (545:47): [True: 30, False: 233k]
  ------------------
  546|     30|      posPageTrailer = startPos;
  547|   282k|    } else if (posBeginPhotoshop == posEndEps && line.starts_with("%BeginPhotoshop:")) {
  ------------------
  |  Branch (547:16): [True: 263k, False: 18.5k]
  |  Branch (547:50): [True: 136, False: 263k]
  ------------------
  548|    136|      posBeginPhotoshop = pos;
  549|   281k|    } else if (posBeginPhotoshop != posEndEps && posEndPhotoshop == posEndEps && line == "%EndPhotoshop") {
  ------------------
  |  Branch (549:16): [True: 18.5k, False: 263k]
  |  Branch (549:50): [True: 7.74k, False: 10.8k]
  |  Branch (549:82): [True: 52, False: 7.69k]
  ------------------
  550|     52|      posEndPhotoshop = startPos;
  551|   281k|    } else if (inRemovableEmbedding && line == removableEmbeddingEndLine) {
  ------------------
  |  Branch (551:16): [True: 188k, False: 93.9k]
  |  Branch (551:40): [True: 25.9k, False: 162k]
  ------------------
  552|  25.9k|      inRemovableEmbedding = false;
  553|  25.9k|      removableEmbeddings.back().second = pos;
  554|   255k|    } else if (line == "%%EOF") {
  ------------------
  |  Branch (554:16): [True: 11, False: 255k]
  ------------------
  555|     11|      posEof = startPos;
  556|   255k|    } else {
  557|       |#ifdef DEBUG
  558|       |      significantLine = false;
  559|       |#endif
  560|   255k|    }
  561|       |#ifdef DEBUG
  562|       |    if (significantLine) {
  563|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  564|       |    }
  565|       |#endif
  566|   289k|  }
  567|       |
  568|       |  // check for unfinished nested documents
  569|  3.22k|  if (depth != 0) {
  ------------------
  |  Branch (569:7): [True: 27, False: 3.19k]
  ------------------
  570|     27|#ifndef SUPPRESS_WARNINGS
  571|     27|    EXV_WARNING << "Unmatched BeginDocument (" << depth << "x)\n";
  ------------------
  |  |  138|     27|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 27]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     27|  LogMsg(LogMsg::warn).os()
  ------------------
  572|     27|#endif
  573|     27|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (573:17): [True: 0, False: 27]
  ------------------
  574|     27|  }
  575|       |
  576|       |  // look for the unmarked trailers of some removable XMP embeddings
  577|  3.19k|  size_t posXmpTrailerEnd = posEof;
  578|  3.28k|  for (size_t i = 0; i < removableEmbeddingsWithUnmarkedTrailer; i++) {
  ------------------
  |  Branch (578:22): [True: 382, False: 2.90k]
  ------------------
  579|    382|    std::string line1;
  580|    382|    const size_t posLine1 = readPrevLine(line1, data, posXmpTrailerEnd, posEndEps);
  581|    382|    std::string line2;
  582|    382|    const size_t posLine2 = readPrevLine(line2, data, posLine1, posEndEps);
  583|    382|    size_t posXmpTrailer;
  584|    382|    if (line1 == "[/EMC pdfmark") {  // Exiftool style
  ------------------
  |  Branch (584:9): [True: 87, False: 295]
  ------------------
  585|     87|      posXmpTrailer = posLine1;
  586|    295|    } else if (line1 == "[/NamespacePop pdfmark" &&
  ------------------
  |  Branch (586:16): [True: 36, False: 259]
  ------------------
  587|     36|               line2 ==
  ------------------
  |  Branch (587:16): [True: 1, False: 35]
  ------------------
  588|     36|                   "[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT "
  589|     36|                   "pdfmark") {  // Photoshop style
  590|      1|      posXmpTrailer = posLine2;
  591|    294|    } else {
  592|    294|#ifndef SUPPRESS_WARNINGS
  593|    294|      EXV_WARNING << "Unable to find XMP embedding trailer ending at position: " << posXmpTrailerEnd << "\n";
  ------------------
  |  |  138|    294|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 294]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    294|  LogMsg(LogMsg::warn).os()
  ------------------
  594|    294|#endif
  595|    294|      if (write)
  ------------------
  |  Branch (595:11): [True: 0, False: 294]
  ------------------
  596|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  597|    294|      break;
  598|    294|    }
  599|     88|    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|     88|    posXmpTrailerEnd = posXmpTrailer;
  606|     88|  }
  607|       |
  608|       |  // interpret comment "%ADO_ContainsXMP:"
  609|  3.19k|  std::string line;
  610|  3.19k|  readLine(line, data, posContainsXmp, posEndEps);
  611|  3.19k|  bool containsXmp;
  612|  3.19k|  if (line == "%ADO_ContainsXMP: MainFirst" || line == "%ADO_ContainsXMP:MainFirst") {
  ------------------
  |  Branch (612:7): [True: 466, False: 2.73k]
  |  Branch (612:48): [True: 519, False: 2.21k]
  ------------------
  613|    529|    containsXmp = true;
  614|  2.66k|  } else if (line.empty() || line == "%ADO_ContainsXMP: NoMain" || line == "%ADO_ContainsXMP:NoMain") {
  ------------------
  |  Branch (614:14): [True: 2.52k, False: 146]
  |  Branch (614:30): [True: 10, False: 136]
  |  Branch (614:68): [True: 10, False: 126]
  ------------------
  615|  2.08k|    containsXmp = false;
  616|  2.08k|  } else {
  617|    582|#ifndef SUPPRESS_WARNINGS
  618|    582|    EXV_WARNING << "Invalid line \"" << line << "\" at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|    582|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 582]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    582|  LogMsg(LogMsg::warn).os()
  ------------------
  619|    582|#endif
  620|    582|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (620:17): [True: 0, False: 582]
  ------------------
  621|    582|  }
  622|       |
  623|  2.61k|  const bool deleteXmp = (write && xmpPacket.empty());
  ------------------
  |  Branch (623:27): [True: 0, False: 2.61k]
  |  Branch (623:36): [True: 0, False: 0]
  ------------------
  624|  2.61k|  bool fixBeginXmlPacket = false;
  625|  2.61k|  bool useFlexibleEmbedding = false;
  626|  2.61k|  size_t xmpPos = posEndEps;
  627|  2.61k|  size_t xmpSize = 0;
  628|  2.61k|  if (containsXmp) {
  ------------------
  |  Branch (628:7): [True: 529, False: 2.08k]
  ------------------
  629|       |    // search for XMP metadata
  630|    529|    findXmp(xmpPos, xmpSize, data, posEps, posEndEps, write);
  631|    529|    if (xmpPos == posEndEps) {
  ------------------
  |  Branch (631:9): [True: 32, False: 497]
  ------------------
  632|     32|#ifndef SUPPRESS_WARNINGS
  633|     32|      EXV_WARNING << "Unable to find XMP metadata as announced at position: " << posContainsXmp << "\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()
  ------------------
  634|     32|#endif
  635|     32|    }
  636|       |    // check embedding of XMP metadata
  637|    529|    const size_t posLineAfterXmp = readLine(line, data, xmpPos + xmpSize, posEndEps);
  638|    529|    if (!line.empty()) {
  ------------------
  |  Branch (638:9): [True: 351, False: 178]
  ------------------
  639|    351|#ifndef SUPPRESS_WARNINGS
  640|    351|      EXV_WARNING << "Unexpected " << line.size() << " bytes of data after XMP at position: " << (xmpPos + xmpSize)
  ------------------
  |  |  138|    351|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 351]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    351|  LogMsg(LogMsg::warn).os()
  ------------------
  641|      0|                  << "\n";
  642|    351|#endif
  643|    351|    } else if (!deleteXmp) {
  ------------------
  |  Branch (643:16): [True: 133, False: 45]
  ------------------
  644|    133|      readLine(line, data, posLineAfterXmp, posEndEps);
  645|    133|      if (line == "% &&end XMP packet marker&&" || line == "%  &&end XMP packet marker&&") {
  ------------------
  |  Branch (645:11): [True: 34, False: 99]
  |  Branch (645:52): [True: 7, False: 92]
  ------------------
  646|     41|        useFlexibleEmbedding = true;
  647|     41|      }
  648|    133|    }
  649|    529|  }
  650|  2.61k|  if (useFlexibleEmbedding) {
  ------------------
  |  Branch (650:7): [True: 41, False: 2.57k]
  ------------------
  651|       |#ifdef DEBUG
  652|       |    EXV_DEBUG << "readWriteEpsMetadata: Using flexible XMP embedding\n";
  653|       |#endif
  654|     41|    const size_t posBeginXmlPacket = readPrevLine(line, data, xmpPos, posEndEps);
  655|     41|    if (line.starts_with("%begin_xml_packet:")) {
  ------------------
  |  Branch (655:9): [True: 6, False: 35]
  ------------------
  656|       |#ifdef DEBUG
  657|       |      EXV_DEBUG << "readWriteEpsMetadata: XMP embedding contains %begin_xml_packet\n";
  658|       |#endif
  659|      6|      if (write) {
  ------------------
  |  Branch (659:11): [True: 0, False: 6]
  ------------------
  660|      0|        fixBeginXmlPacket = true;
  661|      0|        xmpSize += (xmpPos - posBeginXmlPacket);
  662|      0|        xmpPos = posBeginXmlPacket;
  663|      0|      }
  664|     35|    } else if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (664:16): [True: 14, False: 21]
  ------------------
  665|     14|#ifndef SUPPRESS_WARNINGS
  666|     14|      EXV_WARNING << "Missing %begin_xml_packet in Photoshop EPS at position: " << xmpPos << "\n";
  ------------------
  |  |  138|     14|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 14]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     14|  LogMsg(LogMsg::warn).os()
  ------------------
  667|     14|#endif
  668|     14|      if (write)
  ------------------
  |  Branch (668:11): [True: 0, False: 14]
  ------------------
  669|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  670|     14|    }
  671|     41|  }
  672|  2.61k|  if (!useFlexibleEmbedding) {
  ------------------
  |  Branch (672:7): [True: 2.53k, False: 86]
  ------------------
  673|       |    // check if there are irremovable XMP metadata blocks before EndPageSetup
  674|  2.53k|    size_t posOtherXmp = containsXmp ? xmpPos : posEps;
  ------------------
  |  Branch (674:26): [True: 443, False: 2.08k]
  ------------------
  675|  2.53k|    size_t sizeOtherXmp = 0;
  676|  4.35k|    for (;;) {
  677|  4.35k|      findXmp(posOtherXmp, sizeOtherXmp, data, posOtherXmp + sizeOtherXmp, posEndPageSetup, write);
  678|  4.35k|      if (posOtherXmp >= posEndPageSetup)
  ------------------
  |  Branch (678:11): [True: 2.27k, False: 2.08k]
  ------------------
  679|  2.27k|        break;
  680|  2.08k|      bool isRemovableEmbedding = false;
  681|  51.2k|      for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (681:31): [True: 51.2k, False: 259]
  ------------------
  682|  51.2k|        if (r <= posOtherXmp && posOtherXmp < s) {
  ------------------
  |  Branch (682:13): [True: 46.8k, False: 4.41k]
  |  Branch (682:33): [True: 1.82k, False: 45.0k]
  ------------------
  683|  1.82k|          isRemovableEmbedding = true;
  684|  1.82k|          break;
  685|  1.82k|        }
  686|  51.2k|      }
  687|  2.08k|      if (!isRemovableEmbedding) {
  ------------------
  |  Branch (687:11): [True: 114, False: 1.96k]
  ------------------
  688|    114|#ifndef SUPPRESS_WARNINGS
  689|    114|        EXV_WARNING << "XMP metadata block is not removable at position: " << posOtherXmp << "\n";
  ------------------
  |  |  138|    114|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 114]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    114|  LogMsg(LogMsg::warn).os()
  ------------------
  690|    114|#endif
  691|    114|        if (write)
  ------------------
  |  Branch (691:13): [True: 0, False: 114]
  ------------------
  692|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  693|    114|        break;
  694|    114|      }
  695|  2.08k|    }
  696|  2.53k|  }
  697|       |
  698|  2.61k|  if (!write) {
  ------------------
  |  Branch (698:7): [True: 2.42k, False: 190]
  ------------------
  699|       |    // copy XMP metadata
  700|  2.42k|    xmpPacket.assign(reinterpret_cast<const char*>(data + xmpPos), xmpSize);
  701|       |
  702|       |    // native previews
  703|  2.42k|    nativePreviews.clear();
  704|  2.42k|    if (posAi7ThumbnailEndData != posEndEps) {
  ------------------
  |  Branch (704:9): [True: 382, False: 2.04k]
  ------------------
  705|    382|      NativePreview nativePreview;
  706|    382|      std::string dummy;
  707|    382|      std::string lineAi7Thumbnail;
  708|    382|      const size_t posBeginData = readLine(lineAi7Thumbnail, data, posAi7Thumbnail, posEndEps);
  709|    382|      std::istringstream lineStreamAi7Thumbnail(lineAi7Thumbnail);
  710|    382|      lineStreamAi7Thumbnail >> dummy;
  711|    382|      lineStreamAi7Thumbnail >> nativePreview.width_;
  712|    382|      lineStreamAi7Thumbnail >> nativePreview.height_;
  713|    382|      std::string depthStr;
  714|    382|      lineStreamAi7Thumbnail >> depthStr;
  715|    382|      std::string lineBeginData;
  716|    382|      const size_t posAfterBeginData = readLine(lineBeginData, data, posBeginData, posEndEps);
  717|    382|      std::istringstream lineStreamBeginData(lineBeginData);
  718|    382|      std::string beginData;
  719|    382|      lineStreamBeginData >> beginData;
  720|    382|      lineStreamBeginData >> dummy;
  721|    382|      std::string type;
  722|    382|      lineStreamBeginData >> type;
  723|    382|      nativePreview.position_ = static_cast<long>(posAfterBeginData);
  724|    382|      nativePreview.size_ = static_cast<uint32_t>(posAi7ThumbnailEndData - posAfterBeginData);
  725|    382|      nativePreview.filter_ = "hex-ai7thumbnail-pnm";
  726|    382|      nativePreview.mimeType_ = "image/x-portable-anymap";
  727|    382|      if (depthStr != "8") {
  ------------------
  |  Branch (727:11): [True: 142, False: 240]
  ------------------
  728|    142|#ifndef SUPPRESS_WARNINGS
  729|    142|        EXV_WARNING << "Unable to handle Illustrator thumbnail depth: " << depthStr << "\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()
  ------------------
  730|    142|#endif
  731|    240|      } else if (beginData != "%%BeginData:") {
  ------------------
  |  Branch (731:18): [True: 43, False: 197]
  ------------------
  732|     43|#ifndef SUPPRESS_WARNINGS
  733|     43|        EXV_WARNING << "Unable to handle Illustrator thumbnail data section: " << lineBeginData << "\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()
  ------------------
  734|     43|#endif
  735|    197|      } else if (type != "Hex") {
  ------------------
  |  Branch (735:18): [True: 44, False: 153]
  ------------------
  736|     44|#ifndef SUPPRESS_WARNINGS
  737|     44|        EXV_WARNING << "Unable to handle Illustrator thumbnail data type: " << type << "\n";
  ------------------
  |  |  138|     44|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 44]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     44|  LogMsg(LogMsg::warn).os()
  ------------------
  738|     44|#endif
  739|    153|      } else {
  740|    153|        nativePreviews.push_back(std::move(nativePreview));
  741|    153|      }
  742|    382|    }
  743|  2.42k|    if (posEndPhotoshop != posEndEps) {
  ------------------
  |  Branch (743:9): [True: 52, False: 2.37k]
  ------------------
  744|     52|      auto sizePhotoshop = posEndPhotoshop - posBeginPhotoshop;
  745|     52|      NativePreview nativePreview{posBeginPhotoshop, sizePhotoshop, 0, 0, "hex-irb", "image/jpeg"};
  746|     52|      nativePreviews.push_back(std::move(nativePreview));
  747|     52|    }
  748|  2.42k|    if (sizeWmf != 0) {
  ------------------
  |  Branch (748:9): [True: 6, False: 2.42k]
  ------------------
  749|      6|      NativePreview nativePreview{posWmf, sizeWmf, 0, 0, "", "image/x-wmf"};
  750|      6|      nativePreviews.push_back(std::move(nativePreview));
  751|      6|    }
  752|  2.42k|    if (sizeTiff != 0) {
  ------------------
  |  Branch (752:9): [True: 6, False: 2.42k]
  ------------------
  753|      6|      NativePreview nativePreview{posTiff, sizeTiff, 0, 0, "", "image/tiff"};
  754|      6|      nativePreviews.push_back(std::move(nativePreview));
  755|      6|    }
  756|  2.42k|  } else {
  757|       |    // check for Adobe Illustrator 8.0 or older
  758|    190|    if (illustrator8) {
  ------------------
  |  Branch (758:9): [True: 0, False: 190]
  ------------------
  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|    190|    MemIo tempIo;
  767|    190|    if (!tempIo.isopen()) {
  ------------------
  |  Branch (767:9): [True: 0, False: 190]
  ------------------
  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|    190|    std::vector<size_t> positions;
  779|    190|    positions.push_back(posLanguageLevel);
  780|    190|    positions.push_back(posContainsXmp);
  781|    190|    positions.push_back(posPages);
  782|    190|    positions.push_back(posExiv2Version);
  783|    190|    positions.push_back(posExiv2Website);
  784|    190|    positions.push_back(posEndComments);
  785|    190|    positions.push_back(posPage);
  786|    190|    positions.push_back(posBeginPageSetup);
  787|    190|    positions.push_back(posEndPageSetup);
  788|    190|    positions.push_back(posPageTrailer);
  789|    190|    positions.push_back(posEof);
  790|    190|    positions.push_back(posEndEps);
  791|    190|    if (useFlexibleEmbedding) {
  ------------------
  |  Branch (791:9): [True: 0, False: 190]
  ------------------
  792|      0|      positions.push_back(xmpPos);
  793|      0|    }
  794|    190|    for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (794:29): [True: 0, False: 190]
  ------------------
  795|      0|      positions.push_back(r);
  796|      0|    }
  797|    190|    std::sort(positions.begin(), positions.end());
  798|       |
  799|       |    // assemble result EPS document
  800|    190|    if (dosEps) {
  ------------------
  |  Branch (800:9): [True: 0, False: 190]
  ------------------
  801|       |      // DOS EPS header will be written afterwards
  802|      0|      writeTemp(tempIo, std::string(30, '\x00'));
  803|      0|    }
  804|    190|    const std::string containsXmpLine = deleteXmp ? "%ADO_ContainsXMP: NoMain" : "%ADO_ContainsXMP: MainFirst";
  ------------------
  |  Branch (804:41): [True: 0, False: 190]
  ------------------
  805|    190|    const uint32_t posEpsNew = posTemp(tempIo);
  806|    190|    size_t prevPos = posEps;
  807|    190|    size_t prevSkipPos = prevPos;
  808|    190|    for (const auto& pos : positions) {
  ------------------
  |  Branch (808:26): [True: 0, False: 190]
  ------------------
  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|    190|    const uint32_t posEndEpsNew = posTemp(tempIo);
  986|       |#ifdef DEBUG
  987|       |    EXV_DEBUG << "readWriteEpsMetadata: New EPS size: " << (posEndEpsNew - posEpsNew) << "\n";
  988|       |#endif
  989|    190|    if (dosEps) {
  ------------------
  |  Branch (989:9): [True: 0, False: 190]
  ------------------
  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|    190|    io.close();
 1017|    190|    io.transfer(tempIo);
 1018|    190|  }
 1019|  2.61k|}
epsimage.cpp:_ZN12_GLOBAL__N_18readLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  117|   473k|size_t readLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  118|   473k|  line.clear();
  119|   473k|  size_t pos = startPos;
  120|       |  // step through line
  121|  77.1M|  while (pos < size && data[pos] != '\r' && data[pos] != '\n') {
  ------------------
  |  Branch (121:10): [True: 77.1M, False: 4.85k]
  |  Branch (121:24): [True: 76.9M, False: 205k]
  |  Branch (121:45): [True: 76.7M, False: 263k]
  ------------------
  122|  76.7M|    line += data[pos];
  123|  76.7M|    pos++;
  124|  76.7M|  }
  125|       |  // skip line ending, if present
  126|   473k|  if (pos >= size)
  ------------------
  |  Branch (126:7): [True: 4.85k, False: 468k]
  ------------------
  127|  4.85k|    return pos;
  128|   468k|  pos++;
  129|   468k|  if (pos >= size)
  ------------------
  |  Branch (129:7): [True: 440, False: 468k]
  ------------------
  130|    440|    return pos;
  131|   468k|  if (data[pos - 1] == '\r' && data[pos] == '\n')
  ------------------
  |  Branch (131:7): [True: 205k, False: 263k]
  |  Branch (131:32): [True: 4.97k, False: 200k]
  ------------------
  132|  4.97k|    pos++;
  133|   468k|  return pos;
  134|   468k|}
epsimage.cpp:_ZN12_GLOBAL__N_115onlyWhitespacesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  110|  3.62k|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.62k|  return s.find_first_not_of(" \t") == std::string::npos;
  114|  3.62k|}
epsimage.cpp:_ZN12_GLOBAL__N_112readPrevLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  137|    805|size_t readPrevLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  138|    805|  line.clear();
  139|    805|  size_t pos = startPos;
  140|    805|  if (pos > size)
  ------------------
  |  Branch (140:7): [True: 0, False: 805]
  ------------------
  141|      0|    return pos;
  142|       |  // skip line ending of previous line, if present
  143|    805|  if (pos <= 0)
  ------------------
  |  Branch (143:7): [True: 0, False: 805]
  ------------------
  144|      0|    return pos;
  145|    805|  if (data[pos - 1] == '\r' || data[pos - 1] == '\n') {
  ------------------
  |  Branch (145:7): [True: 368, False: 437]
  |  Branch (145:32): [True: 158, False: 279]
  ------------------
  146|    526|    pos--;
  147|    526|    if (pos <= 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 526]
  ------------------
  148|      0|      return pos;
  149|    526|    if (data[pos - 1] == '\r' && data[pos] == '\n') {
  ------------------
  |  Branch (149:9): [True: 90, False: 436]
  |  Branch (149:34): [True: 22, False: 68]
  ------------------
  150|     22|      pos--;
  151|     22|      if (pos <= 0)
  ------------------
  |  Branch (151:11): [True: 0, False: 22]
  ------------------
  152|      0|        return pos;
  153|     22|    }
  154|    526|  }
  155|       |  // step through previous line
  156|  5.18M|  while (pos >= 1 && data[pos - 1] != '\r' && data[pos - 1] != '\n') {
  ------------------
  |  Branch (156:10): [True: 5.18M, False: 11]
  |  Branch (156:22): [True: 5.18M, False: 508]
  |  Branch (156:47): [True: 5.18M, False: 286]
  ------------------
  157|  5.18M|    pos--;
  158|  5.18M|    line += data[pos];
  159|  5.18M|  }
  160|    805|  std::reverse(line.begin(), line.end());
  161|    805|  return pos;
  162|    805|}
epsimage.cpp:_ZN12_GLOBAL__N_17findXmpERmS0_PKhmmb:
  165|  4.88k|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|  4.88k|  xmpSize = 0;
  168|  17.9M|  for (xmpPos = startPos; xmpPos < size; xmpPos++) {
  ------------------
  |  Branch (168:27): [True: 17.9M, False: 2.30k]
  ------------------
  169|  17.9M|    if (data[xmpPos] != '\x00' && data[xmpPos] != '<')
  ------------------
  |  Branch (169:9): [True: 14.3M, False: 3.65M]
  |  Branch (169:35): [True: 14.3M, False: 36.0k]
  ------------------
  170|  14.3M|      continue;
  171|  29.4M|    for (auto&& header : xmpHeaders) {
  ------------------
  |  Branch (171:24): [True: 29.4M, False: 3.68M]
  ------------------
  172|  29.4M|      if (xmpPos + header.size() > size)
  ------------------
  |  Branch (172:11): [True: 49.7k, False: 29.4M]
  ------------------
  173|  49.7k|        continue;
  174|  29.4M|      if (memcmp(data + xmpPos, header.data(), header.size()) != 0)
  ------------------
  |  Branch (174:11): [True: 29.4M, False: 2.57k]
  ------------------
  175|  29.4M|        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|  21.5M|      for (size_t trailerPos = xmpPos + header.size(); trailerPos < size; trailerPos++) {
  ------------------
  |  Branch (181:56): [True: 21.5M, False: 120]
  ------------------
  182|  21.5M|        if (data[trailerPos] != '\x00' && data[trailerPos] != '<')
  ------------------
  |  Branch (182:13): [True: 20.3M, False: 1.14M]
  |  Branch (182:43): [True: 20.3M, False: 49.1k]
  ------------------
  183|  20.3M|          continue;
  184|  4.76M|        for (const auto& [trailer, readOnly] : xmpTrailers) {
  ------------------
  |  Branch (184:46): [True: 4.76M, False: 1.18M]
  ------------------
  185|  4.76M|          if (trailerPos + trailer.size() > size)
  ------------------
  |  Branch (185:15): [True: 1.40k, False: 4.76M]
  ------------------
  186|  1.40k|            continue;
  187|  4.76M|          if (memcmp(data + trailerPos, trailer.data(), trailer.size()) != 0)
  ------------------
  |  Branch (187:15): [True: 4.75M, False: 2.45k]
  ------------------
  188|  4.75M|            continue;
  189|       |#ifdef DEBUG
  190|       |          EXV_DEBUG << "findXmp: Found XMP trailer at position: " << trailerPos << "\n";
  191|       |#endif
  192|       |
  193|  2.45k|          if (readOnly) {
  ------------------
  |  Branch (193:15): [True: 26, False: 2.43k]
  ------------------
  194|     26|#ifndef SUPPRESS_WARNINGS
  195|     26|            EXV_WARNING << "Unable to handle read-only XMP metadata yet. Please provide your "
  ------------------
  |  |  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()
  ------------------
  196|      0|                           "sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2\n";
  197|     26|#endif
  198|     26|            throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (198:25): [True: 0, False: 26]
  ------------------
  199|     26|          }
  200|       |
  201|       |          // search for end of XMP trailer
  202|   843k|          for (size_t trailerEndPos = trailerPos + trailer.size(); trailerEndPos + xmpTrailerEnd.size() <= size;
  ------------------
  |  Branch (202:68): [True: 842k, False: 44]
  ------------------
  203|   842k|               trailerEndPos++) {
  204|   842k|            if (memcmp(data + trailerEndPos, xmpTrailerEnd.data(), xmpTrailerEnd.size()) == 0) {
  ------------------
  |  Branch (204:17): [True: 2.38k, False: 840k]
  ------------------
  205|  2.38k|              xmpSize = (trailerEndPos + xmpTrailerEnd.size()) - xmpPos;
  206|  2.38k|              return;
  207|  2.38k|            }
  208|   842k|          }
  209|     44|#ifndef SUPPRESS_WARNINGS
  210|     44|          EXV_WARNING << "Found XMP header but incomplete XMP trailer.\n";
  ------------------
  |  |  138|     44|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 44]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     44|  LogMsg(LogMsg::warn).os()
  ------------------
  211|     44|#endif
  212|     44|          throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (212:23): [True: 0, False: 44]
  ------------------
  213|  2.43k|        }
  214|  1.19M|      }
  215|    120|#ifndef SUPPRESS_WARNINGS
  216|    120|      EXV_WARNING << "Found XMP header but no XMP trailer.\n";
  ------------------
  |  |  138|    120|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 120]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    120|  LogMsg(LogMsg::warn).os()
  ------------------
  217|    120|#endif
  218|    120|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (218:19): [True: 0, False: 120]
  ------------------
  219|  2.57k|    }
  220|  3.68M|  }
  221|  4.88k|}

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

_ZN5Exiv29ExifdatumC2ERKNS_7ExifKeyEPKNS_5ValueE:
  157|  1.01M|Exifdatum::Exifdatum(const ExifKey& key, const Value* pValue) : key_(key.clone()) {
  158|  1.01M|  if (pValue)
  ------------------
  |  Branch (158:7): [True: 1.01M, False: 4.06k]
  ------------------
  159|  1.01M|    value_ = pValue->clone();
  160|  1.01M|}
_ZN5Exiv29ExifdatumC2ERKS0_:
  162|  1.16M|Exifdatum::Exifdatum(const Exifdatum& rhs) {
  163|  1.16M|  if (rhs.key_)
  ------------------
  |  Branch (163:7): [True: 1.16M, False: 0]
  ------------------
  164|  1.16M|    key_ = rhs.key_->clone();  // deep copy
  165|  1.16M|  if (rhs.value_)
  ------------------
  |  Branch (165:7): [True: 1.16M, False: 0]
  ------------------
  166|  1.16M|    value_ = rhs.value_->clone();  // deep copy
  167|  1.16M|}
_ZN5Exiv29ExifdatumD2Ev:
  169|  2.17M|Exifdatum::~Exifdatum() = default;
_ZNK5Exiv29Exifdatum5valueEv:
  203|   167k|const Value& Exifdatum::value() const {
  204|   167k|  if (!value_)
  ------------------
  |  Branch (204:7): [True: 0, False: 167k]
  ------------------
  205|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  206|   167k|  return *value_;
  207|   167k|}
_ZN5Exiv29ExifdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  224|  2.96k|Exifdatum& Exifdatum::operator=(const std::string& value) {
  225|  2.96k|  setValue(value);
  226|  2.96k|  return *this;
  227|  2.96k|}
_ZN5Exiv29ExifdatumaSERKt:
  229|     22|Exifdatum& Exifdatum::operator=(const uint16_t& value) {
  230|     22|  return Exiv2::setValue(*this, value);
  231|     22|}
_ZN5Exiv29ExifdatumaSERKj:
  233|  3.20k|Exifdatum& Exifdatum::operator=(const uint32_t& value) {
  234|  3.20k|  return Exiv2::setValue(*this, value);
  235|  3.20k|}
_ZN5Exiv29ExifdatumaSERKNS_5ValueE:
  253|  9.36k|Exifdatum& Exifdatum::operator=(const Value& value) {
  254|  9.36k|  setValue(&value);
  255|  9.36k|  return *this;
  256|  9.36k|}
_ZN5Exiv29Exifdatum8setValueEPKNS_5ValueE:
  258|  9.36k|void Exifdatum::setValue(const Value* pValue) {
  259|  9.36k|  value_.reset();
  260|  9.36k|  if (pValue)
  ------------------
  |  Branch (260:7): [True: 9.36k, False: 0]
  ------------------
  261|  9.36k|    value_ = pValue->clone();
  262|  9.36k|}
_ZN5Exiv29Exifdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  264|  3.31k|int Exifdatum::setValue(const std::string& value) {
  265|  3.31k|  if (!value_) {
  ------------------
  |  Branch (265:7): [True: 1.61k, False: 1.70k]
  ------------------
  266|  1.61k|    TypeId type = key_->defaultTypeId();
  267|  1.61k|    value_ = Value::create(type);
  268|  1.61k|  }
  269|  3.31k|  return value_->read(value);
  270|  3.31k|}
_ZNK5Exiv29Exifdatum11setDataAreaEPKhm:
  272|     20|int Exifdatum::setDataArea(const byte* buf, size_t len) const {
  273|     20|  return value_ ? value_->setDataArea(buf, len) : -1;
  ------------------
  |  Branch (273:10): [True: 20, False: 0]
  ------------------
  274|     20|}
_ZNK5Exiv29Exifdatum3keyEv:
  276|  32.5M|std::string Exifdatum::key() const {
  277|  32.5M|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (277:10): [True: 32.5M, False: 0]
  ------------------
  278|  32.5M|}
_ZNK5Exiv29Exifdatum9groupNameEv:
  284|   926k|std::string Exifdatum::groupName() const {
  285|   926k|  return key_ ? key_->groupName() : "";
  ------------------
  |  Branch (285:10): [True: 926k, False: 0]
  ------------------
  286|   926k|}
_ZNK5Exiv29Exifdatum3tagEv:
  300|   682k|uint16_t Exifdatum::tag() const {
  301|   682k|  return key_ ? key_->tag() : 0xffff;
  ------------------
  |  Branch (301:10): [True: 682k, False: 0]
  ------------------
  302|   682k|}
_ZNK5Exiv29Exifdatum5ifdIdEv:
  304|   148k|IfdId Exifdatum::ifdId() const {
  305|   148k|  return key_ ? key_->ifdId() : IfdId::ifdIdNotSet;
  ------------------
  |  Branch (305:10): [True: 148k, False: 0]
  ------------------
  306|   148k|}
_ZNK5Exiv29Exifdatum3idxEv:
  312|   148k|int Exifdatum::idx() const {
  313|   148k|  return key_ ? key_->idx() : 0;
  ------------------
  |  Branch (313:10): [True: 148k, False: 0]
  ------------------
  314|   148k|}
_ZNK5Exiv29Exifdatum4copyEPhNS_9ByteOrderE:
  316|    231|size_t Exifdatum::copy(byte* buf, ByteOrder byteOrder) const {
  317|    231|  return value_ ? value_->copy(buf, byteOrder) : 0;
  ------------------
  |  Branch (317:10): [True: 231, False: 0]
  ------------------
  318|    231|}
_ZNK5Exiv29Exifdatum6typeIdEv:
  320|  1.10k|TypeId Exifdatum::typeId() const {
  321|  1.10k|  return value_ ? value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 1.10k, False: 0]
  ------------------
  322|  1.10k|}
_ZNK5Exiv29Exifdatum8typeSizeEv:
  328|    517|size_t Exifdatum::typeSize() const {
  329|    517|  return TypeInfo::typeSize(typeId());
  330|    517|}
_ZNK5Exiv29Exifdatum5countEv:
  332|  92.3k|size_t Exifdatum::count() const {
  333|  92.3k|  return value_ ? value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 92.3k, False: 0]
  ------------------
  334|  92.3k|}
_ZNK5Exiv29Exifdatum4sizeEv:
  336|   148k|size_t Exifdatum::size() const {
  337|   148k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (337:10): [True: 148k, False: 0]
  ------------------
  338|   148k|}
_ZNK5Exiv29Exifdatum8toStringEv:
  340|  5.22k|std::string Exifdatum::toString() const {
  341|  5.22k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 5.22k, False: 0]
  ------------------
  342|  5.22k|}
_ZNK5Exiv29Exifdatum7toInt64Em:
  348|   109k|int64_t Exifdatum::toInt64(size_t n) const {
  349|   109k|  return value_ ? value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 109k, False: 0]
  ------------------
  350|   109k|}
_ZNK5Exiv29Exifdatum8getValueEv:
  360|   148k|Value::UniquePtr Exifdatum::getValue() const {
  361|   148k|  return value_ ? value_->clone() : nullptr;
  ------------------
  |  Branch (361:10): [True: 148k, False: 0]
  ------------------
  362|   148k|}
_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|    238|DataBuf Exifdatum::dataArea() const {
  369|    238|  return value_ ? value_->dataArea() : DataBuf(nullptr, 0);
  ------------------
  |  Branch (369:10): [True: 238, False: 0]
  ------------------
  370|    238|}
_ZN5Exiv210ExifThumbCC2ERKNS_8ExifDataE:
  372|     20|ExifThumbC::ExifThumbC(const ExifData& exifData) : exifData_(exifData) {
  373|     20|}
_ZN5Exiv29ExifThumbC2ERNS_8ExifDataE:
  411|     20|ExifThumb::ExifThumb(ExifData& exifData) : ExifThumbC(exifData), exifData_(exifData) {
  412|     20|}
_ZN5Exiv29ExifThumb16setJpegThumbnailEPKhm:
  435|     20|void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
  436|     20|  exifData_["Exif.Thumbnail.Compression"] = std::uint16_t{6};
  437|     20|  Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
  438|     20|  format = 0U;
  439|     20|  format.setDataArea(buf, size);
  440|     20|  exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
  441|     20|}
_ZN5Exiv28ExifDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  447|  24.1k|Exifdatum& ExifData::operator[](const std::string& key) {
  448|  24.1k|  ExifKey exifKey(key);
  449|  24.1k|  auto pos = findKey(exifKey);
  450|  24.1k|  if (pos == end()) {
  ------------------
  |  Branch (450:7): [True: 3.72k, False: 20.4k]
  ------------------
  451|  3.72k|    return exifMetadata_.emplace_back(exifKey);
  452|  3.72k|  }
  453|  20.4k|  return *pos;
  454|  24.1k|}
_ZN5Exiv28ExifData3addERKNS_7ExifKeyEPKNS_5ValueE:
  456|  1.01M|void ExifData::add(const ExifKey& key, const Value* pValue) {
  457|  1.01M|  add(Exifdatum(key, pValue));
  458|  1.01M|}
_ZN5Exiv28ExifData3addERKNS_9ExifdatumE:
  460|  1.01M|void ExifData::add(const Exifdatum& exifdatum) {
  461|       |  // allow duplicates
  462|  1.01M|  exifMetadata_.push_back(exifdatum);
  463|  1.01M|}
_ZNK5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  465|   702k|ExifData::const_iterator ExifData::findKey(const ExifKey& key) const {
  466|   702k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  467|   702k|}
_ZN5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  469|  81.9k|ExifData::iterator ExifData::findKey(const ExifKey& key) {
  470|  81.9k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  471|  81.9k|}
_ZN5Exiv28ExifData5clearEv:
  473|  29.9k|void ExifData::clear() {
  474|  29.9k|  exifMetadata_.clear();
  475|  29.9k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEES5_:
  485|  4.38k|ExifData::iterator ExifData::erase(ExifData::iterator beg, ExifData::iterator end) {
  486|  4.38k|  return exifMetadata_.erase(beg, end);
  487|  4.38k|}
_ZN5Exiv210ExifParser6decodeERNS_8ExifDataEPKhm:
  493|    347|ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size) {
  494|    347|  IptcData iptcData;
  495|    347|  XmpData xmpData;
  496|    347|  ByteOrder bo = TiffParser::decode(exifData, iptcData, xmpData, pData, size);
  497|    347|#ifndef SUPPRESS_WARNINGS
  498|    347|  if (!iptcData.empty()) {
  ------------------
  |  Branch (498:7): [True: 17, False: 330]
  ------------------
  499|     17|    EXV_WARNING << "Ignoring IPTC information encoded in the Exif data.\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()
  ------------------
  500|     17|  }
  501|    347|  if (!xmpData.empty()) {
  ------------------
  |  Branch (501:7): [True: 1, False: 346]
  ------------------
  502|      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()
  ------------------
  503|      1|  }
  504|    347|#endif
  505|    347|  return bo;
  506|    347|}
exif.cpp:_ZNK12_GLOBAL__N_118FindExifdatumByKeyclERKN5Exiv29ExifdatumE:
   45|  32.5M|  bool operator()(const Exiv2::Exifdatum& exifdatum) const {
   46|  32.5M|    return key_ == exifdatum.key();
   47|  32.5M|  }
exif.cpp:_ZN12_GLOBAL__N_118FindExifdatumByKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   39|   784k|  explicit FindExifdatumByKey(std::string key) : key_(std::move(key)) {
   40|   784k|  }
_ZN5Exiv28setValueItEERNS_9ExifdatumES2_RKT_:
  150|     22|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|     22|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|     22|  v->value_.push_back(value);
  153|     22|  exifDatum.value_ = std::move(v);
  154|     22|  return exifDatum;
  155|     22|}
_ZN5Exiv28setValueIjEERNS_9ExifdatumES2_RKT_:
  150|  3.20k|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|  3.20k|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|  3.20k|  v->value_.push_back(value);
  153|  3.20k|  exifDatum.value_ = std::move(v);
  154|  3.20k|  return exifDatum;
  155|  3.20k|}

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

_ZN5Exiv28GifImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   20|     43|    Image(ImageType::gif, mdNone, std::move(io), params) {
   21|     43|}
_ZNK5Exiv28GifImage8mimeTypeEv:
   23|      6|std::string GifImage::mimeType() const {
   24|      6|  return "image/gif";
   25|      6|}
_ZN5Exiv28GifImage12readMetadataEv:
   42|     37|void GifImage::readMetadata() {
   43|       |#ifdef EXIV2_DEBUG_MESSAGES
   44|       |  std::cerr << "Exiv2::GifImage::readMetadata: Reading GIF file " << io_->path() << "\n";
   45|       |#endif
   46|     37|  if (io_->open() != 0) {
  ------------------
  |  Branch (46:7): [True: 0, False: 37]
  ------------------
   47|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   48|      0|  }
   49|     37|  IoCloser closer(*io_);
   50|       |  // Ensure that this is the correct image type
   51|     37|  if (!isGifType(*io_, true)) {
  ------------------
  |  Branch (51:7): [True: 0, False: 37]
  ------------------
   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|     37|  clearMetadata();
   57|       |
   58|     37|  byte buf[4];
   59|     37|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (59:7): [True: 37, False: 0]
  ------------------
   60|     37|    pixelWidth_ = getShort(buf, littleEndian);
   61|     37|    pixelHeight_ = getShort(buf + 2, littleEndian);
   62|     37|  }
   63|     37|}  // GifImage::readMetadata
_ZN5Exiv214newGifInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
   72|     43|Image::UniquePtr newGifInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
   73|     43|  auto image = std::make_unique<GifImage>(std::move(io), params);
   74|     43|  if (!image->good()) {
  ------------------
  |  Branch (74:7): [True: 6, False: 37]
  ------------------
   75|      6|    return nullptr;
   76|      6|  }
   77|     37|  return image;
   78|     43|}
_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: 308, False: 15.3k]
  ------------------
   87|    308|    return false;
   88|    308|  }
   89|  15.3k|  bool matched = buf == Gif87aId || buf == Gif89aId;
  ------------------
  |  Branch (89:18): [True: 46, False: 15.2k]
  |  Branch (89:37): [True: 71, False: 15.2k]
  ------------------
   90|  15.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (90:7): [True: 15.3k, False: 37]
  |  Branch (90:19): [True: 0, False: 37]
  ------------------
   91|  15.3k|    iIo.seek(-len, BasicIo::cur);
   92|  15.3k|  }
   93|  15.3k|  return matched;
   94|  15.6k|}

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

_ZN5Exiv215ImageCtorParamsC2Ebm:
  141|  34.3k|    create_(create), max_recursion_depth_(max_recursion_depth) {
  142|  34.3k|}
_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsE:
  145|  34.3k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  146|  34.3k|}
_ZN5Exiv25ImageD2Ev:
  148|  34.3k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  186|    438|bool Image::isBigEndianPlatform() {
  187|    438|  return std::endian::native == std::endian::big;
  188|    438|}
_ZN5Exiv25Image8byteSwapEjb:
  210|  1.29k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  211|       |#ifdef __cpp_lib_byteswap
  212|       |  return bSwap ? std::byteswap(value) : value;
  213|       |#elif defined(_MSC_VER)
  214|       |  return bSwap ? _byteswap_ulong(value) : value;
  215|       |#else
  216|  1.29k|  uint32_t result = 0;
  217|  1.29k|  result |= (value & 0x000000FFU) << 24;
  218|  1.29k|  result |= (value & 0x0000FF00U) << 8;
  219|  1.29k|  result |= (value & 0x00FF0000U) >> 8;
  220|  1.29k|  result |= (value & 0xFF000000U) >> 24;
  221|  1.29k|  return bSwap ? result : value;
  ------------------
  |  Branch (221:10): [True: 0, False: 1.29k]
  ------------------
  222|  1.29k|#endif
  223|  1.29k|}
_ZN5Exiv25Image13clearMetadataEv:
  542|  29.4k|void Image::clearMetadata() {
  543|  29.4k|  clearExifData();
  544|  29.4k|  clearIptcData();
  545|  29.4k|  clearXmpPacket();
  546|  29.4k|  clearXmpData();
  547|  29.4k|  clearComment();
  548|  29.4k|  clearIccProfile();
  549|  29.4k|}
_ZN5Exiv25Image8exifDataEv:
  551|  6.72k|ExifData& Image::exifData() {
  552|  6.72k|  return exifData_;
  553|  6.72k|}
_ZN5Exiv25Image8iptcDataEv:
  555|  3.74k|IptcData& Image::iptcData() {
  556|  3.74k|  return iptcData_;
  557|  3.74k|}
_ZN5Exiv25Image7xmpDataEv:
  559|  12.5k|XmpData& Image::xmpData() {
  560|  12.5k|  return xmpData_;
  561|  12.5k|}
_ZN5Exiv25Image9xmpPacketEv:
  563|  2.70k|std::string& Image::xmpPacket() {
  564|       |  // Serialize the current XMP
  565|  2.70k|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (565:7): [True: 0, False: 2.70k]
  |  Branch (565:28): [True: 0, False: 0]
  ------------------
  566|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  567|      0|  }
  568|  2.70k|  return xmpPacket_;
  569|  2.70k|}
_ZN5Exiv25Image13clearExifDataEv:
  591|  29.4k|void Image::clearExifData() {
  592|  29.4k|  exifData_.clear();
  593|  29.4k|}
_ZN5Exiv25Image13clearIptcDataEv:
  599|  29.5k|void Image::clearIptcData() {
  600|  29.5k|  iptcData_.clear();
  601|  29.5k|}
_ZN5Exiv25Image14clearXmpPacketEv:
  607|  29.4k|void Image::clearXmpPacket() {
  608|  29.4k|  xmpPacket_.clear();
  609|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  610|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  611|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  612|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  613|  29.4k|  xmpData_.setPacket(std::string());
  614|  29.4k|  writeXmpFromPacket(true);
  615|  29.4k|}
_ZN5Exiv25Image12clearXmpDataEv:
  624|  29.4k|void Image::clearXmpData() {
  625|  29.4k|  xmpData_.clear();
  626|  29.4k|  writeXmpFromPacket(false);
  627|  29.4k|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  635|  58.9k|void Image::writeXmpFromPacket(bool flag) {
  636|  58.9k|  writeXmpFromPacket_ = flag;
  637|  58.9k|}
_ZN5Exiv25Image12clearCommentEv:
  643|  29.4k|void Image::clearComment() {
  644|  29.4k|  comment_.erase();
  645|  29.4k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  647|    111|void Image::setComment(const std::string& comment) {
  648|    111|  comment_ = comment;
  649|    111|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  651|    134|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  652|    134|  iccProfile_ = std::move(iccProfile);
  653|    134|  if (bTestValid) {
  ------------------
  |  Branch (653:7): [True: 134, False: 0]
  ------------------
  654|    134|    checkIccProfile();
  655|    134|  }
  656|    134|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  658|  17.6k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  659|  17.6k|  if (size == 0) {
  ------------------
  |  Branch (659:7): [True: 200, False: 17.4k]
  ------------------
  660|    200|    return;
  661|    200|  }
  662|  17.4k|  const size_t start = iccProfile_.size();
  663|  17.4k|  iccProfile_.resize(Safe::add(start, size));
  664|  17.4k|  memcpy(iccProfile_.data(start), bytes, size);
  665|  17.4k|  if (bTestValid) {
  ------------------
  |  Branch (665:7): [True: 24, False: 17.4k]
  ------------------
  666|     24|    checkIccProfile();
  667|     24|  }
  668|  17.4k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  670|    158|void Image::checkIccProfile() const {
  671|    158|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (671:7): [True: 30, False: 128]
  ------------------
  672|     30|    throw Error(ErrorCode::kerInvalidIccProfile);
  673|     30|  }
  674|    128|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  675|    128|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (675:7): [True: 73, False: 55]
  ------------------
  676|     73|    throw Error(ErrorCode::kerInvalidIccProfile);
  677|     73|  }
  678|    128|}
_ZN5Exiv25Image15clearIccProfileEv:
  680|  29.4k|void Image::clearIccProfile() {
  681|  29.4k|  iccProfile_.reset();
  682|  29.4k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  684|  11.0k|void Image::setByteOrder(ByteOrder byteOrder) {
  685|  11.0k|  byteOrder_ = byteOrder;
  686|  11.0k|}
_ZNK5Exiv25Image9byteOrderEv:
  688|     41|ByteOrder Image::byteOrder() const {
  689|     41|  return byteOrder_;
  690|     41|}
_ZNK5Exiv25Image10pixelWidthEv:
  692|  2.25k|uint32_t Image::pixelWidth() const {
  693|  2.25k|  return pixelWidth_;
  694|  2.25k|}
_ZNK5Exiv25Image11pixelHeightEv:
  696|  2.25k|uint32_t Image::pixelHeight() const {
  697|  2.25k|  return pixelHeight_;
  698|  2.25k|}
_ZNK5Exiv25Image8exifDataEv:
  700|   624k|const ExifData& Image::exifData() const {
  701|   624k|  return exifData_;
  702|   624k|}
_ZNK5Exiv25Image7xmpDataEv:
  708|  16.6k|const XmpData& Image::xmpData() const {
  709|  16.6k|  return xmpData_;
  710|  16.6k|}
_ZNK5Exiv25Image7commentEv:
  712|    632|std::string Image::comment() const {
  713|    632|  return comment_;
  714|    632|}
_ZNK5Exiv25Image2ioEv:
  720|  27.6k|BasicIo& Image::io() const {
  721|  27.6k|  return *io_;
  722|  27.6k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  728|  69.7k|const NativePreviewList& Image::nativePreviews() const {
  729|  69.7k|  return nativePreviews_;
  730|  69.7k|}
_ZNK5Exiv25Image4goodEv:
  732|  34.2k|bool Image::good() const {
  733|  34.2k|  if (io_->open() != 0)
  ------------------
  |  Branch (733:7): [True: 0, False: 34.2k]
  ------------------
  734|      0|    return false;
  735|  34.2k|  IoCloser closer(*io_);
  736|  34.2k|  return ImageFactory::checkType(imageType_, *io_, false);
  737|  34.2k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  787|  34.2k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  788|  34.2k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (788:12): [True: 34.2k, False: 0]
  ------------------
  789|  34.2k|    return r->isThisType_(io, advance);
  790|      0|  return false;
  791|  34.2k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  873|  35.1k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  874|  35.1k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  875|  35.1k|  if (!image)
  ------------------
  |  Branch (875:7): [True: 743, False: 34.3k]
  ------------------
  876|    743|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  877|  34.3k|  return image;
  878|  35.1k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  880|  35.1k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  881|  35.1k|  if (io->open() != 0) {
  ------------------
  |  Branch (881:7): [True: 0, False: 35.1k]
  ------------------
  882|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  883|      0|  }
  884|   628k|  for (const auto& r : registry) {
  ------------------
  |  Branch (884:22): [True: 628k, False: 912]
  ------------------
  885|   628k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (885:9): [True: 34.2k, False: 594k]
  ------------------
  886|  34.2k|      return r.newInstance_(std::move(io), ImageCtorParams(false, 1000));
  887|  34.2k|    }
  888|   628k|  }
  889|    912|  return nullptr;
  890|  35.1k|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  928|  13.8k|void append(Blob& blob, const byte* buf, size_t len) {
  929|  13.8k|  if (len != 0) {
  ------------------
  |  Branch (929:7): [True: 13.8k, False: 0]
  ------------------
  930|  13.8k|    Blob::size_type size = blob.size();
  931|  13.8k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (931:9): [True: 586, False: 13.2k]
  ------------------
  932|    586|      blob.reserve(size + 65536);
  933|    586|    }
  934|  13.8k|    blob.resize(size + len);
  935|  13.8k|    std::copy_n(buf, len, blob.begin() + size);
  936|  13.8k|  }
  937|  13.8k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   604k|  bool operator==(const ImageType& imageType) const {
   67|   604k|    return imageType == imageType_;
   68|   604k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  38.9k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  38.9k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 36.1k, False: 2.80k]
  ------------------
   58|  36.1k|    value_ = pValue->clone();
   59|  38.9k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|  29.1k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|  29.1k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 29.1k, False: 0]
  ------------------
   63|  29.1k|    key_ = rhs.key_->clone();  // deep copy
   64|  29.1k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 29.1k, False: 0]
  ------------------
   65|  29.1k|    value_ = rhs.value_->clone();  // deep copy
   66|  29.1k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|  68.0k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum6recordEv:
   86|  97.1k|uint16_t Iptcdatum::record() const {
   87|  97.1k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 97.1k, False: 0]
  ------------------
   88|  97.1k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   283k|uint16_t Iptcdatum::tag() const {
  111|   283k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 283k, False: 0]
  ------------------
  112|   283k|}
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|    737|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|    737|  setValue(value);
  188|    737|  return *this;
  189|    737|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  2.92k|int Iptcdatum::setValue(const std::string& value) {
  203|  2.92k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 2.80k, False: 123]
  ------------------
  204|  2.80k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  2.80k|    value_ = Value::create(type);
  206|  2.80k|  }
  207|  2.92k|  return value_->read(value);
  208|  2.92k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|    737|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|    737|  IptcKey iptcKey(key);
  212|    737|  auto pos = findKey(iptcKey);
  213|    737|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 614, False: 123]
  ------------------
  214|    614|    return iptcMetadata_.emplace_back(iptcKey);
  215|    614|  }
  216|    123|  return *pos;
  217|    737|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  36.1k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  36.1k|  return add(Iptcdatum(key, value));
  236|  36.1k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  38.3k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  38.3k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 26.7k, False: 11.6k]
  |  Branch (239:7): [True: 25.5k, False: 12.8k]
  ------------------
  240|  26.7k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 25.5k, False: 1.21k]
  ------------------
  241|  25.5k|    return 6;
  242|  25.5k|  }
  243|       |  // allow duplicates
  244|  12.8k|  iptcMetadata_.push_back(iptcDatum);
  245|  12.8k|  return 0;
  246|  38.3k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  1.32k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  1.32k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  1.32k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  26.7k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  26.7k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  26.7k|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  1.26k|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.26k|  auto pRead = pData;
  367|  1.26k|  const auto pEnd = pData + size;
  368|  1.26k|  iptcData.clear();
  369|       |
  370|  1.26k|  uint16_t record = 0;
  371|  1.26k|  uint16_t dataSet = 0;
  372|  1.26k|  uint32_t sizeData = 0;
  373|  1.26k|  byte extTest = 0;
  374|       |
  375|  1.76M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.76M, False: 718]
  ------------------
  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.76M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.72M, False: 36.7k]
  ------------------
  380|  1.72M|      continue;
  381|  36.7k|    record = *pRead++;
  382|  36.7k|    dataSet = *pRead++;
  383|       |
  384|  36.7k|    extTest = *pRead;
  385|  36.7k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 2.16k, False: 34.5k]
  ------------------
  386|       |      // extended dataset
  387|  2.16k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  2.16k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 180, False: 1.98k]
  ------------------
  389|    180|        return 5;
  390|  1.98k|      pRead += 2;
  391|  1.98k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 37, False: 1.94k]
  ------------------
  392|     37|        return 6;
  393|  1.94k|      sizeData = 0;
  394|  5.77k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 3.83k, False: 1.94k]
  ------------------
  395|  3.83k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  3.83k|      }
  397|  34.5k|    } else {
  398|       |      // standard dataset
  399|  34.5k|      sizeData = getUShort(pRead, bigEndian);
  400|  34.5k|      pRead += 2;
  401|  34.5k|    }
  402|  36.4k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 36.1k, False: 333]
  ------------------
  403|  36.1k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  36.1k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 36.1k]
  ------------------
  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|  36.1k|    } else {
  410|    333|#ifndef SUPPRESS_WARNINGS
  411|    333|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\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()
  ------------------
  412|    333|#endif
  413|    333|      return 7;
  414|    333|    }
  415|  36.1k|    pRead += sizeData;
  416|  36.1k|  }
  417|       |
  418|    718|  return 0;
  419|  1.26k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  4.38k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  4.38k|  DataBuf buf;
  423|  4.38k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 4.38k, False: 0]
  ------------------
  424|  4.38k|    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.38k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   215k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   215k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 29.2k, False: 186k]
  |  Branch (42:43): [True: 25.6k, False: 3.59k]
  ------------------
   43|   215k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  28.0k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  28.0k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  36.1k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  36.1k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  36.1k|  auto value = Exiv2::Value::create(type);
  466|  36.1k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  36.1k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 16.7k, False: 19.3k]
  ------------------
  468|  16.7k|    Exiv2::IptcKey key(dataSet, record);
  469|  16.7k|    iptcData.add(key, value.get());
  470|  19.3k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 19.3k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  19.3k|    value = Exiv2::Value::create(Exiv2::string);
  473|  19.3k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  19.3k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 19.3k, False: 0]
  ------------------
  475|  19.3k|      Exiv2::IptcKey key(dataSet, record);
  476|  19.3k|      iptcData.add(key, value.get());
  477|  19.3k|    }
  478|  19.3k|  }
  479|  36.1k|  return rc;
  480|  36.1k|}

_ZN5Exiv28Jp2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  101|  1.31k|    Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io), params) {
  102|  1.31k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1.31k]
  |  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.31k|}
_ZNK5Exiv28Jp2Image8mimeTypeEv:
  125|    882|std::string Jp2Image::mimeType() const {
  126|    882|  if (brand_ == Internal::brandJph)
  ------------------
  |  Branch (126:7): [True: 3, False: 879]
  ------------------
  127|      3|    return "image/jph";
  128|    879|  return "image/jp2";
  129|    882|}
_ZN5Exiv28Jp2Image12readMetadataEv:
  135|  1.30k|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.30k|  if (io_->open() != 0) {
  ------------------
  |  Branch (139:7): [True: 0, False: 1.30k]
  ------------------
  140|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  141|      0|  }
  142|  1.30k|  IoCloser closer(*io_);
  143|  1.30k|  if (!isJp2Type(*io_, false)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 1.30k]
  ------------------
  144|      0|    throw Error(ErrorCode::kerNotAnImage, "JPEG-2000");
  145|      0|  }
  146|       |
  147|  1.30k|  Internal::Jp2BoxHeader box = {0, 0};
  148|  1.30k|  Internal::Jp2BoxHeader subBox = {0, 0};
  149|  1.30k|  Internal::Jp2ImageHeaderBox ihdr = {0, 0, 0, 0, 0, 0, 0};
  150|  1.30k|  Internal::Jp2UuidBox uuid = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  151|  1.30k|  size_t boxesCount = 0;
  152|  1.30k|  const size_t boxem = 1000;  // boxes max
  153|  1.30k|  uint32_t lastBoxTypeRead = 0;
  154|  1.30k|  bool boxSignatureFound = false;
  155|  1.30k|  bool boxFileTypeFound = false;
  156|       |
  157|  12.4k|  while (io_->read(reinterpret_cast<byte*>(&box), boxHSize) == boxHSize) {
  ------------------
  |  Branch (157:10): [True: 12.1k, False: 307]
  ------------------
  158|  12.1k|    boxes_check(boxesCount++, boxem);
  159|  12.1k|    const size_t position = io_->tell();
  160|  12.1k|    box.length = getULong(reinterpret_cast<byte*>(&box.length), bigEndian);
  161|  12.1k|    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|  12.1k|    Internal::enforce(box.length <= boxHSize + io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  12.1k|    if (box.length == 0)
  ------------------
  |  Branch (168:9): [True: 45, False: 12.1k]
  ------------------
  169|     45|      return;
  170|       |
  171|  12.1k|    if (box.length == 1) {
  ------------------
  |  Branch (171:9): [True: 13, False: 12.1k]
  ------------------
  172|       |      /// \todo In this case, the real box size is given in XLBox (bytes 8-15)
  173|     13|    }
  174|       |
  175|  12.1k|    switch (box.type) {
  176|  1.31k|      case kJp2BoxType::Signature: {
  ------------------
  |  Branch (176:7): [True: 1.31k, False: 10.7k]
  ------------------
  177|  1.31k|        if (boxSignatureFound)  // Only one is allowed
  ------------------
  |  Branch (177:13): [True: 12, False: 1.30k]
  ------------------
  178|     12|          throw Error(ErrorCode::kerCorruptedMetadata);
  179|  1.30k|        boxSignatureFound = true;
  180|  1.30k|        break;
  181|  1.31k|      }
  182|    236|      case kJp2BoxType::FileTypeBox: {
  ------------------
  |  Branch (182:7): [True: 236, False: 11.8k]
  ------------------
  183|       |        // This box shall immediately follow the JPEG 2000 Signature box
  184|    236|        if (boxFileTypeFound || lastBoxTypeRead != kJp2BoxType::Signature) {  // Only one is allowed
  ------------------
  |  Branch (184:13): [True: 10, False: 226]
  |  Branch (184:33): [True: 19, False: 207]
  ------------------
  185|     29|          throw Error(ErrorCode::kerCorruptedMetadata);
  186|     29|        }
  187|    207|        boxFileTypeFound = true;
  188|    207|        Internal::enforce(box.length >= boxHSize, ErrorCode::kerCorruptedMetadata);
  189|    207|        Blob boxData(box.length - boxHSize);
  190|    207|        io_->readOrThrow(boxData.data(), boxData.size(), ErrorCode::kerCorruptedMetadata);
  191|    207|        if (!Internal::isValidBoxFileType(boxData))
  ------------------
  |  Branch (191:13): [True: 169, False: 38]
  ------------------
  192|    169|          throw Error(ErrorCode::kerCorruptedMetadata);
  193|     38|        brand_ = getULong(boxData.data(), bigEndian);
  194|     38|        break;
  195|    207|      }
  196|    537|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (196:7): [True: 537, False: 11.5k]
  ------------------
  197|       |#ifdef EXIV2_DEBUG_MESSAGES
  198|       |        std::cout << "Exiv2::Jp2Image::readMetadata: JP2Header box found\n";
  199|       |#endif
  200|    537|        size_t restore = io_->tell();
  201|       |
  202|  2.76k|        while (io_->read(reinterpret_cast<byte*>(&subBox), boxHSize) == boxHSize && subBox.length) {
  ------------------
  |  Branch (202:16): [True: 2.69k, False: 75]
  |  Branch (202:85): [True: 2.37k, False: 312]
  ------------------
  203|  2.37k|          boxes_check(boxesCount++, boxem);
  204|  2.37k|          subBox.length = getULong(reinterpret_cast<byte*>(&subBox.length), bigEndian);
  205|  2.37k|          subBox.type = getULong(reinterpret_cast<byte*>(&subBox.type), bigEndian);
  206|  2.37k|          if (subBox.length > io_->size()) {
  ------------------
  |  Branch (206:15): [True: 98, False: 2.28k]
  ------------------
  207|     98|            throw Error(ErrorCode::kerCorruptedMetadata);
  208|     98|          }
  209|       |#ifdef EXIV2_DEBUG_MESSAGES
  210|       |          std::cout << "Exiv2::Jp2Image::readMetadata: "
  211|       |                    << "subBox = " << toAscii(subBox.type) << " length = " << subBox.length << '\n';
  212|       |#endif
  213|  2.28k|          if (subBox.type == kJp2BoxType::ColorSpec && subBox.length != 15) {
  ------------------
  |  Branch (213:15): [True: 181, False: 2.09k]
  |  Branch (213:56): [True: 86, False: 95]
  ------------------
  214|       |#ifdef EXIV2_DEBUG_MESSAGES
  215|       |            std::cout << "Exiv2::Jp2Image::readMetadata: "
  216|       |                      << "Color data found" << '\n';
  217|       |#endif
  218|       |
  219|     86|            const size_t pad = 3;  // 3 padding bytes 2 0 0
  220|     86|            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|     86|            if (data_length > io_->size() - io_->tell()) {
  ------------------
  |  Branch (222:17): [True: 10, False: 76]
  ------------------
  223|     10|              throw Error(ErrorCode::kerCorruptedMetadata);
  224|     10|            }
  225|     76|            DataBuf data(data_length);
  226|     76|            io_->read(data.data(), data.size());
  227|     76|            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|     76|            if (iccLength > data.size() - pad) {
  ------------------
  |  Branch (230:17): [True: 21, False: 55]
  ------------------
  231|     21|              throw Error(ErrorCode::kerCorruptedMetadata);
  232|     21|            }
  233|     55|            DataBuf icc(iccLength);
  234|     55|            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|     55|            setIccProfile(std::move(icc));
  245|     55|          }
  246|       |
  247|  2.24k|          if (subBox.type == kJp2BoxType::ImageHeader) {
  ------------------
  |  Branch (247:15): [True: 27, False: 2.22k]
  ------------------
  248|     27|            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|     27|            ihdr.imageHeight = getULong(reinterpret_cast<byte*>(&ihdr.imageHeight), bigEndian);
  253|     27|            ihdr.imageWidth = getULong(reinterpret_cast<byte*>(&ihdr.imageWidth), bigEndian);
  254|     27|            ihdr.componentCount = getShort(reinterpret_cast<byte*>(&ihdr.componentCount), bigEndian);
  255|     27|            Internal::enforce(ihdr.c == 7, ErrorCode::kerCorruptedMetadata);
  256|       |
  257|     27|            pixelWidth_ = ihdr.imageWidth;
  258|     27|            pixelHeight_ = ihdr.imageHeight;
  259|     27|          }
  260|       |
  261|  2.24k|          io_->seek(restore, BasicIo::beg);
  262|  2.24k|          if (io_->seek(subBox.length, BasicIo::cur) != 0) {
  ------------------
  |  Branch (262:15): [True: 21, False: 2.22k]
  ------------------
  263|     21|            throw Error(ErrorCode::kerCorruptedMetadata);
  264|     21|          }
  265|  2.22k|          restore = io_->tell();
  266|  2.22k|        }
  267|    387|        break;
  268|    537|      }
  269|       |
  270|  4.77k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (270:7): [True: 4.77k, False: 7.34k]
  ------------------
  271|       |#ifdef EXIV2_DEBUG_MESSAGES
  272|       |        std::cout << "Exiv2::Jp2Image::readMetadata: UUID box found" << '\n';
  273|       |#endif
  274|       |
  275|  4.77k|        if (io_->read(reinterpret_cast<byte*>(&uuid), sizeof(uuid)) == sizeof(uuid)) {
  ------------------
  |  Branch (275:13): [True: 4.75k, False: 19]
  ------------------
  276|  4.75k|          DataBuf rawData;
  277|  4.75k|          size_t bufRead;
  278|  4.75k|          bool bIsExif = uuid.uuid == kJp2UuidExif;
  279|  4.75k|          bool bIsIPTC = uuid.uuid == kJp2UuidIptc;
  280|  4.75k|          bool bIsXMP = uuid.uuid == kJp2UuidXmp;
  281|       |
  282|  4.75k|          if (bIsExif) {
  ------------------
  |  Branch (282:15): [True: 1.92k, False: 2.83k]
  ------------------
  283|       |#ifdef EXIV2_DEBUG_MESSAGES
  284|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Exif data found" << '\n';
  285|       |#endif
  286|  1.92k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  287|  1.92k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  288|  1.92k|            bufRead = io_->read(rawData.data(), rawData.size());
  289|  1.92k|            if (io_->error())
  ------------------
  |  Branch (289:17): [True: 0, False: 1.92k]
  ------------------
  290|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  291|  1.92k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (291:17): [True: 0, False: 1.92k]
  ------------------
  292|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  293|       |
  294|  1.92k|            if (rawData.size() > 8)  // "II*\0long"
  ------------------
  |  Branch (294:17): [True: 1.72k, False: 204]
  ------------------
  295|  1.72k|            {
  296|       |              // Find the position of Exif header in bytes array.
  297|  1.72k|              const char a = rawData.read_uint8(0);
  298|  1.72k|              const char b = rawData.read_uint8(1);
  299|  1.72k|              const size_t notfound = std::numeric_limits<size_t>::max();
  300|  1.72k|              size_t pos = (a == b && (a == 'I' || a == 'M')) ? 0 : notfound;
  ------------------
  |  Branch (300:29): [True: 1.32k, False: 394]
  |  Branch (300:40): [True: 34, False: 1.29k]
  |  Branch (300:52): [True: 988, False: 305]
  ------------------
  301|       |
  302|       |              // #1242  Forgive having Exif\0\0 in rawData.pData_
  303|  1.72k|              std::array<byte, 6> exifHeader{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  304|  87.4k|              for (size_t i = 0; pos == notfound && i < (rawData.size() - exifHeader.size()); i++) {
  ------------------
  |  Branch (304:34): [True: 86.4k, False: 1.03k]
  |  Branch (304:53): [True: 85.7k, False: 687]
  ------------------
  305|  85.7k|                if (rawData.cmpBytes(i, exifHeader.data(), exifHeader.size()) == 0) {
  ------------------
  |  Branch (305:21): [True: 12, False: 85.7k]
  ------------------
  306|     12|                  pos = i + sizeof(exifHeader);
  307|     12|#ifndef SUPPRESS_WARNINGS
  308|     12|                  EXV_WARNING << "Reading non-standard UUID-EXIF_bad box in " << io_->path() << '\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|                }
  311|  85.7k|              }
  312|       |
  313|       |              // If found it, store only these data at from this place.
  314|  1.72k|              if (pos != notfound) {
  ------------------
  |  Branch (314:19): [True: 1.03k, False: 687]
  ------------------
  315|       |#ifdef EXIV2_DEBUG_MESSAGES
  316|       |                std::cout << "Exiv2::Jp2Image::readMetadata: Exif header found at position " << pos << '\n';
  317|       |#endif
  318|  1.03k|                ByteOrder bo =
  319|  1.03k|                    TiffParser::decode(exifData(), iptcData(), xmpData(), rawData.c_data(pos), rawData.size() - pos);
  320|  1.03k|                setByteOrder(bo);
  321|  1.03k|              }
  322|  1.72k|            } else {
  323|    204|#ifndef SUPPRESS_WARNINGS
  324|    204|              EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    204|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 204]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    204|  LogMsg(LogMsg::warn).os()
  ------------------
  325|    204|#endif
  326|    204|              exifData_.clear();
  327|    204|            }
  328|  1.92k|          }
  329|       |
  330|  4.75k|          if (bIsIPTC) {
  ------------------
  |  Branch (330:15): [True: 862, False: 3.89k]
  ------------------
  331|       |#ifdef EXIV2_DEBUG_MESSAGES
  332|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Iptc data found" << '\n';
  333|       |#endif
  334|    862|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  335|    862|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  336|    862|            bufRead = io_->read(rawData.data(), rawData.size());
  337|    862|            if (io_->error())
  ------------------
  |  Branch (337:17): [True: 0, False: 862]
  ------------------
  338|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  339|    862|            if (bufRead != rawData.size())
  ------------------
  |  Branch (339:17): [True: 0, False: 862]
  ------------------
  340|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  341|       |
  342|    862|            if (IptcParser::decode(iptcData_, rawData.c_data(), rawData.size())) {
  ------------------
  |  Branch (342:17): [True: 391, False: 471]
  ------------------
  343|    391|#ifndef SUPPRESS_WARNINGS
  344|    391|              EXV_WARNING << "Failed to decode IPTC metadata." << '\n';
  ------------------
  |  |  138|    391|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 391]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    391|  LogMsg(LogMsg::warn).os()
  ------------------
  345|    391|#endif
  346|    391|              iptcData_.clear();
  347|    391|            }
  348|    862|          }
  349|       |
  350|  4.75k|          if (bIsXMP) {
  ------------------
  |  Branch (350:15): [True: 1.13k, False: 3.62k]
  ------------------
  351|       |#ifdef EXIV2_DEBUG_MESSAGES
  352|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Xmp data found" << '\n';
  353|       |#endif
  354|  1.13k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  355|  1.13k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  356|  1.13k|            bufRead = io_->read(rawData.data(), rawData.size());
  357|  1.13k|            if (io_->error())
  ------------------
  |  Branch (357:17): [True: 0, False: 1.13k]
  ------------------
  358|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  359|  1.13k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (359:17): [True: 0, False: 1.13k]
  ------------------
  360|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  361|  1.13k|            xmpPacket_.assign(rawData.c_str(), rawData.size());
  362|       |
  363|  1.13k|            if (auto idx = xmpPacket_.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (363:59): [True: 167, False: 966]
  |  Branch (363:87): [True: 123, False: 44]
  ------------------
  364|    123|#ifndef SUPPRESS_WARNINGS
  365|    123|              EXV_WARNING << "Removing " << static_cast<uint32_t>(idx)
  ------------------
  |  |  138|    123|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 123]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    123|  LogMsg(LogMsg::warn).os()
  ------------------
  366|      0|                          << " characters from the beginning of the XMP packet" << '\n';
  367|    123|#endif
  368|    123|              xmpPacket_ = xmpPacket_.substr(idx);
  369|    123|            }
  370|       |
  371|  1.13k|            if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (371:17): [True: 749, False: 384]
  |  Branch (371:40): [True: 730, False: 19]
  ------------------
  372|    730|#ifndef SUPPRESS_WARNINGS
  373|    730|              EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|    730|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 730]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    730|  LogMsg(LogMsg::warn).os()
  ------------------
  374|    730|#endif
  375|    730|            }
  376|  1.13k|          }
  377|  4.75k|        }
  378|  4.77k|        break;
  379|  4.77k|      }
  380|       |
  381|  4.77k|      default:
  ------------------
  |  Branch (381:7): [True: 4.74k, False: 7.36k]
  ------------------
  382|  4.74k|        break;
  383|  12.1k|    }
  384|  11.1k|    lastBoxTypeRead = box.type;
  385|       |
  386|       |    // Move to the next box.
  387|  11.1k|    io_->seek(static_cast<int64_t>(position - boxHSize + box.length), BasicIo::beg);
  388|  11.1k|    if (io_->error())
  ------------------
  |  Branch (388:9): [True: 0, False: 11.1k]
  ------------------
  389|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  390|  11.1k|  }
  391|       |
  392|  1.30k|}  // Jp2Image::readMetadata
_ZN5Exiv214newJp2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  870|  1.31k|Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  871|  1.31k|  auto image = std::make_unique<Jp2Image>(std::move(io), params);
  872|  1.31k|  if (!image->good()) {
  ------------------
  |  Branch (872:7): [True: 10, False: 1.30k]
  ------------------
  873|     10|    return nullptr;
  874|     10|  }
  875|  1.30k|  return image;
  876|  1.31k|}
_ZN5Exiv29isJp2TypeERNS_7BasicIoEb:
  878|  16.7k|bool isJp2Type(BasicIo& iIo, bool advance) {
  879|  16.7k|  std::array<byte, Jp2Signature.size()> buf;
  880|  16.7k|  const size_t bytesRead = iIo.read(buf.data(), Jp2Signature.size());
  881|  16.7k|  if (iIo.error() || iIo.eof() || bytesRead != Jp2Signature.size()) {
  ------------------
  |  Branch (881:7): [True: 0, False: 16.7k]
  |  Branch (881:22): [True: 297, False: 16.4k]
  |  Branch (881:35): [True: 0, False: 16.4k]
  ------------------
  882|    297|    return false;
  883|    297|  }
  884|  16.4k|  bool matched = buf == Jp2Signature;
  885|  16.4k|  if (!advance || !matched) {
  ------------------
  |  Branch (885:7): [True: 16.4k, False: 0]
  |  Branch (885:19): [True: 0, False: 0]
  ------------------
  886|  16.4k|    iIo.seek(-static_cast<int64_t>(Jp2Signature.size()), BasicIo::cur);  // Return to original position
  887|  16.4k|  }
  888|  16.4k|  return matched;
  889|  16.7k|}
jp2image.cpp:_ZN5Exiv212_GLOBAL__N_111boxes_checkEmm:
   89|  14.5k|void boxes_check(size_t b, size_t m) {
   90|  14.5k|  if (b > m) {
  ------------------
  |  Branch (90:7): [True: 3, False: 14.5k]
  ------------------
   91|       |#ifdef EXIV2_DEBUG_MESSAGES
   92|       |    std::cout << "Exiv2::Jp2Image::readMetadata box maximum exceeded" << '\n';
   93|       |#endif
   94|      3|    throw Error(ErrorCode::kerCorruptedMetadata);
   95|      3|  }
   96|  14.5k|}

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    197|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|    197|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 10, False: 187]
  |  Branch (15:29): [True: 10, False: 177]
  ------------------
   16|     20|    return false;
   17|     20|  }
   18|       |
   19|    177|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    177|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    177|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    177|  bool clWithRightBrand = false;
   24|  2.02k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.89k, False: 129]
  ------------------
   25|  1.89k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.89k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 746, False: 1.14k]
  |  Branch (26:31): [True: 34, False: 712]
  |  Branch (26:66): [True: 258, False: 1.60k]
  |  Branch (26:87): [True: 14, False: 244]
  ------------------
   27|     48|      clWithRightBrand = true;
   28|     48|      break;
   29|     48|    }
   30|  1.89k|  }
   31|    177|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 50, False: 127]
  |  Branch (31:32): [True: 28, False: 22]
  ------------------
   32|    197|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  1.40k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  1.40k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 1.40k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  1.40k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  58.3k|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  58.3k|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|   783k|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 725k, False: 57.6k]
  ------------------
  138|   725k|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 689, False: 724k]
  ------------------
  139|    689|      throw Error(err);
  140|   725k|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  60.4k|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 2.78k, False: 57.6k]
  ------------------
  144|  2.78k|  }
  145|  57.6k|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 65, False: 57.6k]
  ------------------
  146|     65|    throw Error(err);
  147|       |
  148|  57.6k|  return static_cast<byte>(c);
  149|  57.6k|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  1.40k|void JpegBase::readMetadata() {
  152|  1.40k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  1.40k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 1.40k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  1.40k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  1.40k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 93, False: 1.31k]
  ------------------
  159|     93|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 93]
  |  Branch (159:25): [True: 0, False: 93]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|     93|    throw Error(ErrorCode::kerNotAJpeg);
  162|     93|  }
  163|  1.31k|  clearMetadata();
  164|  1.31k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  1.31k|  Blob psBlob;
  166|  1.31k|  bool foundCompletePsData = false;
  167|  1.31k|  bool foundExifData = false;
  168|  1.31k|  bool foundXmpData = false;
  169|  1.31k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  1.31k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|  57.6k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 57.5k, False: 99]
  |  Branch (174:28): [True: 57.5k, False: 35]
  |  Branch (174:46): [True: 57.5k, False: 9]
  ------------------
  175|  57.5k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|  57.5k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|  57.5k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 51.8k, False: 5.70k]
  ------------------
  181|  51.8k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  51.8k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  51.8k|    }
  184|       |
  185|  57.5k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 4.18k, False: 53.3k]
  ------------------
  186|  4.18k|      sof_encoding_process_ = itSofMarker->label_;
  187|  4.18k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 1.91k, False: 2.27k]
  |  Branch (187:24): [True: 1.57k, False: 339]
  ------------------
  188|  1.57k|        num_color_components_ = *buf.c_data(7);
  189|  1.57k|      }
  190|  4.18k|    }
  191|       |
  192|  57.5k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 55.9k, False: 1.56k]
  |  Branch (192:27): [True: 808, False: 55.1k]
  |  Branch (192:46): [True: 552, False: 256]
  ------------------
  193|    552|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 54, False: 498]
  ------------------
  194|     54|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8);
  195|     54|      setByteOrder(bo);
  196|     54|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (196:11): [True: 29, False: 25]
  |  Branch (196:23): [True: 0, False: 29]
  ------------------
  197|      0|#ifndef SUPPRESS_WARNINGS
  198|      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()
  ------------------
  199|      0|#endif
  200|      0|        exifData_.clear();
  201|      0|      }
  202|     54|      --search;
  203|     54|      foundExifData = true;
  204|  57.4k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (204:16): [True: 56.0k, False: 1.39k]
  |  Branch (204:33): [True: 703, False: 55.3k]
  |  Branch (204:52): [True: 275, False: 428]
  ------------------
  205|    275|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (205:19): [True: 40, False: 235]
  ------------------
  206|     40|      xmpPacket_.assign(buf.c_str(31), size - 31);
  207|     40|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (207:11): [True: 30, False: 10]
  |  Branch (207:34): [True: 28, False: 2]
  ------------------
  208|     28|#ifndef SUPPRESS_WARNINGS
  209|     28|        EXV_WARNING << "Failed to decode XMP 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()
  ------------------
  210|     28|#endif
  211|     28|      }
  212|     40|      --search;
  213|     40|      foundXmpData = true;
  214|  57.4k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (214:16): [True: 56.6k, False: 831]
  |  Branch (214:40): [True: 25.7k, False: 30.8k]
  ------------------
  215|  25.7k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (215:16): [True: 25.2k, False: 484]
  ------------------
  216|  25.2k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (216:19): [True: 21.4k, False: 3.74k]
  ------------------
  217|       |#ifdef EXIV2_DEBUG_MESSAGES
  218|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  219|       |#endif
  220|  21.4k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (220:11): [True: 13.7k, False: 7.71k]
  ------------------
  221|  13.7k|        append(psBlob, buf.c_data(16), size - 16);
  222|  13.7k|      }
  223|       |      // Check whether psBlob is complete
  224|  21.4k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (224:11): [True: 21.2k, False: 275]
  |  Branch (224:30): [True: 107, False: 21.1k]
  ------------------
  225|    107|        --search;
  226|    107|        foundCompletePsData = true;
  227|    107|      }
  228|  35.9k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (228:16): [True: 823, False: 35.1k]
  |  Branch (228:34): [True: 196, False: 627]
  ------------------
  229|       |      // JPEGs can have multiple comments, but for now only read
  230|       |      // the first one (most jpegs only have one anyway). Comments
  231|       |      // are simple single byte ISO-8859-1 strings.
  232|    196|      comment_.assign(buf.c_str(2), size - 2);
  233|  1.19k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (233:14): [True: 1.08k, False: 109]
  |  Branch (233:35): [True: 998, False: 87]
  ------------------
  234|    998|        comment_.pop_back();
  235|    998|      }
  236|    196|      --search;
  237|  35.7k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (237:16): [True: 21.1k, False: 14.6k]
  |  Branch (237:35): [True: 20.9k, False: 205]
  ------------------
  238|  20.9k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (238:19): [True: 17.6k, False: 3.22k]
  ------------------
  239|  17.6k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (239:11): [True: 12, False: 17.6k]
  ------------------
  240|     12|        rc = 8;
  241|     12|        break;
  242|     12|      }
  243|       |      // ICC profile
  244|  17.6k|      if (!foundIccData) {
  ------------------
  |  Branch (244:11): [True: 137, False: 17.5k]
  ------------------
  245|    137|        foundIccData = true;
  246|    137|        --search;
  247|    137|      }
  248|  17.6k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  249|  17.6k|      auto chunks = static_cast<int>(buf.read_uint8(2 + 13));
  250|       |      // ICC1v43_2010-12.pdf header is 14 bytes
  251|       |      // header = "ICC_PROFILE\0" (12 bytes)
  252|       |      // chunk/chunks are a single byte
  253|       |      // Spec 7.2 Profile bytes 0-3 size
  254|  17.6k|      uint32_t s = buf.read_uint32(2 + 14, bigEndian);
  255|       |#ifdef EXIV2_DEBUG_MESSAGES
  256|       |      std::cerr << "Found ICC Profile chunk " << chunk << " of " << chunks << (chunk == 1 ? " size: " : "")
  257|       |                << (chunk == 1 ? s : 0) << '\n';
  258|       |#endif
  259|       |      // #1286 profile can be padded
  260|  17.6k|      size_t icc_size = size - 2 - 14;
  261|  17.6k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (261:11): [True: 461, False: 17.2k]
  |  Branch (261:25): [True: 248, False: 213]
  ------------------
  262|    248|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  263|    248|        icc_size = s;
  264|    248|      }
  265|       |
  266|  17.6k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  267|  18.0k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (267:16): [True: 10.2k, False: 7.82k]
  |  Branch (267:37): [True: 551, False: 9.68k]
  ------------------
  268|       |      // We hit a SOFn (start-of-frame) marker
  269|    551|      if (size < 8) {
  ------------------
  |  Branch (269:11): [True: 52, False: 499]
  ------------------
  270|     52|        rc = 7;
  271|     52|        break;
  272|     52|      }
  273|    499|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  274|    499|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  275|    499|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (275:11): [True: 162, False: 337]
  ------------------
  276|    162|        --search;
  277|    499|    }
  278|       |
  279|       |    // Read the beginning of the next segment
  280|  57.4k|    try {
  281|  57.4k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  282|  57.4k|    } catch (const Error&) {
  283|    708|      rc = 5;
  284|    708|      break;
  285|    708|    }
  286|  57.4k|  }  // while there are segments to process
  287|       |
  288|    915|  if (!psBlob.empty()) {
  ------------------
  |  Branch (288:7): [True: 331, False: 584]
  ------------------
  289|       |    // Find actual IPTC data within the psBlob
  290|    331|    Blob iptcBlob;
  291|    331|    const byte* record = nullptr;
  292|    331|    uint32_t sizeIptc = 0;
  293|    331|    uint32_t sizeHdr = 0;
  294|    331|    const byte* pCur = psBlob.data();
  295|    331|    const byte* pEnd = pCur + psBlob.size();
  296|    443|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (296:12): [True: 432, False: 11]
  |  Branch (296:27): [True: 112, False: 320]
  ------------------
  297|       |#ifdef EXIV2_DEBUG_MESSAGES
  298|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  299|       |#endif
  300|    112|      if (sizeIptc) {
  ------------------
  |  Branch (300:11): [True: 96, False: 16]
  ------------------
  301|     96|        append(iptcBlob, record + sizeHdr, sizeIptc);
  302|     96|      }
  303|    112|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  304|    112|    }
  305|    331|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (305:9): [True: 95, False: 236]
  |  Branch (305:30): [True: 39, False: 56]
  ------------------
  306|     39|#ifndef SUPPRESS_WARNINGS
  307|     39|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     39|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 39]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     39|  LogMsg(LogMsg::warn).os()
  ------------------
  308|     39|#endif
  309|     39|      iptcData_.clear();
  310|     39|    }
  311|    331|  }
  312|       |
  313|    915|  if (rc != 0) {
  ------------------
  |  Branch (313:7): [True: 772, False: 143]
  ------------------
  314|    772|#ifndef SUPPRESS_WARNINGS
  315|    772|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    772|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 772]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    772|  LogMsg(LogMsg::warn).os()
  ------------------
  316|    772|#endif
  317|    772|  }
  318|    915|}  // JpegBase::readMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  969|  1.36k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  970|  1.36k|}
_ZNK5Exiv29JpegImage8mimeTypeEv:
  972|  1.64k|std::string JpegImage::mimeType() const {
  973|  1.64k|  return "image/jpeg";
  974|  1.64k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  988|  1.36k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  989|  1.36k|  return isJpegType(iIo, advance);
  990|  1.36k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  992|  1.26k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  993|  1.26k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  994|  1.26k|  if (!image->good()) {
  ------------------
  |  Branch (994:7): [True: 0, False: 1.26k]
  ------------------
  995|      0|    return nullptr;
  996|      0|  }
  997|  1.26k|  return image;
  998|  1.26k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1000|  37.7k|bool isJpegType(BasicIo& iIo, bool advance) {
 1001|  37.7k|  bool result = true;
 1002|  37.7k|  byte tmpBuf[2];
 1003|  37.7k|  iIo.read(tmpBuf, 2);
 1004|  37.7k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1004:7): [True: 0, False: 37.7k]
  |  Branch (1004:22): [True: 17, False: 37.7k]
  ------------------
 1005|     17|    return false;
 1006|       |
 1007|  37.7k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1007:7): [True: 33.7k, False: 4.00k]
  |  Branch (1007:28): [True: 204, False: 3.80k]
  ------------------
 1008|  33.9k|    result = false;
 1009|  33.9k|  }
 1010|  37.7k|  if (!advance || !result)
  ------------------
  |  Branch (1010:7): [True: 36.3k, False: 1.36k]
  |  Branch (1010:19): [True: 93, False: 1.27k]
  ------------------
 1011|  36.4k|    iIo.seek(-2, BasicIo::cur);
 1012|  37.7k|  return result;
 1013|  37.7k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1016|     42|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1017|     42|}
_ZNK5Exiv28ExvImage8mimeTypeEv:
 1019|      3|std::string ExvImage::mimeType() const {
 1020|      3|  return "image/x-exv";
 1021|      3|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1034|     42|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1035|     42|  return isExvType(iIo, advance);
 1036|     42|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1038|     42|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1039|     42|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1040|     42|  if (!image->good())
  ------------------
  |  Branch (1040:7): [True: 0, False: 42]
  ------------------
 1041|      0|    return nullptr;
 1042|     42|  return image;
 1043|     42|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1045|  33.9k|bool isExvType(BasicIo& iIo, bool advance) {
 1046|  33.9k|  bool result = true;
 1047|  33.9k|  byte tmpBuf[7];
 1048|  33.9k|  iIo.read(tmpBuf, 7);
 1049|  33.9k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1049:7): [True: 0, False: 33.9k]
  |  Branch (1049:22): [True: 62, False: 33.8k]
  ------------------
 1050|     62|    return false;
 1051|       |
 1052|  33.8k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1052:7): [True: 33.6k, False: 249]
  |  Branch (1052:28): [True: 101, False: 148]
  |  Branch (1052:49): [True: 22, False: 126]
  ------------------
 1053|  33.7k|    result = false;
 1054|  33.7k|  }
 1055|  33.8k|  if (!advance || !result)
  ------------------
  |  Branch (1055:7): [True: 33.8k, False: 42]
  |  Branch (1055:19): [True: 0, False: 42]
  ------------------
 1056|  33.8k|    iIo.seek(-7, BasicIo::cur);
 1057|  33.8k|  return result;
 1058|  33.9k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  57.5k|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  57.5k|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  57.5k|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  57.5k|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 54.1k, False: 3.39k]
  ------------------
  107|  54.1k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|  54.1k|    size = getUShort(buf.data(), bigEndian);
  109|  54.1k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|  54.1k|  }
  111|  57.5k|  return {buf, size};
  112|  57.5k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  10.2k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  10.2k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 181, False: 10.0k]
  |  Branch (92:38): [True: 370, False: 9.68k]
  ------------------
   93|  10.2k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  20.2k|constexpr bool inRange(int lo, int value, int hi) {
   88|  20.2k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 18.7k, False: 1.50k]
  |  Branch (88:25): [True: 551, False: 18.2k]
  ------------------
   89|  20.2k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  57.5k|bool markerHasLength(byte m) {
   99|  57.5k|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 52.1k, False: 5.37k]
  |  Branch (99:44): [True: 3.39k, False: 48.7k]
  ------------------
  100|  57.5k|  return !markerWithoutLength;
  101|  57.5k|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.33k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.33k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  9.08k|std::string MatroskaVideo::mimeType() const {
  604|  9.08k|  return "video/matroska";
  605|  9.08k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.33k|void MatroskaVideo::readMetadata() {
  611|  3.33k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.33k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.33k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.33k]
  ------------------
  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.33k|  IoCloser closer(*io_);
  622|  3.33k|  clearMetadata();
  623|  3.33k|  continueTraversing_ = true;
  624|  3.33k|  height_ = width_ = 1;
  625|       |
  626|  3.33k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.33k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|  74.1k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 70.8k, False: 3.33k]
  ------------------
  630|  70.8k|    decodeBlock();
  631|       |
  632|  3.33k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.33k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|  70.8k|void MatroskaVideo::decodeBlock() {
  636|  70.8k|  byte buf[8];
  637|  70.8k|  io_->read(buf, 1);
  638|       |
  639|  70.8k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 358, False: 70.4k]
  ------------------
  640|    358|    continueTraversing_ = false;
  641|    358|    return;
  642|    358|  }
  643|       |
  644|  70.4k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|  70.4k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 69.9k, False: 544]
  ------------------
  646|  69.9k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|  70.4k|  auto tag_id = returnTagValue(buf, block_size);
  649|  70.4k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|  70.4k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.69k, False: 68.7k]
  ------------------
  652|  1.69k|    continueTraversing_ = false;
  653|  1.69k|    return;
  654|  1.69k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|  68.7k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 598, False: 68.1k]
  |  Branch (658:27): [True: 10, False: 68.1k]
  ------------------
  659|     20|    continueTraversing_ = false;
  660|     20|    return;
  661|     20|  }
  662|       |
  663|  68.7k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|  68.7k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|  68.7k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 68.0k, False: 688]
  ------------------
  667|  68.0k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|  68.7k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|  68.7k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 33.1k, False: 35.6k]
  |  Branch (670:29): [True: 33.1k, False: 0]
  ------------------
  671|  33.1k|    return;
  672|       |
  673|  35.6k|  const size_t bufMaxSize = 200;
  674|       |
  675|  35.6k|#ifndef SUPPRESS_WARNINGS
  676|  35.6k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 32.7k, False: 2.90k]
  |  Branch (676:28): [True: 207, False: 32.5k]
  ------------------
  677|    207|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  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()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    207|  }
  680|  35.6k|#endif
  681|  35.6k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.90k, False: 32.7k]
  |  Branch (681:27): [True: 207, False: 32.5k]
  ------------------
  682|  2.40k|    io_->seek(size, BasicIo::cur);
  683|  2.40k|    return;
  684|  2.40k|  }
  685|       |
  686|  33.2k|  DataBuf buf2(bufMaxSize + 1);
  687|  33.2k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  33.2k|  switch (tag->_type) {
  689|  8.38k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 8.38k, False: 24.8k]
  ------------------
  690|  8.38k|      decodeInternalTags(tag, buf2.data());
  691|  8.38k|      break;
  692|  2.15k|    case String:
  ------------------
  |  Branch (692:5): [True: 2.15k, False: 31.0k]
  ------------------
  693|  2.15k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 33.2k]
  ------------------
  694|  2.15k|      decodeStringTags(tag, buf2.data());
  695|  2.15k|      break;
  696|  2.46k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 2.46k, False: 30.7k]
  ------------------
  697|  3.53k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 1.07k, False: 32.1k]
  ------------------
  698|  3.53k|      decodeIntegerTags(tag, buf2.data());
  699|  3.53k|      break;
  700|  15.2k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 15.2k, False: 17.9k]
  ------------------
  701|  15.2k|      decodeBooleanTags(tag, buf2.data());
  702|  15.2k|      break;
  703|  1.80k|    case Date:
  ------------------
  |  Branch (703:5): [True: 1.80k, False: 31.4k]
  ------------------
  704|  1.80k|      decodeDateTags(tag, buf2.data(), size);
  705|  1.80k|      break;
  706|  1.17k|    case Float:
  ------------------
  |  Branch (706:5): [True: 1.17k, False: 32.0k]
  ------------------
  707|  1.17k|      decodeFloatTags(tag, buf2.data());
  708|  1.17k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 33.2k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 33.2k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 33.2k]
  ------------------
  714|      0|      break;
  715|  33.2k|  }
  716|  33.2k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  8.38k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  8.38k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  8.38k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 175, False: 8.20k]
  ------------------
  721|    175|    return;
  722|       |
  723|  8.20k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  8.20k|    switch (tag->_id) {
  725|  8.20k|      case Xmp_video_VideoScanTpye:
  726|  8.20k|        return Exiv2::find(videoScanType, key);
  727|  8.20k|      case Xmp_audio_ChannelType:
  728|  8.20k|        return Exiv2::find(audioChannels, key);
  729|  8.20k|      case Xmp_video_ContentCompressAlgo:
  730|  8.20k|        return Exiv2::find(compressionAlgorithm, key);
  731|  8.20k|      case Xmp_video_ContentEncryptAlgo:
  732|  8.20k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  8.20k|      case Xmp_video_ContentSignAlgo_1:
  734|  8.20k|      case Xmp_video_ContentSignAlgo_2:
  735|  8.20k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  8.20k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  8.20k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  8.20k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  8.20k|      case Xmp_video_ContentEncodingType:
  740|  8.20k|        return Exiv2::find(encodingType, key);
  741|  8.20k|      case Xmp_video_DisplayUnit:
  742|  8.20k|        return Exiv2::find(displayUnit, key);
  743|  8.20k|      case Xmp_video_AspectRatioType:
  744|  8.20k|        return Exiv2::find(aspectRatioType, key);
  745|  8.20k|      case Xmp_video_PhysicalEquivalent:
  746|  8.20k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  8.20k|      case Xmp_video_TranslateCodec:
  748|  8.20k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  8.20k|      case Video_Audio_CodecID:
  750|  8.20k|        return Exiv2::find(trackCodec, key);
  751|  8.20k|      case Video_Audio_CodecName:
  752|  8.20k|        return Exiv2::find(codecInfo, key);
  753|  8.20k|      case CodecDownloadURL:
  754|  8.20k|      case CodecInfoURL:
  755|  8.20k|        return Exiv2::find(codecDownloadUrl, key);
  756|  8.20k|    }
  757|  8.20k|    return nullptr;
  758|  8.20k|  }();
  759|  8.20k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 3.50k, False: 4.69k]
  ------------------
  760|  3.50k|    xmpData_[tag->_label] = internalMt->_label;
  761|  4.69k|  } else {
  762|  4.69k|    xmpData_[tag->_label] = key;
  763|  4.69k|  }
  764|  8.20k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  2.15k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  2.15k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 198, False: 1.95k]
  ------------------
  768|    198|    track_count_++;
  769|    198|    xmpData_[tag->_label] = track_count_;
  770|  1.95k|  } else {
  771|  1.95k|    xmpData_[tag->_label] = buf;
  772|  1.95k|  }
  773|  2.15k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  3.53k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  3.53k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  3.53k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 667, False: 2.86k]
  ------------------
  778|    667|    return;
  779|       |
  780|  2.86k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 411, False: 2.45k]
  |  Branch (780:40): [True: 220, False: 2.23k]
  ------------------
  781|    631|    width_ = value;
  782|  2.86k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 765, False: 2.10k]
  |  Branch (782:41): [True: 836, False: 1.26k]
  ------------------
  783|  1.60k|    height_ = value;
  784|  2.86k|  xmpData_[tag->_label] = value;
  785|  2.86k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  15.2k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  15.2k|  const MatroskaTag* internalMt = nullptr;
  789|  15.2k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  15.2k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 290, False: 14.9k]
  ------------------
  791|    290|    return;
  792|       |
  793|  14.9k|  switch (tag->_id) {
  794|  4.32k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 4.32k, False: 10.6k]
  ------------------
  795|  4.32k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 1.17k, False: 3.15k]
  ------------------
  796|  1.17k|        stream_ = f->_id;
  797|  1.17k|      }
  798|  4.32k|      break;
  799|    747|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 747, False: 14.2k]
  ------------------
  800|    747|      internalMt = Exiv2::find(trackEnable, key);
  801|    747|      break;
  802|  5.87k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 5.87k, False: 9.12k]
  ------------------
  803|  5.87k|      internalMt = Exiv2::find(defaultOn, key);
  804|  5.87k|      break;
  805|    814|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 814, False: 14.1k]
  ------------------
  806|    814|      internalMt = Exiv2::find(trackForced, key);
  807|    814|      break;
  808|    991|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 991, False: 14.0k]
  ------------------
  809|    991|      internalMt = Exiv2::find(trackLacing, key);
  810|    991|      break;
  811|  1.77k|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 1.77k, False: 13.2k]
  ------------------
  812|  1.77k|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|  1.77k|      break;
  814|    391|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 391, False: 14.6k]
  ------------------
  815|    391|      internalMt = Exiv2::find(codecSettings, key);
  816|    391|      break;
  817|     72|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 72, False: 14.9k]
  ------------------
  818|     72|      internalMt = tag;
  819|     72|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 14.9k]
  ------------------
  821|      0|      break;
  822|  14.9k|  }
  823|       |
  824|  14.9k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.96k, False: 13.0k]
  ------------------
  825|  1.96k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.96k|  }
  827|  14.9k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  1.80k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  1.80k|  int64_t duration_in_ms = 0;
  831|  1.80k|  uint64_t value;
  832|  1.80k|  switch (tag->_id) {
  833|    892|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 892, False: 911]
  ------------------
  834|    892|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 461, False: 431]
  ------------------
  835|    461|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    461|      } else {
  837|    431|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    431|      }
  839|    892|      xmpData_[tag->_label] = duration_in_ms;
  840|    892|      break;
  841|    390|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 390, False: 1.41k]
  ------------------
  842|    390|      value = getULongLong(buf, bigEndian);
  843|    390|      if (!value)
  ------------------
  |  Branch (843:11): [True: 70, False: 320]
  ------------------
  844|     70|        return;
  845|    320|      duration_in_ms = value / 1000000000;
  846|    320|      xmpData_[tag->_label] = duration_in_ms;
  847|    320|      break;
  848|       |
  849|    521|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 521, False: 1.28k]
  ------------------
  850|    521|      value = getULongLong(buf, bigEndian);
  851|    521|      if (!value)
  ------------------
  |  Branch (851:11): [True: 354, False: 167]
  ------------------
  852|    354|        return;
  853|    167|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    167|      xmpData_[tag->_label] = time_code_scale_;
  855|    167|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 1.80k]
  ------------------
  857|      0|      break;
  858|  1.80k|  }
  859|  1.80k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  1.17k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  1.17k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  1.17k|  switch (tag->_id) {
  865|    410|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 410, False: 767]
  ------------------
  866|    505|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 95, False: 1.08k]
  ------------------
  867|    505|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|    505|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 1.17k]
  ------------------
  870|    672|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 672, False: 505]
  ------------------
  871|    672|      uint64_t key = getULongLong(buf, bigEndian);
  872|    672|      if (!key)
  ------------------
  |  Branch (872:11): [True: 132, False: 540]
  ------------------
  873|    132|        return;
  874|    540|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 250, False: 290]
  ------------------
  875|    250|        double frame_rate = 0;
  876|    250|        switch (stream_) {
  877|     67|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 67, False: 183]
  ------------------
  878|     67|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|     67|            break;
  880|     95|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 95, False: 155]
  ------------------
  881|     95|            frame_rate = static_cast<double>(key) / 1000;
  882|     95|            break;
  883|     88|          default:
  ------------------
  |  Branch (883:11): [True: 88, False: 162]
  ------------------
  884|     88|            break;
  885|    250|        }
  886|    250|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 162, False: 88]
  ------------------
  887|    162|          xmpData_[internalMt->_label] = frame_rate;
  888|    250|      } else
  889|    290|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|    540|    } break;
  891|    540|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 1.17k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  1.17k|  }
  895|  1.17k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   138k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   138k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 112k, False: 26.6k]
  ------------------
  899|   112k|    return 1;
  900|  26.6k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 14.6k, False: 11.9k]
  ------------------
  901|  14.6k|    return 2;
  902|  11.9k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 1.42k, False: 10.5k]
  ------------------
  903|  1.42k|    return 3;
  904|  10.5k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 6.29k, False: 4.27k]
  ------------------
  905|  6.29k|    return 4;
  906|  4.27k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 627, False: 3.64k]
  ------------------
  907|    627|    return 5;
  908|  3.64k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 494, False: 3.15k]
  ------------------
  909|    494|    return 6;
  910|  3.15k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 842, False: 2.31k]
  ------------------
  911|    842|    return 7;
  912|  2.31k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 1.69k, False: 611]
  ------------------
  913|  1.69k|    return 8;
  914|    611|  return 0;
  915|  2.31k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.33k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.33k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.33k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.33k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.33k|  return image;
  923|  3.33k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  13.9k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  13.9k|  bool result = true;
  927|  13.9k|  byte tmpBuf[4];
  928|  13.9k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  13.9k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 13.9k]
  |  Branch (930:22): [True: 297, False: 13.6k]
  ------------------
  931|    297|    return false;
  932|       |
  933|  13.6k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 3.60k, False: 10.0k]
  |  Branch (933:28): [True: 11, False: 10.0k]
  |  Branch (933:49): [True: 14, False: 10.0k]
  |  Branch (933:70): [True: 16, False: 9.99k]
  ------------------
  934|  3.64k|    result = false;
  935|  3.64k|  }
  936|       |
  937|  13.6k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 13.6k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  13.6k|    iIo.seek(0, BasicIo::beg);
  939|  13.6k|  return result;
  940|  13.9k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   138k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   138k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 137k, False: 611]
  |  Branch (583:23): [True: 137k, False: 0]
  ------------------
  584|       |
  585|   138k|  size_t b0 = buf[0] & (0xff >> size);
  586|   138k|  size_t tag = b0 << ((size - 1) * 8);
  587|   196k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 58.1k, False: 138k]
  ------------------
  588|  58.1k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  58.1k|  }
  590|       |
  591|   138k|  return tag;
  592|   138k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  8.20k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  8.20k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 8.20k, False: 0]
  ------------------
  725|    407|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 407, False: 7.80k]
  ------------------
  726|    407|        return Exiv2::find(videoScanType, key);
  727|    985|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 985, False: 7.22k]
  ------------------
  728|    985|        return Exiv2::find(audioChannels, key);
  729|    335|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 335, False: 7.87k]
  ------------------
  730|    335|        return Exiv2::find(compressionAlgorithm, key);
  731|  1.15k|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 1.15k, False: 7.04k]
  ------------------
  732|  1.15k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  1.65k|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 1.65k, False: 6.54k]
  ------------------
  734|  1.73k|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 74, False: 8.13k]
  ------------------
  735|  1.73k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    214|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 214, False: 7.99k]
  ------------------
  737|    333|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 119, False: 8.08k]
  ------------------
  738|    333|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    371|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 371, False: 7.83k]
  ------------------
  740|    371|        return Exiv2::find(encodingType, key);
  741|    417|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 417, False: 7.79k]
  ------------------
  742|    417|        return Exiv2::find(displayUnit, key);
  743|    712|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 712, False: 7.49k]
  ------------------
  744|    712|        return Exiv2::find(aspectRatioType, key);
  745|    564|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 564, False: 7.64k]
  ------------------
  746|    564|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    908|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 908, False: 7.29k]
  ------------------
  748|    908|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 8.20k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    146|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 146, False: 8.06k]
  ------------------
  752|    146|        return Exiv2::find(codecInfo, key);
  753|      1|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 1, False: 8.20k]
  ------------------
  754|    137|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 136, False: 8.07k]
  ------------------
  755|    137|        return Exiv2::find(codecDownloadUrl, key);
  756|  8.20k|    }
  757|      0|    return nullptr;
  758|  8.20k|  }();

_ZN5Exiv23KeyD2Ev:
    9|  5.50M|Key::~Key() = default;
_ZN5Exiv29MetadatumD2Ev:
   15|  2.63M|Metadatum::~Metadatum() = default;
_ZNK5Exiv29Metadatum8toUint32Em:
   23|   104k|uint32_t Metadatum::toUint32(size_t n) const {
   24|   104k|  return static_cast<uint32_t>(toInt64(n));
   25|   104k|}

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

_ZN5Exiv28MrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   24|    268|    Image(ImageType::mrw, mdExif | mdIptc | mdXmp, std::move(io), params) {
   25|    268|}
_ZNK5Exiv28MrwImage8mimeTypeEv:
   27|     36|std::string MrwImage::mimeType() const {
   28|     36|  return "image/x-minolta-mrw";
   29|     36|}
_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|    268|void MrwImage::readMetadata() {
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |  std::cerr << "Reading MRW file " << io_->path() << "\n";
   65|       |#endif
   66|    268|  if (io_->open() != 0) {
  ------------------
  |  Branch (66:7): [True: 0, False: 268]
  ------------------
   67|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   68|      0|  }
   69|    268|  IoCloser closer(*io_);
   70|       |  // Ensure that this is the correct image type
   71|    268|  if (!isMrwType(*io_, false)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 268]
  ------------------
   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|    268|  clearMetadata();
   77|       |
   78|       |  // Find the TTW block and read it into a buffer
   79|    268|  uint32_t const len = 8;
   80|    268|  byte tmp[len];
   81|    268|  io_->read(tmp, len);
   82|    268|  uint32_t pos = len;
   83|    268|  uint32_t const end = getULong(tmp + 4, bigEndian);
   84|       |
   85|    268|  pos += len;
   86|    268|  Internal::enforce(pos <= end, ErrorCode::kerFailedToReadImageData);
   87|    268|  io_->read(tmp, len);
   88|    268|  if (io_->error() || io_->eof())
  ------------------
  |  Branch (88:7): [True: 10, False: 258]
  |  Branch (88:23): [True: 0, False: 258]
  ------------------
   89|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   90|       |
   91|    791|  while (memcmp(tmp + 1, "TTW", 3) != 0) {
  ------------------
  |  Branch (91:10): [True: 523, False: 268]
  ------------------
   92|    523|    uint32_t const siz = getULong(tmp + 4, bigEndian);
   93|    523|    Internal::enforce(siz <= end - pos, ErrorCode::kerFailedToReadImageData);
   94|    523|    pos += siz;
   95|    523|    io_->seek(siz, BasicIo::cur);
   96|    523|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (96:23): [True: 493, False: 30]
  |  Branch (96:40): [True: 413, False: 80]
  ------------------
   97|       |
   98|    523|    Internal::enforce(len <= end - pos, ErrorCode::kerFailedToReadImageData);
   99|    523|    pos += len;
  100|    523|    io_->read(tmp, len);
  101|    523|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (101:23): [True: 402, False: 121]
  |  Branch (101:40): [True: 344, False: 58]
  ------------------
  102|    523|  }
  103|       |
  104|    268|  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|    268|  Internal::enforce(siz <= io_->size(), ErrorCode::kerFailedToReadImageData);
  111|    268|  DataBuf buf(siz);
  112|    268|  io_->read(buf.data(), buf.size());
  113|    268|  Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (113:21): [True: 47, False: 221]
  |  Branch (113:38): [True: 36, False: 11]
  ------------------
  114|       |
  115|    268|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.c_data(), buf.size());
  116|    268|  setByteOrder(bo);
  117|    268|}  // MrwImage::readMetadata
_ZN5Exiv214newMrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  126|    268|Image::UniquePtr newMrwInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  127|    268|  auto image = std::make_unique<MrwImage>(std::move(io), params);
  128|    268|  if (!image->good()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 268]
  ------------------
  129|      0|    return nullptr;
  130|      0|  }
  131|    268|  return image;
  132|    268|}
_ZN5Exiv29isMrwTypeERNS_7BasicIoEb:
  134|  33.7k|bool isMrwType(BasicIo& iIo, bool advance) {
  135|  33.7k|  const int32_t len = 4;
  136|  33.7k|  const std::array<byte, len> MrwId{0x0, 0x4d, 0x52, 0x4d};
  137|  33.7k|  std::array<byte, len> buf;
  138|  33.7k|  iIo.read(buf.data(), len);
  139|  33.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (139:7): [True: 0, False: 33.7k]
  |  Branch (139:22): [True: 148, False: 33.5k]
  ------------------
  140|    148|    return false;
  141|    148|  }
  142|  33.5k|  bool rc = buf == MrwId;
  143|  33.5k|  if (!advance || !rc) {
  ------------------
  |  Branch (143:7): [True: 33.5k, False: 0]
  |  Branch (143:19): [True: 0, False: 0]
  ------------------
  144|  33.5k|    iIo.seek(-len, BasicIo::cur);
  145|  33.5k|  }
  146|  33.5k|  return rc;
  147|  33.7k|}

_ZN5Exiv28Internal15Nikon1MakerNote7tagListEv:
   38|    211|  static constexpr auto tagList() {
   39|    211|    return tagInfo_;
   40|    211|  }
_ZN5Exiv28Internal15Nikon2MakerNote7tagListEv:
   71|    389|  static constexpr auto tagList() {
   72|    389|    return tagInfo_;
   73|    389|  }
_ZN5Exiv28Internal15Nikon3MakerNote7tagListEv:
   91|  7.90k|  static constexpr auto tagList() {
   92|  7.90k|    return tagInfo_;
   93|  7.90k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListVrEv:
   95|  2.07k|  static constexpr auto tagListVr() {
   96|  2.07k|    return tagInfoVr_;
   97|  2.07k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListPcEv:
   99|    359|  static constexpr auto tagListPc() {
  100|    359|    return tagInfoPc_;
  101|    359|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListWtEv:
  103|    555|  static constexpr auto tagListWt() {
  104|    555|    return tagInfoWt_;
  105|    555|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListIiEv:
  107|    331|  static constexpr auto tagListIi() {
  108|    331|    return tagInfoIi_;
  109|    331|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListAfEv:
  111|    444|  static constexpr auto tagListAf() {
  112|    444|    return tagInfoAf_;
  113|    444|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf21Ev:
  115|    333|  static constexpr auto tagListAf21() {
  116|    333|    return tagInfoAf21_;
  117|    333|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf22Ev:
  119|    720|  static constexpr auto tagListAf22() {
  120|    720|    return tagInfoAf22_;
  121|    720|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListAFTEv:
  123|    302|  static constexpr auto tagListAFT() {
  124|    302|    return tagInfoAFT_;
  125|    302|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListFiEv:
  127|     13|  static constexpr auto tagListFi() {
  128|     13|    return tagInfoFi_;
  129|     13|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListMeEv:
  131|     12|  static constexpr auto tagListMe() {
  132|     12|    return tagInfoMe_;
  133|     12|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl1Ev:
  135|     18|  static constexpr auto tagListFl1() {
  136|     18|    return tagInfoFl1_;
  137|     18|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl2Ev:
  139|     20|  static constexpr auto tagListFl2() {
  140|     20|    return tagInfoFl2_;
  141|     20|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl3Ev:
  143|     21|  static constexpr auto tagListFl3() {
  144|     21|    return tagInfoFl3_;
  145|     21|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl6Ev:
  147|     31|  static constexpr auto tagListFl6() {
  148|     31|    return tagInfoFl6_;
  149|     31|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl7Ev:
  151|     50|  static constexpr auto tagListFl7() {
  152|     50|    return tagInfoFl7_;
  153|     50|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi1Ev:
  155|     11|  static constexpr auto tagListSi1() {
  156|     11|    return tagInfoSi1_;
  157|     11|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi2Ev:
  159|     25|  static constexpr auto tagListSi2() {
  160|     25|    return tagInfoSi2_;
  161|     25|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi5Ev:
  171|    425|  static constexpr auto tagListSi5() {
  172|    425|    return tagInfoSi5_;
  173|    425|  }
_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|    113|  static constexpr auto tagListCb2b() {
  188|    113|    return tagInfoCb2b_;
  189|    113|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb3Ev:
  191|     33|  static constexpr auto tagListCb3() {
  192|     33|    return tagInfoCb3_;
  193|     33|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb4Ev:
  195|      7|  static constexpr auto tagListCb4() {
  196|      7|    return tagInfoCb4_;
  197|      7|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd1Ev:
  199|     84|  static constexpr auto tagListLd1() {
  200|     84|    return tagInfoLd1_;
  201|     84|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd2Ev:
  203|  49.4k|  static constexpr auto tagListLd2() {
  204|  49.4k|    return tagInfoLd2_;
  205|  49.4k|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd3Ev:
  207|    326|  static constexpr auto tagListLd3() {
  208|    326|    return tagInfoLd3_;
  209|    326|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd4Ev:
  211|    243|  static constexpr auto tagListLd4() {
  212|    243|    return tagInfoLd4_;
  213|    243|  }

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|  71.8k|  static constexpr auto tagList() {
   34|  71.8k|    return tagInfo_;
   35|  71.8k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  67.1k|  static constexpr auto tagListCs() {
   38|  67.1k|    return tagInfoCs_;
   39|  67.1k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    241|  static constexpr auto tagListEq() {
   42|    241|    return tagInfoEq_;
   43|    241|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|    292|  static constexpr auto tagListRd() {
   46|    292|    return tagInfoRd_;
   47|    292|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    203|  static constexpr auto tagListRd2() {
   50|    203|    return tagInfoRd2_;
   51|    203|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    210|  static constexpr auto tagListIp() {
   54|    210|    return tagInfoIp_;
   55|    210|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    345|  static constexpr auto tagListFi() {
   58|    345|    return tagInfoFi_;
   59|    345|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|    242|  static constexpr auto tagListFe() {
   62|    242|    return tagInfoFe_;
   63|    242|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|     79|  static constexpr auto tagListRi() {
   66|     79|    return tagInfoRi_;
   67|     79|  }

_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|      9|std::string OrfImage::mimeType() const {
   30|      9|  return "image/x-olympus-orf";
   31|      9|}
_ZNK5Exiv28OrfImage10pixelWidthEv:
   33|     56|uint32_t OrfImage::pixelWidth() const {
   34|     56|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   35|     56|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (35:7): [True: 21, False: 35]
  |  Branch (35:7): [True: 10, False: 46]
  |  Branch (35:40): [True: 10, False: 11]
  ------------------
   36|     10|    return imageWidth->toUint32();
   37|     10|  }
   38|     46|  return 0;
   39|     56|}
_ZNK5Exiv28OrfImage11pixelHeightEv:
   41|     56|uint32_t OrfImage::pixelHeight() const {
   42|     56|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   43|     56|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (43:7): [True: 23, False: 33]
  |  Branch (43:7): [True: 13, False: 43]
  |  Branch (43:41): [True: 13, False: 10]
  ------------------
   44|     13|    return imageHeight->toUint32();
   45|     13|  }
   46|     43|  return 0;
   47|     56|}
_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|  ByteOrder bo = OrfParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
   86|     75|  setByteOrder(bo);
   87|     75|}
_ZN5Exiv29OrfParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  113|     75|ByteOrder OrfParser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  114|     75|  OrfHeader orfHeader;
  115|     75|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::root, TiffMapping::findDecoder,
  116|     75|                                  &orfHeader);
  117|     75|}
_ZN5Exiv214newOrfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  139|     75|Image::UniquePtr newOrfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  140|     75|  auto image = std::make_unique<OrfImage>(std::move(io), params);
  141|     75|  if (!image->good()) {
  ------------------
  |  Branch (141:7): [True: 0, False: 75]
  ------------------
  142|      0|    return nullptr;
  143|      0|  }
  144|     75|  return image;
  145|     75|}
_ZN5Exiv29isOrfTypeERNS_7BasicIoEb:
  147|  23.0k|bool isOrfType(BasicIo& iIo, bool advance) {
  148|  23.0k|  const int32_t len = 8;
  149|  23.0k|  byte buf[len];
  150|  23.0k|  iIo.read(buf, len);
  151|  23.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (151:7): [True: 0, False: 23.0k]
  |  Branch (151:22): [True: 219, False: 22.7k]
  ------------------
  152|    219|    return false;
  153|    219|  }
  154|  22.7k|  OrfHeader orfHeader;
  155|  22.7k|  bool rc = orfHeader.read(buf, len);
  156|  22.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (156:7): [True: 22.7k, False: 0]
  |  Branch (156:19): [True: 0, False: 0]
  ------------------
  157|  22.7k|    iIo.seek(-len, BasicIo::cur);
  158|  22.7k|  }
  159|  22.7k|  return rc;
  160|  23.0k|}

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  22.8k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  22.8k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  22.8k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  22.8k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 22.8k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  22.8k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 131, False: 22.7k]
  |  Branch (13:26): [True: 103, False: 28]
  ------------------
   14|    103|    setByteOrder(littleEndian);
   15|  22.7k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 296, False: 22.4k]
  |  Branch (15:33): [True: 257, False: 39]
  ------------------
   16|    257|    setByteOrder(bigEndian);
   17|  22.4k|  } else {
   18|  22.4k|    return false;
   19|  22.4k|  }
   20|       |
   21|    360|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    360|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 276, False: 84]
  |  Branch (22:23): [True: 60, False: 216]
  ------------------
   23|     60|    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|    360|}

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

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

_ZN5Exiv28PgfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   53|    438|    Image(ImageType::pgf, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params), bSwap_(isBigEndianPlatform()) {
   54|    438|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (54:7): [True: 0, False: 438]
  |  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|    438|}  // PgfImage::PgfImage
_ZN5Exiv28PgfImage12readMetadataEv:
   67|    438|void PgfImage::readMetadata() {
   68|       |#ifdef EXIV2_DEBUG_MESSAGES
   69|       |  std::cerr << "Exiv2::PgfImage::readMetadata: Reading PGF file " << io_->path() << "\n";
   70|       |#endif
   71|    438|  if (io_->open() != 0) {
  ------------------
  |  Branch (71:7): [True: 0, False: 438]
  ------------------
   72|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   73|      0|  }
   74|    438|  IoCloser closer(*io_);
   75|       |  // Ensure that this is the correct image type
   76|    438|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (76:7): [True: 0, False: 438]
  ------------------
   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|    438|  clearMetadata();
   82|       |
   83|    438|  readPgfMagicNumber(*io_);
   84|       |
   85|    438|  size_t headerSize = readPgfHeaderSize(*io_);
   86|    438|  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|    438|  Internal::enforce(headerSize <= std::numeric_limits<size_t>::max() - 8, ErrorCode::kerCorruptedMetadata);
   91|    438|  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|    438|  if (size > io_->size())
  ------------------
  |  Branch (97:7): [True: 85, False: 353]
  ------------------
   98|     85|    throw Error(ErrorCode::kerInputDataReadFailed);
   99|    353|  if (size == 0)
  ------------------
  |  Branch (99:7): [True: 10, False: 343]
  ------------------
  100|     10|    return;
  101|       |
  102|    343|  DataBuf imgData(size);
  103|    343|  const size_t bufRead = io_->read(imgData.data(), imgData.size());
  104|    343|  if (io_->error())
  ------------------
  |  Branch (104:7): [True: 0, False: 343]
  ------------------
  105|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  106|    343|  if (bufRead != imgData.size())
  ------------------
  |  Branch (106:7): [True: 15, False: 328]
  ------------------
  107|     15|    throw Error(ErrorCode::kerInputDataReadFailed);
  108|       |
  109|    328|  auto image = Exiv2::ImageFactory::open(imgData.c_data(), imgData.size());
  110|    328|  image->readMetadata();
  111|    328|  exifData() = image->exifData();
  112|    328|  iptcData() = image->iptcData();
  113|    328|  xmpData() = image->xmpData();
  114|    328|}
_ZN5Exiv28PgfImage18readPgfMagicNumberERNS_7BasicIoE:
  218|    438|byte PgfImage::readPgfMagicNumber(BasicIo& iIo) {
  219|    438|  auto b = static_cast<byte>(iIo.getb());
  220|    438|  if (iIo.error())
  ------------------
  |  Branch (220:7): [True: 0, False: 438]
  ------------------
  221|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|       |
  223|    438|  if (b < 0x36)  // 0x36 = '6'.
  ------------------
  |  Branch (223:7): [True: 168, False: 270]
  ------------------
  224|    168|  {
  225|       |    // Not right Magick version.
  226|       |#ifdef EXIV2_DEBUG_MESSAGES
  227|       |    std::cout << "Exiv2::PgfImage::readMetadata: wrong Magick number\n";
  228|       |#endif
  229|    168|  }
  230|       |
  231|    438|  return b;
  232|    438|}  // PgfImage::readPgfMagicNumber
_ZNK5Exiv28PgfImage17readPgfHeaderSizeERNS_7BasicIoE:
  234|    438|size_t PgfImage::readPgfHeaderSize(BasicIo& iIo) const {
  235|    438|  DataBuf buffer(4);
  236|    438|  const size_t bufRead = iIo.read(buffer.data(), buffer.size());
  237|    438|  if (iIo.error())
  ------------------
  |  Branch (237:7): [True: 0, False: 438]
  ------------------
  238|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  239|    438|  if (bufRead != buffer.size())
  ------------------
  |  Branch (239:7): [True: 0, False: 438]
  ------------------
  240|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  241|       |
  242|    438|  auto headerSize = static_cast<size_t>(byteSwap_(buffer, 0, bSwap_));
  243|    438|  if (headerSize == 0)
  ------------------
  |  Branch (243:7): [True: 10, False: 428]
  ------------------
  244|     10|    throw Error(ErrorCode::kerNoImageInInputData);
  245|       |
  246|       |#ifdef EXIV2_DEBUG_MESSAGES
  247|       |  std::cout << "Exiv2::PgfImage: PGF header size : " << headerSize << " bytes\n";
  248|       |#endif
  249|       |
  250|    428|  return headerSize;
  251|    438|}
_ZNK5Exiv28PgfImage22readPgfHeaderStructureERNS_7BasicIoERjS3_:
  253|    428|DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const {
  254|    428|  DataBuf header(16);
  255|    428|  size_t bufRead = iIo.read(header.data(), header.size());
  256|    428|  if (iIo.error())
  ------------------
  |  Branch (256:7): [True: 0, False: 428]
  ------------------
  257|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  258|    428|  if (bufRead != header.size())
  ------------------
  |  Branch (258:7): [True: 0, False: 428]
  ------------------
  259|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  260|       |
  261|    428|  DataBuf work(header.data(), 8);  // don't disturb the binary data - doWriteMetadata reuses it
  262|    428|  width = byteSwap_(work, 0, bSwap_);
  263|    428|  height = byteSwap_(work, 4, bSwap_);
  264|       |
  265|       |  /* NOTE: properties not yet used
  266|       |  byte nLevels  = buffer.pData_[8];
  267|       |  byte quality  = buffer.pData_[9];
  268|       |  byte bpp      = buffer.pData_[10];
  269|       |  byte channels = buffer.pData_[11];
  270|       |  */
  271|       |
  272|    428|  if (header.read_uint8(12) == 2)  // Indexed color image. We pass color table (256 * 3 bytes).
  ------------------
  |  Branch (272:7): [True: 13, False: 415]
  ------------------
  273|     13|  {
  274|     13|    header.alloc(16 + (256 * 3));
  275|       |
  276|     13|    bufRead = iIo.read(header.data(16), 256 * 3);
  277|     13|    if (iIo.error())
  ------------------
  |  Branch (277:9): [True: 0, False: 13]
  ------------------
  278|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  279|     13|    if (bufRead != 256 * 3)
  ------------------
  |  Branch (279:9): [True: 10, False: 3]
  ------------------
  280|     10|      throw Error(ErrorCode::kerInputDataReadFailed);
  281|     13|  }
  282|       |
  283|    418|  return header;
  284|    428|}  // PgfImage::readPgfHeaderStructure
_ZN5Exiv214newPgfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  288|    438|Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  289|    438|  auto image = std::make_unique<PgfImage>(std::move(io), params);
  290|    438|  if (!image->good()) {
  ------------------
  |  Branch (290:7): [True: 0, False: 438]
  ------------------
  291|      0|    return nullptr;
  292|      0|  }
  293|    438|  return image;
  294|    438|}
_ZN5Exiv29isPgfTypeERNS_7BasicIoEb:
  296|  22.2k|bool isPgfType(BasicIo& iIo, bool advance) {
  297|  22.2k|  const int32_t len = 3;
  298|  22.2k|  std::array<byte, len> buf;
  299|  22.2k|  iIo.read(buf.data(), len);
  300|  22.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (300:7): [True: 0, False: 22.2k]
  |  Branch (300:22): [True: 0, False: 22.2k]
  ------------------
  301|      0|    return false;
  302|      0|  }
  303|  22.2k|  bool rc = buf == pgfSignature;
  304|  22.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (304:7): [True: 21.8k, False: 438]
  |  Branch (304:19): [True: 0, False: 438]
  ------------------
  305|  21.8k|    iIo.seek(-len, BasicIo::cur);
  306|  21.8k|  }
  307|       |
  308|  22.2k|  return rc;
  309|  22.2k|}
pgfimage.cpp:_ZN5Exiv2L9byteSwap_ERNS_7DataBufEmb:
   39|  1.29k|static uint32_t byteSwap_(Exiv2::DataBuf& buf, size_t offset, bool bSwap) {
   40|  1.29k|  uint32_t v = 0;
   41|  1.29k|  auto p = reinterpret_cast<byte*>(&v);
   42|  1.29k|  int i;
   43|  6.47k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (43:15): [True: 5.17k, False: 1.29k]
  ------------------
   44|  5.17k|    p[i] = buf.read_uint8(offset + i);
   45|  1.29k|  uint32_t result = Image::byteSwap(v, bSwap);
   46|  1.29k|  p = reinterpret_cast<byte*>(&result);
   47|  6.47k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (47:15): [True: 5.17k, False: 1.29k]
  ------------------
   48|  5.17k|    buf.write_uint8(offset + i, p[i]);
   49|  1.29k|  return result;
   50|  1.29k|}

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  35.5k|bool Photoshop::isIrb(const byte* pPsData) {
   28|  35.5k|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 35.5k]
  ------------------
   29|      0|    return false;
   30|       |
   31|  35.5k|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 111k, False: 19.0k]
  ------------------
   32|   111k|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 16.4k, False: 95.5k]
  ------------------
   33|  16.4k|      return true;
   34|       |
   35|  19.0k|  return false;
   36|  35.5k|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  21.2k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  21.2k|  const byte* record = nullptr;
   40|  21.2k|  uint32_t sizeIptc = 0;
   41|  21.2k|  uint32_t sizeHdr = 0;
   42|  21.2k|  const byte* pCur = pPsData;
   43|  21.2k|  const byte* pEnd = pPsData + sizePsData;
   44|  21.2k|  int ret = 0;
   45|  22.2k|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 22.2k, False: 11]
  |  Branch (45:25): [True: 1.03k, False: 21.2k]
  ------------------
   46|  1.03k|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  1.03k|  }
   48|  21.2k|  return ret >= 0;
   49|  21.2k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  22.9k|                         uint32_t& sizeData) {
   56|  22.9k|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 379, False: 22.5k]
  ------------------
   57|    379|    return 3;
   58|    379|  }
   59|       |
   60|       |  // Used for error checking
   61|  22.5k|  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|  33.8k|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 33.6k, False: 223]
  |  Branch (66:43): [True: 14.9k, False: 18.6k]
  ------------------
   67|  14.9k|    const byte* hrd = pPsData + position;
   68|  14.9k|    position += 4;
   69|  14.9k|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  14.9k|    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|  14.9k|    byte psSize = pPsData[position] + 1;
   76|  14.9k|    psSize += (psSize & 1);
   77|  14.9k|    position += psSize;
   78|  14.9k|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 347, False: 14.5k]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|    347|      return -2;
   84|    347|    }
   85|  14.5k|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  14.5k|    position += 4;
   87|  14.5k|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 2.15k, False: 12.4k]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|  2.15k|      return -2;
   93|  2.15k|    }
   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|  12.4k|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 1.14k, False: 11.2k]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  1.14k|      sizeData = dataSize;
  105|  1.14k|      sizeHdr = psSize + 10;
  106|  1.14k|      *record = hrd;
  107|  1.14k|      return 0;
  108|  1.14k|    }
  109|       |    // Data size is also padded to be even
  110|  11.2k|    position += dataSize + (dataSize & 1);
  111|  11.2k|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  18.8k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 18.8k, False: 23]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  18.8k|    return -2;
  121|  18.8k|  }
  122|     23|  return 3;
  123|  18.8k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  22.8k|                             uint32_t& sizeData) {
  127|  22.8k|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  22.8k|}
_ZN5Exiv29Photoshop16locatePreviewIrbEPKhmPS2_RjS4_:
  131|     84|                                uint32_t& sizeData) {
  132|     84|  return locateIrb(pPsData, sizePsData, preview_, record, sizeHdr, sizeData);
  133|     84|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|     55|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|     55|  *outWidth = data.read_uint32(0, bigEndian);
   48|     55|  *outHeight = data.read_uint32(4, bigEndian);
   49|     55|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  7.73k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  7.73k|  DataBuf key = keyTXTChunk(data);
   53|  7.73k|  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.73k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 7.26k, False: 474]
  ------------------
   59|  7.26k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  7.73k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  7.73k|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.73k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 0, False: 7.73k]
  ------------------
   74|  7.73k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 11, False: 7.72k]
  ------------------
   75|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  7.72k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  7.72k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 15, False: 7.71k]
  ------------------
   79|     15|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  7.71k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  7.72k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.71k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.71k|  DataBuf arr;
   86|       |
   87|  7.71k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 120, False: 7.59k]
  ------------------
   88|    120|    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|    120|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 12, False: 108]
  ------------------
   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|     12|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     12|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    108|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    108|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 67, False: 41]
  ------------------
  104|     67|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     67|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     67|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     67|    }
  109|  7.59k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 2.20k, False: 5.38k]
  ------------------
  110|  2.20k|    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.20k|    size_t textsize = data.size() - keysize - 1;
  115|  2.20k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 1.88k, False: 321]
  ------------------
  116|  1.88k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  1.88k|      arr = DataBuf(text, textsize);
  119|  1.88k|    }
  120|  5.38k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 5.38k, False: 0]
  ------------------
  121|  5.38k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  5.38k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  5.38k|    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|  5.38k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  5.38k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  5.38k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.27k, False: 108]
  |  Branch (132:40): [True: 85, False: 23]
  ------------------
  133|  5.38k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 85, False: 5.30k]
  ------------------
  134|     85|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  5.38k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  5.38k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  5.38k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  5.38k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  5.38k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  5.38k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  5.38k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  5.38k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  5.38k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  5.38k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  5.38k|    const auto textsize =
  152|  5.38k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  5.38k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 5.30k, False: 77]
  ------------------
  154|  5.30k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  5.30k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 5.23k, False: 75]
  ------------------
  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|  5.23k|        arr = DataBuf(text, textsize);
  162|  5.23k|      } 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|     75|        zlibUncompress(text, textsize, arr);
  170|     75|      }
  171|  5.30k|    }
  172|  5.38k|  } 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.69k|  return arr;
  180|  7.71k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  7.26k|void PngChunk::parseChunkContent(Image* pImage, const byte* key, size_t keySize, const DataBuf& arr) {
  183|       |  // We look if an ImageMagick EXIF raw profile exist.
  184|       |
  185|  7.26k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 4.93k, False: 2.32k]
  ------------------
  186|  4.93k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 46, False: 4.89k]
  |  Branch (186:57): [True: 2.37k, False: 2.51k]
  ------------------
  187|  2.42k|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 2.35k, False: 68]
  ------------------
  188|  2.35k|    DataBuf exifData = readRawProfile(arr, false);
  189|  2.35k|    size_t length = exifData.size();
  190|       |
  191|  2.35k|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 112, False: 2.24k]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|    112|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|    112|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|    112|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    333|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 221, False: 112]
  ------------------
  200|    221|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 221]
  ------------------
  201|    221|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 221]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|    221|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|    112|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 112]
  ------------------
  210|       |#ifdef EXIV2_DEBUG_MESSAGES
  211|       |        std::cout << "Exiv2::PngChunk::parseChunkContent: TIFF header found at position " << pos << "\n";
  212|       |#endif
  213|      0|        ByteOrder bo = TiffParser::decode(pImage->exifData(), pImage->iptcData(), pImage->xmpData(),
  214|      0|                                          exifData.c_data(pos), length - pos);
  215|      0|        pImage->setByteOrder(bo);
  216|    112|      } else {
  217|    112|#ifndef SUPPRESS_WARNINGS
  218|    112|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|    112|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 112]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    112|  LogMsg(LogMsg::warn).os()
  ------------------
  219|    112|#endif
  220|    112|        pImage->exifData().clear();
  221|    112|      }
  222|    112|    }
  223|  2.35k|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  7.26k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 4.93k, False: 2.32k]
  |  Branch (227:24): [True: 220, False: 4.71k]
  |  Branch (227:73): [True: 210, False: 10]
  ------------------
  228|    210|    DataBuf psData = readRawProfile(arr, false);
  229|    210|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 127, False: 83]
  ------------------
  230|    127|      Blob iptcBlob;
  231|    127|      const byte* record = nullptr;
  232|    127|      uint32_t sizeIptc = 0;
  233|    127|      uint32_t sizeHdr = 0;
  234|       |
  235|    127|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|    127|      const byte* pCur = psData.c_data();
  237|    127|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 117, False: 10]
  |  Branch (237:29): [True: 0, False: 117]
  ------------------
  238|      0|        if (sizeIptc) {
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|       |#ifdef EXIV2_DEBUG_MESSAGES
  240|       |          std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  241|       |#endif
  242|      0|          append(iptcBlob, record + sizeHdr, sizeIptc);
  243|      0|        }
  244|      0|        pCur = record + sizeHdr + sizeIptc;
  245|      0|        pCur += (sizeIptc & 1);
  246|      0|      }
  247|    127|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 127]
  |  Branch (247:32): [True: 0, False: 0]
  ------------------
  248|      0|#ifndef SUPPRESS_WARNINGS
  249|      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()
  ------------------
  250|      0|#endif
  251|      0|        pImage->clearIptcData();
  252|      0|      }
  253|       |      // If there is no IRB, try to decode the complete chunk data
  254|    127|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 127, False: 0]
  |  Branch (254:31): [True: 39, False: 88]
  ------------------
  255|     39|#ifndef SUPPRESS_WARNINGS
  256|     39|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     39|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 39]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     39|  LogMsg(LogMsg::warn).os()
  ------------------
  257|     39|#endif
  258|     39|        pImage->clearIptcData();
  259|     39|      }
  260|    127|    }  // if (psData.size() > 0)
  261|    210|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  7.26k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 5.44k, False: 1.82k]
  |  Branch (265:24): [True: 1.94k, False: 3.49k]
  |  Branch (265:72): [True: 1.94k, False: 0]
  ------------------
  266|  1.94k|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|  1.94k|    size_t length = xmpBuf.size();
  268|       |
  269|  1.94k|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 1.56k, False: 382]
  ------------------
  270|  1.56k|      std::string& xmpPacket = pImage->xmpPacket();
  271|  1.56k|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|  1.56k|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 440, False: 1.12k]
  |  Branch (272:80): [True: 47, False: 393]
  ------------------
  273|     47|#ifndef SUPPRESS_WARNINGS
  274|     47|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     47|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 47]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     47|  LogMsg(LogMsg::warn).os()
  ------------------
  275|     47|#endif
  276|     47|        xmpPacket = xmpPacket.substr(idx);
  277|     47|      }
  278|  1.56k|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 1.56k, False: 0]
  ------------------
  279|  1.56k|#ifndef SUPPRESS_WARNINGS
  280|  1.56k|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  1.56k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.56k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.56k|  LogMsg(LogMsg::warn).os()
  ------------------
  281|  1.56k|#endif
  282|  1.56k|      }
  283|  1.56k|    }
  284|  1.94k|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  7.26k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 6.34k, False: 913]
  |  Branch (288:24): [True: 1.15k, False: 5.19k]
  |  Branch (288:69): [True: 1.15k, False: 0]
  |  Branch (288:98): [True: 1.14k, False: 10]
  ------------------
  289|  1.14k|    std::string& xmpPacket = pImage->xmpPacket();
  290|  1.14k|    xmpPacket.assign(arr.c_str(), arr.size());
  291|  1.14k|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 998, False: 148]
  |  Branch (291:78): [True: 455, False: 543]
  ------------------
  292|    455|#ifndef SUPPRESS_WARNINGS
  293|    455|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    455|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 455]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    455|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    455|#endif
  296|    455|      xmpPacket = xmpPacket.substr(idx);
  297|    455|    }
  298|  1.14k|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 243, False: 903]
  ------------------
  299|    243|#ifndef SUPPRESS_WARNINGS
  300|    243|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    243|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 243]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    243|  LogMsg(LogMsg::warn).os()
  ------------------
  301|    243|#endif
  302|    243|    }
  303|  1.14k|  }
  304|       |
  305|       |  // We look if a comments string exist. Note than we use only 'Description' keyword which
  306|       |  // is dedicated to store long comments. 'Comment' keyword is ignored.
  307|       |
  308|  7.26k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 6.53k, False: 731]
  |  Branch (308:7): [True: 95, False: 7.16k]
  |  Branch (308:24): [True: 630, False: 5.90k]
  |  Branch (308:63): [True: 95, False: 535]
  ------------------
  309|     95|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|     95|  }
  311|       |
  312|  7.26k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|    142|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|    142|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|    142|  int zlibResult = Z_BUF_ERROR;
  338|    142|  int dos = 0;
  339|       |
  340|    300|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 220, False: 80]
  ------------------
  341|    220|    arr.alloc(uncompressedLen);
  342|    220|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|    220|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 80, False: 140]
  ------------------
  344|     80|      arr.resize(uncompressedLen);
  345|    140|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 79, False: 61]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     79|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     79|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 3, False: 76]
  ------------------
  350|      3|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 1, False: 2]
  ------------------
  351|      1|          break;
  352|      2|        uncompressedLen = 131072;
  353|      2|      }
  354|     79|    } else {
  355|       |      // something bad happened
  356|     61|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|     61|    }
  358|    220|  }
  359|       |
  360|     81|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (360:7): [True: 1, False: 80]
  ------------------
  361|      1|    throw Error(ErrorCode::kerFailedToReadImageData);
  362|      1|  }
  363|     81|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  469|  4.50k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  4.50k|  DataBuf info;
  471|  4.50k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 83, False: 4.42k]
  ------------------
  472|     83|    return info;
  473|     83|  }
  474|       |
  475|  4.42k|  const unsigned char unhex[103] = {
  476|  4.42k|      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,
  477|  4.42k|      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,
  478|  4.42k|      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,
  479|  4.42k|  };
  480|       |
  481|  4.42k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 4.42k]
  ------------------
  482|      0|    info.alloc(text.size());
  483|      0|    std::copy(text.begin(), text.end(), info.begin());
  484|      0|    return info;
  485|      0|  }
  486|       |
  487|  4.42k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  4.42k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  4.42k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 36, False: 4.38k]
  ------------------
  491|     36|    return info;
  492|     36|  }
  493|       |
  494|       |  // Look for newline
  495|  76.4k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 72.0k, False: 4.32k]
  ------------------
  496|  72.0k|    sp++;
  497|  72.0k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 60, False: 72.0k]
  ------------------
  498|     60|      return info;
  499|     60|    }
  500|  72.0k|  }
  501|  4.32k|  sp++;  // step over '\n'
  502|  4.32k|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 35, False: 4.29k]
  ------------------
  503|     35|    return info;
  504|     35|  }
  505|       |
  506|       |  // Look for length
  507|   105k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 5.52k, False: 100k]
  |  Branch (507:25): [True: 81.0k, False: 19.4k]
  |  Branch (507:39): [True: 15.1k, False: 4.26k]
  ------------------
  508|   101k|    sp++;
  509|   101k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 28, False: 101k]
  ------------------
  510|     28|      return info;
  511|     28|    }
  512|   101k|  }
  513|       |
  514|       |  // Parse the length.
  515|  4.26k|  size_t length = 0;
  516|  8.52k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 5.20k, False: 3.32k]
  |  Branch (516:24): [True: 4.33k, False: 875]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  4.33k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  4.33k|    length = newlength;
  520|  4.33k|    sp++;
  521|  4.33k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 69, False: 4.26k]
  ------------------
  522|     69|      return info;
  523|     69|    }
  524|  4.33k|  }
  525|  4.19k|  sp++;  // step over '\n'
  526|  4.19k|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 539, False: 3.65k]
  ------------------
  527|    539|    return info;
  528|    539|  }
  529|       |
  530|  3.65k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|  3.65k|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 1.17k, False: 2.48k]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|  1.17k|  }
  538|  3.65k|  info.alloc(length);
  539|  3.65k|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 3.65k]
  ------------------
  540|       |#ifdef EXIV2_DEBUG_MESSAGES
  541|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: cannot allocate memory\n";
  542|       |#endif
  543|      0|    return info;
  544|      0|  }
  545|       |
  546|  3.65k|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 1.17k, False: 2.48k]
  ------------------
  547|  1.17k|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|  2.48k|  unsigned char* dp = info.data();  // decode pointer
  551|  2.48k|  size_t nibbles = length * 2;
  552|       |
  553|  25.3k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 23.3k, False: 1.93k]
  ------------------
  554|  23.3k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  35.6k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 4.33k, False: 31.3k]
  |  Branch (555:26): [True: 14.1k, False: 17.2k]
  |  Branch (555:39): [True: 3.05k, False: 11.1k]
  |  Branch (555:53): [True: 5.50k, False: 22.8k]
  ------------------
  556|  12.8k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 554, False: 12.3k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|    554|        return {};
  561|    554|      }
  562|       |
  563|  12.3k|      sp++;
  564|  12.3k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  12.3k|    }
  566|       |
  567|  22.8k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 11.4k, False: 11.4k]
  ------------------
  568|  11.4k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  11.4k|    else
  570|  11.4k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  22.8k|  }
  572|       |
  573|  1.93k|  return info;
  574|       |
  575|  2.48k|}  // PngChunk::readRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  1.16k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  1.16k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.16k]
  |  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.16k|}
_ZNK5Exiv28PngImage8mimeTypeEv:
   70|      9|std::string PngImage::mimeType() const {
   71|      9|  return "image/png";
   72|      9|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.16k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.16k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.16k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.16k|  IoCloser closer(*io_);
  400|  1.16k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.16k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.16k|  clearMetadata();
  404|       |
  405|  1.16k|  const size_t imgSize = io_->size();
  406|  1.16k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  27.3k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 26.8k, False: 451]
  ------------------
  409|  26.8k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  26.8k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  26.8k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 342, False: 26.5k]
  ------------------
  414|    342|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    342|    }
  416|       |
  417|  26.5k|    std::string chunkType(cheaderBuf.c_str(4), 4);
  418|       |#ifdef EXIV2_DEBUG_MESSAGES
  419|       |    std::cout << "Exiv2::PngImage::readMetadata: chunk type: " << chunkType << " length: " << chunkLength << '\n';
  420|       |#endif
  421|       |
  422|       |    /// \todo analyse remaining chunks of the standard
  423|       |    // Perform a chunk triage for item that we need.
  424|  26.5k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 111, False: 26.4k]
  |  Branch (424:32): [True: 133, False: 26.2k]
  |  Branch (424:55): [True: 2.21k, False: 24.0k]
  |  Branch (424:78): [True: 125, False: 23.9k]
  ------------------
  425|  23.9k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 52, False: 23.8k]
  |  Branch (425:32): [True: 5.39k, False: 18.4k]
  |  Branch (425:55): [True: 912, False: 17.5k]
  ------------------
  426|  8.84k|      DataBuf chunkData(chunkLength);
  427|  8.84k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 8.72k, False: 119]
  ------------------
  428|  8.72k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  8.72k|      }
  430|       |
  431|  8.84k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 12, False: 8.83k]
  ------------------
  432|     12|        return;  // Last chunk found: we stop parsing.
  433|     12|      }
  434|  8.83k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 133, False: 8.70k]
  |  Branch (434:34): [True: 55, False: 78]
  ------------------
  435|     55|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  8.77k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 2.21k, False: 6.56k]
  ------------------
  437|  2.21k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  6.56k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 125, False: 6.43k]
  ------------------
  439|    125|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  6.43k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 5.39k, False: 1.04k]
  ------------------
  441|  5.39k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  5.39k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 52, False: 990]
  ------------------
  443|     52|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|     52|        setByteOrder(bo);
  445|    990|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 912, False: 78]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    912|        uint32_t iccOffset = 0;
  448|  6.80k|        do {
  449|  6.80k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 6.80k, False: 6]
  |  Branch (449:37): [True: 6.79k, False: 13]
  ------------------
  450|  6.80k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 5.89k, False: 912]
  ------------------
  451|       |
  452|    912|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    912|        ++iccOffset;  // +1 = 'compressed' flag
  454|    912|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    912|        zlibToDataBuf(chunkData.c_data(iccOffset), static_cast<uLongf>(chunkLength - iccOffset), iccProfile_);
  457|       |#ifdef EXIV2_DEBUG_MESSAGES
  458|       |        std::cout << "Exiv2::PngImage::readMetadata: profile name: " << profileName_ << '\n';
  459|       |        std::cout << "Exiv2::PngImage::readMetadata: iccProfile.size_ (uncompressed) : " << iccProfile_.size() << '\n';
  460|       |#endif
  461|    912|      }
  462|       |
  463|       |      // Set chunkLength to 0 in case we have read a supported chunk type. Otherwise, we need to seek the
  464|       |      // file to the next chunk position.
  465|  8.83k|      chunkLength = 0;
  466|  8.83k|    }
  467|       |
  468|       |    // Move to the next chunk: chunk data size + 4 CRC bytes.
  469|       |#ifdef EXIV2_DEBUG_MESSAGES
  470|       |    std::cout << "Exiv2::PngImage::readMetadata: Seek to offset: " << chunkLength + 4 << '\n';
  471|       |#endif
  472|  26.5k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  26.5k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 451, False: 26.0k]
  |  Branch (473:25): [True: 364, False: 25.6k]
  ------------------
  474|    364|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    364|    }
  476|  26.5k|  }
  477|  1.16k|}  // PngImage::readMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  684|  1.16k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  685|  1.16k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  686|  1.16k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.16k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.16k|  return image;
  690|  1.16k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  25.1k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  25.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 25.1k]
  |  Branch (693:22): [True: 219, False: 24.8k]
  ------------------
  694|    219|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    219|  }
  696|  24.8k|  const int32_t len = 8;
  697|  24.8k|  std::array<byte, len> buf;
  698|  24.8k|  iIo.read(buf.data(), len);
  699|  24.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 24.8k]
  |  Branch (699:22): [True: 0, False: 24.8k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  24.8k|  bool rc = buf == pngSignature;
  703|  24.8k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 23.7k, False: 1.16k]
  |  Branch (703:19): [True: 0, False: 1.16k]
  ------------------
  704|  23.7k|    iIo.seek(-len, BasicIo::cur);
  705|  23.7k|  }
  706|       |
  707|  24.8k|  return rc;
  708|  24.8k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    883|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    883|  uLongf uncompressedLen = length;  // just a starting point
   76|    883|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.96k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 1.08k, False: 883]
  ------------------
   79|  1.08k|    result.alloc(uncompressedLen);
   80|  1.08k|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|  1.08k|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 6, False: 1.07k]
  |  Branch (82:31): [True: 6, False: 0]
  ------------------
   83|      6|      result.reset();
   84|       |
   85|      6|      result.alloc(uncompressedLen);
   86|      6|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|      6|    }
   88|  1.08k|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 199, False: 883]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    199|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    199|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 199]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    199|      else
   96|    199|        uncompressedLen *= 2;
   97|    199|    }
   98|  1.08k|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    883|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  35.5k|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|  35.5k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  35.5k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 35.5k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  35.5k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 99, False: 35.4k]
  ------------------
  388|     99|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     99|  }
  390|  35.5k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|     35|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|     35|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|     35|const byte* PreviewImage::pData() const {
 1018|     35|  return preview_.c_data();
 1019|     35|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|     35|uint32_t PreviewImage::size() const {
 1022|     35|  return static_cast<uint32_t>(preview_.size());
 1023|     35|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  16.8k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  16.8k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  16.8k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  16.8k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   585k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 568k, False: 16.8k]
  ------------------
 1052|   568k|    auto loader = Loader::create(id, image_);
 1053|   568k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 15.5k, False: 552k]
  |  Branch (1053:19): [True: 9.87k, False: 5.67k]
  ------------------
 1054|  9.87k|      PreviewProperties props = loader->getProperties();
 1055|  9.87k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  9.87k|      props.size_ = buf.size();         //     update the size
 1057|  9.87k|      list.push_back(std::move(props));
 1058|  9.87k|    }
 1059|   568k|  }
 1060|  16.8k|  std::sort(list.begin(), list.end(),
 1061|  16.8k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  16.8k|  return list;
 1064|  16.8k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|     35|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|     35|  auto loader = Loader::create(properties.id_, image_);
 1068|     35|  DataBuf buf;
 1069|     35|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 35, False: 0]
  ------------------
 1070|     35|    buf = loader->getData();
 1071|     35|  }
 1072|       |
 1073|     35|  return {properties, std::move(buf)};
 1074|     35|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|  1.15M|PreviewId Loader::getNumLoaders() {
  351|  1.15M|  return PreviewId{std::size(loaderList_)};
  352|  1.15M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  67.1k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  67.1k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  67.1k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  67.1k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  67.1k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 67.1k]
  |  Branch (355:21): [True: 64.4k, False: 2.62k]
  ------------------
  356|  64.4k|    return;
  357|  2.62k|  nativePreview_ = image.nativePreviews()[parIdx];
  358|  2.62k|  width_ = nativePreview_.width_;
  359|  2.62k|  height_ = nativePreview_.height_;
  360|  2.62k|  valid_ = true;
  361|  2.62k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (361:7): [True: 2.43k, False: 186]
  ------------------
  362|  2.43k|    size_ = nativePreview_.size_;
  363|  2.43k|  } else {
  364|    186|    size_ = getData().size();
  365|    186|  }
  366|  2.62k|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  343|   518k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   518k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  9.87k|PreviewProperties Loader::getProperties() const {
  347|  9.87k|  return {"", "", size_, width_, height_, id_};
  348|  9.87k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  4.41k|  virtual bool readDimensions() {
   78|  4.41k|    return true;
   79|  4.41k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   518k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   536k|  [[nodiscard]] virtual bool valid() const {
   67|   536k|    return valid_;
   68|   536k|  }
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative13getPropertiesEv:
  372|  2.44k|PreviewProperties LoaderNative::getProperties() const {
  373|  2.44k|  PreviewProperties prop = Loader::getProperties();
  374|  2.44k|  prop.mimeType_ = nativePreview_.mimeType_;
  375|  2.44k|  if (nativePreview_.mimeType_ == "image/jpeg") {
  ------------------
  |  Branch (375:7): [True: 2.07k, False: 375]
  ------------------
  376|  2.07k|    prop.extension_ = ".jpg";
  377|  2.07k|  } else if (nativePreview_.mimeType_ == "image/tiff") {
  ------------------
  |  Branch (377:14): [True: 1, False: 374]
  ------------------
  378|      1|    prop.extension_ = ".tif";
  379|    374|  } else if (nativePreview_.mimeType_ == "image/x-wmf") {
  ------------------
  |  Branch (379:14): [True: 1, False: 373]
  ------------------
  380|      1|    prop.extension_ = ".wmf";
  381|    373|  } else if (nativePreview_.mimeType_ == "image/x-portable-anymap") {
  ------------------
  |  Branch (381:14): [True: 88, False: 285]
  ------------------
  382|     88|    prop.extension_ = ".pnm";
  383|    285|  } else {
  384|    285|#ifndef SUPPRESS_WARNINGS
  385|    285|    EXV_WARNING << "Unknown native preview format: " << nativePreview_.mimeType_ << "\n";
  ------------------
  |  |  138|    285|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 285]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    285|  LogMsg(LogMsg::warn).os()
  ------------------
  386|    285|#endif
  387|    285|    prop.extension_ = ".dat";
  388|    285|  }
  389|  2.44k|  return prop;
  390|  2.44k|}
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative7getDataEv:
  392|  3.32k|DataBuf LoaderNative::getData() const {
  393|  3.32k|  if (!valid())
  ------------------
  |  Branch (393:7): [True: 0, False: 3.32k]
  ------------------
  394|      0|    return {};
  395|       |
  396|  3.32k|  BasicIo& io = image_.io();
  397|  3.32k|  if (io.open() != 0) {
  ------------------
  |  Branch (397:7): [True: 0, False: 3.32k]
  ------------------
  398|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  399|      0|  }
  400|  3.32k|  IoCloser closer(io);
  401|  3.32k|  const byte* data = io.mmap();
  402|  3.32k|  if (io.size() < nativePreview_.position_ + nativePreview_.size_) {
  ------------------
  |  Branch (402:7): [True: 874, False: 2.45k]
  ------------------
  403|    874|#ifndef SUPPRESS_WARNINGS
  404|    874|    EXV_WARNING << "Invalid native preview position or size.\n";
  ------------------
  |  |  138|    874|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 874]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    874|  LogMsg(LogMsg::warn).os()
  ------------------
  405|    874|#endif
  406|    874|    return {};
  407|    874|  }
  408|  2.45k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (408:7): [True: 2.13k, False: 316]
  ------------------
  409|  2.13k|    return {data + nativePreview_.position_, nativePreview_.size_};
  410|  2.13k|  }
  411|    316|  if (nativePreview_.filter_ == "hex-ai7thumbnail-pnm") {
  ------------------
  |  Branch (411:7): [True: 232, False: 84]
  ------------------
  412|    232|    size_t expectedSize = 0;
  413|    232|    if (!ai7ThumbnailSize(width_, height_, expectedSize)) {
  ------------------
  |  Branch (413:9): [True: 134, False: 98]
  ------------------
  414|    134|#ifndef SUPPRESS_WARNINGS
  415|    134|      EXV_WARNING << "Unsupported size of AI7 thumbnail: " << width_ << "x" << height_ << "\n";
  ------------------
  |  |  138|    134|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 134]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    134|  LogMsg(LogMsg::warn).os()
  ------------------
  416|    134|#endif
  417|    134|      return {};
  418|    134|    }
  419|     98|    const DataBuf ai7thumbnail = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  420|     98|    const DataBuf rgb = decodeAi7Thumbnail(ai7thumbnail, expectedSize);
  421|     98|    return makePnm(width_, height_, rgb);
  422|    232|  }
  423|     84|  if (nativePreview_.filter_ == "hex-irb") {
  ------------------
  |  Branch (423:7): [True: 84, False: 0]
  ------------------
  424|     84|    const DataBuf psData = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  425|     84|    const byte* record;
  426|     84|    uint32_t sizeHdr = 0;
  427|     84|    uint32_t sizeData = 0;
  428|     84|    if (Photoshop::locatePreviewIrb(psData.c_data(), psData.size(), &record, sizeHdr, sizeData) != 0) {
  ------------------
  |  Branch (428:9): [True: 84, False: 0]
  ------------------
  429|     84|#ifndef SUPPRESS_WARNINGS
  430|     84|      EXV_WARNING << "Missing preview IRB in Photoshop EPS preview.\n";
  ------------------
  |  |  138|     84|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 84]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     84|  LogMsg(LogMsg::warn).os()
  ------------------
  431|     84|#endif
  432|     84|      return {};
  433|     84|    }
  434|      0|    Internal::enforce(sizeData >= 28, ErrorCode::kerCorruptedMetadata);
  435|      0|    return {record + sizeHdr + 28, sizeData - 28};
  436|     84|  }
  437|      0|  throw Error(ErrorCode::kerErrorMessage, "Invalid native preview filter: ", nativePreview_.filter_);
  438|     84|}
preview.cpp:_ZN12_GLOBAL__N_116ai7ThumbnailSizeEmmRm:
  828|    232|bool ai7ThumbnailSize(size_t width, size_t height, size_t& rgbSize) {
  829|    232|  rgbSize = 0;
  830|    232|  if (width == 0 || height == 0)
  ------------------
  |  Branch (830:7): [True: 8, False: 224]
  |  Branch (830:21): [True: 2, False: 222]
  ------------------
  831|     10|    return false;
  832|       |
  833|    222|  constexpr size_t bytesPerPixel = 3;
  834|       |
  835|    222|  if (width > std::numeric_limits<size_t>::max() / height)
  ------------------
  |  Branch (835:7): [True: 82, False: 140]
  ------------------
  836|     82|    return false;
  837|       |
  838|    140|  const size_t pixels = width * height;
  839|    140|  if (pixels > std::numeric_limits<size_t>::max() / bytesPerPixel)
  ------------------
  |  Branch (839:7): [True: 2, False: 138]
  ------------------
  840|      2|    return false;
  841|       |
  842|    138|  rgbSize = pixels * bytesPerPixel;
  843|    138|  return rgbSize <= maxAi7ThumbnailSize;
  844|    140|}
preview.cpp:_ZN12_GLOBAL__N_19decodeHexEPKhm:
  846|    182|DataBuf decodeHex(const byte* src, size_t srcSize) {
  847|       |  // create decoding table
  848|    182|  byte invalid = 16;
  849|    182|  std::array<byte, 256> decodeHexTable;
  850|    182|  decodeHexTable.fill(invalid);
  851|  2.00k|  for (byte i = 0; i < 10; i++)
  ------------------
  |  Branch (851:20): [True: 1.82k, False: 182]
  ------------------
  852|  1.82k|    decodeHexTable[static_cast<byte>('0') + i] = i;
  853|  1.27k|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (853:20): [True: 1.09k, False: 182]
  ------------------
  854|  1.09k|    decodeHexTable[static_cast<byte>('A') + i] = i + 10;
  855|  1.27k|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (855:20): [True: 1.09k, False: 182]
  ------------------
  856|  1.09k|    decodeHexTable[static_cast<byte>('a') + i] = i + 10;
  857|       |
  858|       |  // calculate dest size
  859|    182|  long validSrcSize = 0;
  860|  4.61M|  for (size_t srcPos = 0; srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (860:27): [True: 4.61M, False: 182]
  ------------------
  861|  4.61M|    if (decodeHexTable[src[srcPos]] != invalid)
  ------------------
  |  Branch (861:9): [True: 4.25M, False: 361k]
  ------------------
  862|  4.25M|      validSrcSize++;
  863|  4.61M|  }
  864|    182|  const size_t destSize = validSrcSize / 2;
  865|       |
  866|       |  // allocate dest buffer
  867|    182|  DataBuf dest(destSize);
  868|       |
  869|       |  // decode
  870|  2.12M|  for (size_t srcPos = 0, destPos = 0; destPos < destSize; destPos++) {
  ------------------
  |  Branch (870:40): [True: 2.12M, False: 182]
  ------------------
  871|  2.12M|    byte buffer = 0;
  872|  6.73M|    for (int bufferPos = 1; bufferPos >= 0 && srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (872:29): [True: 4.61M, False: 2.12M]
  |  Branch (872:47): [True: 4.61M, False: 0]
  ------------------
  873|  4.61M|      byte srcValue = decodeHexTable[src[srcPos]];
  874|  4.61M|      if (srcValue == invalid)
  ------------------
  |  Branch (874:11): [True: 360k, False: 4.25M]
  ------------------
  875|   360k|        continue;
  876|  4.25M|      buffer |= srcValue << (bufferPos * 4);
  877|  4.25M|      bufferPos--;
  878|  4.25M|    }
  879|  2.12M|    dest.write_uint8(destPos, buffer);
  880|  2.12M|  }
  881|    182|  return dest;
  882|    182|}
preview.cpp:_ZN12_GLOBAL__N_118decodeAi7ThumbnailERKN5Exiv27DataBufEm:
  921|     98|DataBuf decodeAi7Thumbnail(const DataBuf& src, size_t expectedSize) {
  922|     98|  const byte* colorTable = src.c_data();
  923|     98|  const size_t colorTableSize = 256 * 3;
  924|     98|  if (src.size() < colorTableSize) {
  ------------------
  |  Branch (924:7): [True: 36, False: 62]
  ------------------
  925|     36|#ifndef SUPPRESS_WARNINGS
  926|     36|    EXV_WARNING << "Invalid size of AI7 thumbnail: " << src.size() << "\n";
  ------------------
  |  |  138|     36|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 36]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     36|  LogMsg(LogMsg::warn).os()
  ------------------
  927|     36|#endif
  928|     36|    return {};
  929|     36|  }
  930|     62|  const byte* imageData = src.c_data(colorTableSize);
  931|     62|  const size_t imageDataSize = src.size() - colorTableSize;
  932|     62|  const bool rle = (imageDataSize >= 3 && imageData[0] == 'R' && imageData[1] == 'L' && imageData[2] == 'E');
  ------------------
  |  Branch (932:21): [True: 53, False: 9]
  |  Branch (932:43): [True: 4, False: 49]
  |  Branch (932:66): [True: 0, False: 4]
  |  Branch (932:89): [True: 0, False: 0]
  ------------------
  933|     62|  DataBuf dest(expectedSize);
  934|     62|  auto destData = dest.data();
  935|     62|  size_t destPos = 0;
  936|   106k|  for (size_t i = rle ? 3 : 0; i < imageDataSize;) {
  ------------------
  |  Branch (936:19): [True: 0, False: 62]
  |  Branch (936:32): [True: 106k, False: 62]
  ------------------
  937|   106k|    byte num = 1;
  938|   106k|    byte value = imageData[i++];
  939|   106k|    if (rle && value == 0xFD) {
  ------------------
  |  Branch (939:9): [True: 0, False: 106k]
  |  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|   106k|    Internal::enforce(expectedSize - destPos >= static_cast<size_t>(num) * 3, ErrorCode::kerCorruptedMetadata);
  959|   106k|    const auto c0 = colorTable[value * 3];
  960|   106k|    const auto c1 = colorTable[value * 3 + 1];
  961|   106k|    const auto c2 = colorTable[value * 3 + 2];
  962|   212k|    for (; num > 0; num--) {
  ------------------
  |  Branch (962:12): [True: 106k, False: 106k]
  ------------------
  963|   106k|      destData[destPos++] = c0;
  964|   106k|      destData[destPos++] = c1;
  965|   106k|      destData[destPos++] = c2;
  966|   106k|    }
  967|   106k|  }
  968|     62|  Internal::enforce(destPos == expectedSize, ErrorCode::kerCorruptedMetadata);
  969|     62|  return dest;
  970|     62|}
preview.cpp:_ZN12_GLOBAL__N_17makePnmEmmRKN5Exiv27DataBufE:
  972|     42|DataBuf makePnm(size_t width, size_t height, const DataBuf& rgb) {
  973|       |  // This was already checked in decodeAi7Thumbnail().
  974|     42|  assert(width * height * 3UL == rgb.size());
  975|       |
  976|     42|  const std::string header = "P6\n" + std::to_string(width) + " " + std::to_string(height) + "\n255\n";
  977|       |
  978|     42|  DataBuf dest(header.size() + rgb.size());
  979|     42|  std::copy(header.begin(), header.end(), dest.begin());
  980|     42|  std::copy(rgb.begin(), rgb.end(), dest.begin() + header.size());
  981|     42|  return dest;
  982|     42|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNative14readDimensionsEv:
  440|  2.56k|bool LoaderNative::readDimensions() {
  441|  2.56k|  if (!valid())
  ------------------
  |  Branch (441:7): [True: 0, False: 2.56k]
  ------------------
  442|      0|    return false;
  443|  2.56k|  if (width_ != 0 || height_ != 0)
  ------------------
  |  Branch (443:7): [True: 1.50k, False: 1.06k]
  |  Branch (443:22): [True: 370, False: 695]
  ------------------
  444|  1.87k|    return true;
  445|       |
  446|    695|  const DataBuf data = getData();
  447|    695|  if (data.empty())
  ------------------
  |  Branch (447:7): [True: 70, False: 625]
  ------------------
  448|     70|    return false;
  449|       |
  450|    625|  try {
  451|    625|    auto image = ImageFactory::open(data.c_data(), data.size());
  452|    625|    if (!image)
  ------------------
  |  Branch (452:9): [True: 0, False: 625]
  ------------------
  453|      0|      return false;
  454|    625|    image->readMetadata();
  455|       |
  456|    625|    width_ = image->pixelWidth();
  457|    625|    height_ = image->pixelHeight();
  458|    625|  } catch (const Error& /* error */) {
  459|     43|#ifndef SUPPRESS_WARNINGS
  460|     43|    EXV_WARNING << "Invalid native preview image.\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()
  ------------------
  461|     43|#endif
  462|     43|    return false;
  463|     43|  }
  464|    575|  return true;
  465|    625|}
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|   184k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|   184k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|   184k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|   184k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|   184k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 679, False: 183k]
  ------------------
  557|    679|    size_ = pos->sizeDataArea();  // indirect data
  558|    679|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 583, False: 96]
  |  Branch (558:23): [True: 106, False: 477]
  ------------------
  559|    106|      size_ = pos->size();  // direct data
  560|    679|  }
  561|       |
  562|   184k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 184k, False: 196]
  ------------------
  563|   184k|    return;
  564|       |
  565|    196|  valid_ = true;
  566|    196|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|     42|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|     42|  PreviewProperties prop = Loader::getProperties();
  574|     42|  prop.mimeType_ = "image/jpeg";
  575|     42|  prop.extension_ = ".jpg";
  576|     42|  return prop;
  577|     42|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|    238|DataBuf LoaderExifDataJpeg::getData() const {
  580|    238|  DataBuf buf;
  581|       |
  582|    238|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 238]
  ------------------
  583|      0|    return buf;
  584|       |
  585|    238|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 238, False: 0]
  ------------------
  586|    238|    buf = pos->dataArea();  // indirect data
  587|       |
  588|    238|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 137, False: 101]
  ------------------
  589|    137|      buf = DataBuf(pos->size());
  590|    137|      pos->copy(buf.data(), invalidByteOrder);
  591|    137|    }
  592|       |
  593|    238|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|    238|    return buf;
  595|    238|  }
  596|       |
  597|      0|  return buf;
  598|    238|}
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|    119|    return false;
  618|    119|  }
  619|       |
  620|     42|  return true;
  621|    161|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|   117k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|   117k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|   117k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|   117k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|   117k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|   117k|  size_t offsetCount = 0;
  628|   117k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|   117k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 100k, False: 16.7k]
  ------------------
  632|   100k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|   100k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 95.3k, False: 5.04k]
  ------------------
  634|  95.3k|      return;
  635|  5.04k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 5.04k, False: 0]
  |  Branch (635:9): [True: 751, False: 4.29k]
  |  Branch (635:39): [True: 751, False: 4.29k]
  ------------------
  636|    751|      return;
  637|  5.04k|  }
  638|       |
  639|  21.0k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  21.0k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 4.67k, False: 16.3k]
  ------------------
  641|  4.67k|    offsetTag_ = "StripOffsets";
  642|  4.67k|    sizeTag_ = "StripByteCounts";
  643|  4.67k|    offsetCount = pos->value().count();
  644|  16.3k|  } else {
  645|  16.3k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  16.3k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 16.1k, False: 221]
  ------------------
  647|  16.1k|      return;
  648|    221|    offsetTag_ = "TileOffsets";
  649|    221|    sizeTag_ = "TileByteCounts";
  650|    221|    offsetCount = pos->value().count();
  651|    221|  }
  652|       |
  653|  4.89k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  4.89k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 141, False: 4.75k]
  ------------------
  655|    141|    return;
  656|  4.75k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 42, False: 4.71k]
  ------------------
  657|     42|    return;
  658|  28.1k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 23.4k, False: 4.71k]
  ------------------
  659|  23.4k|    size_ += pos->toUint32(i);
  660|  23.4k|  }
  661|       |
  662|  4.71k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 57, False: 4.65k]
  ------------------
  663|     57|    return;
  664|       |
  665|  4.65k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  4.65k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 4.54k, False: 108]
  |  Branch (666:7): [True: 4.51k, False: 141]
  |  Branch (666:32): [True: 4.51k, False: 33]
  ------------------
  667|  4.51k|    width_ = pos->toUint32();
  668|  4.51k|  }
  669|       |
  670|  4.65k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  4.65k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 4.58k, False: 71]
  |  Branch (671:7): [True: 4.51k, False: 139]
  |  Branch (671:32): [True: 4.51k, False: 68]
  ------------------
  672|  4.51k|    height_ = pos->toUint32();
  673|  4.51k|  }
  674|       |
  675|  4.65k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 170, False: 4.48k]
  |  Branch (675:22): [True: 72, False: 4.41k]
  ------------------
  676|    242|    return;
  677|       |
  678|  4.41k|  valid_ = true;
  679|  4.41k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  4.41k|PreviewProperties LoaderTiff::getProperties() const {
  686|  4.41k|  PreviewProperties prop = Loader::getProperties();
  687|  4.41k|  prop.mimeType_ = "image/tiff";
  688|  4.41k|  prop.extension_ = ".tif";
  689|  4.41k|  return prop;
  690|  4.41k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  4.41k|DataBuf LoaderTiff::getData() const {
  693|  4.41k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  4.41k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   777k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 777k, False: 4.41k]
  ------------------
  699|   777k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 236k, False: 540k]
  ------------------
  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|   236k|      uint16_t tag = pos.tag();
  708|   236k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 232k, False: 4.40k]
  |  Branch (708:28): [True: 231k, False: 554]
  |  Branch (708:45): [True: 149k, False: 82.8k]
  ------------------
  709|   149k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|   149k|      }
  711|   236k|    }
  712|   777k|  }
  713|       |
  714|  4.41k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  4.41k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 4.16k, False: 249]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  4.16k|    BasicIo& io = image_.io();
  719|       |
  720|  4.16k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 4.16k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  4.16k|    IoCloser closer(io);
  724|       |
  725|  4.16k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  4.16k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  4.16k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 4.16k, False: 0]
  ------------------
  730|  4.16k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 3.99k, False: 170]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  3.99k|        uint32_t offset = dataValue.toUint32(0);
  733|  3.99k|        uint32_t size = sizes.toUint32(0);
  734|  3.99k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 2.55k, False: 1.43k]
  ------------------
  735|  2.55k|          dataValue.setDataArea(base + offset, size);
  736|  3.99k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    170|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    170|        DataBuf buf(size_);
  740|    170|        uint32_t idxBuf = 0;
  741|  6.01k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 5.84k, False: 170]
  ------------------
  742|  5.84k|          uint32_t offset = dataValue.toUint32(i);
  743|  5.84k|          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|  5.84k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  5.84k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 2.05k, False: 3.79k]
  |  Branch (750:28): [True: 1.14k, False: 908]
  ------------------
  751|  1.14k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|  1.14k|          }
  753|       |
  754|  5.84k|          idxBuf += size;
  755|  5.84k|        }
  756|    170|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    170|      }
  758|  4.16k|    }
  759|  4.16k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  4.41k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 2, False: 4.41k]
  |  Branch (762:7): [True: 2, False: 4.41k]
  |  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.41k|  MemIo mio;
  768|  4.41k|  IptcData emptyIptc;
  769|  4.41k|  XmpData emptyXmp;
  770|  4.41k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  4.41k|  return {mio.mmap(), mio.size()};
  772|  4.41k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|   133k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|   133k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|   133k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|   133k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|   133k|  const ExifData& exifData = image_.exifData();
  469|   133k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|   133k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 9.87k, False: 123k]
  |  Branch (470:7): [True: 8.68k, False: 124k]
  |  Branch (470:32): [True: 8.68k, False: 1.19k]
  ------------------
  471|  8.68k|    offset_ = pos->toUint32();
  472|  8.68k|  }
  473|       |
  474|   133k|  size_ = 0;
  475|   133k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|   133k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 10.9k, False: 122k]
  |  Branch (476:7): [True: 8.76k, False: 124k]
  |  Branch (476:32): [True: 8.76k, False: 2.13k]
  ------------------
  477|  8.76k|    size_ = pos->toUint32();
  478|  8.76k|  }
  479|       |
  480|   133k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 124k, False: 8.59k]
  |  Branch (480:23): [True: 169, False: 8.42k]
  ------------------
  481|   124k|    return;
  482|       |
  483|  8.42k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 4, False: 8.42k]
  ------------------
  484|      4|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  485|      4|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (485:9): [True: 4, False: 0]
  |  Branch (485:9): [True: 4, False: 0]
  |  Branch (485:34): [True: 4, False: 0]
  ------------------
  486|      4|      offset_ += pos->toUint32();
  487|      4|    }
  488|      4|  }
  489|       |
  490|  8.42k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 94, False: 8.33k]
  ------------------
  491|     94|    return;
  492|       |
  493|  8.33k|  valid_ = true;
  494|  8.33k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  2.90k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  2.90k|  PreviewProperties prop = Loader::getProperties();
  502|  2.90k|  prop.mimeType_ = "image/jpeg";
  503|  2.90k|  prop.extension_ = ".jpg";
  504|  2.90k|  return prop;
  505|  2.90k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  2.90k|DataBuf LoaderExifJpeg::getData() const {
  508|  2.90k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 2.90k]
  ------------------
  509|      0|    return {};
  510|  2.90k|  BasicIo& io = image_.io();
  511|       |
  512|  2.90k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 2.90k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  2.90k|  IoCloser closer(io);
  516|       |
  517|  2.90k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  2.90k|  return {base + offset_, size_};
  520|  2.90k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  8.33k|bool LoaderExifJpeg::readDimensions() {
  523|  8.33k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 8.33k]
  ------------------
  524|      0|    return false;
  525|  8.33k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 8.33k]
  |  Branch (525:17): [True: 0, False: 8.33k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  8.33k|  BasicIo& io = image_.io();
  529|       |
  530|  8.33k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 8.33k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  8.33k|  IoCloser closer(io);
  534|  8.33k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  8.33k|  try {
  537|  8.33k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  8.33k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 8.33k]
  ------------------
  539|      0|      return false;
  540|  8.33k|    image->readMetadata();
  541|       |
  542|  8.33k|    width_ = image->pixelWidth();
  543|  8.33k|    height_ = image->pixelHeight();
  544|  8.33k|  } catch (const Error& /* error */) {
  545|  5.42k|#ifndef SUPPRESS_WARNINGS
  546|  5.42k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  5.42k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.42k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.42k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  5.42k|#endif
  548|  5.42k|    return false;
  549|  5.42k|  }
  550|       |
  551|  2.90k|  return true;
  552|  8.33k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  16.6k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  16.6k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  16.6k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  16.6k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  16.6k|  (void)parIdx;
  776|       |
  777|  16.6k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  16.6k|  std::string prefix = "xmpGImg";
  780|  16.6k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 80, False: 16.5k]
  ------------------
  781|     80|    prefix = "xapGImg";
  782|     80|  }
  783|       |
  784|  16.6k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  16.6k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 16.5k, False: 80]
  ------------------
  786|  16.5k|    return;
  787|     80|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  788|     80|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (788:7): [True: 2, False: 78]
  ------------------
  789|      2|    return;
  790|     78|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  791|     78|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (791:7): [True: 2, False: 76]
  ------------------
  792|      2|    return;
  793|     76|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  794|     76|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (794:7): [True: 1, False: 75]
  ------------------
  795|      1|    return;
  796|       |
  797|     75|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (797:7): [True: 3, False: 72]
  ------------------
  798|      3|    return;
  799|       |
  800|     72|  width_ = widthDatum->toUint32();
  801|     72|  height_ = heightDatum->toUint32();
  802|     72|  preview_ = decodeBase64(imageDatum->toString());
  803|     72|  size_ = preview_.size();
  804|     72|  valid_ = true;
  805|     72|}
preview.cpp:_ZN12_GLOBAL__N_112decodeBase64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  886|     72|DataBuf decodeBase64(const std::string& src) {
  887|     72|  DataBuf dest;
  888|       |  // create decoding table
  889|     72|  unsigned long invalid = 64;
  890|     72|  auto decodeBase64Table = std::vector<unsigned long>(256, invalid);
  891|  4.68k|  for (unsigned long i = 0; i < 64; i++)
  ------------------
  |  Branch (891:29): [True: 4.60k, False: 72]
  ------------------
  892|  4.60k|    decodeBase64Table[static_cast<unsigned char>(encodeBase64Table[i])] = i;
  893|       |
  894|       |  // calculate dest size
  895|     72|  auto validSrcSize = static_cast<unsigned long>(
  896|     72|      std::count_if(src.begin(), src.end(), [&](unsigned char c) { return decodeBase64Table.at(c) != invalid; }));
  897|     72|  if (validSrcSize > ULONG_MAX / 3)
  ------------------
  |  Branch (897:7): [True: 0, False: 72]
  ------------------
  898|      0|    return dest;  // avoid integer overflow
  899|     72|  const unsigned long destSize = (validSrcSize * 3) / 4;
  900|       |
  901|       |  // allocate dest buffer
  902|     72|  dest = DataBuf(destSize);
  903|       |
  904|       |  // decode
  905|   119k|  for (unsigned long srcPos = 0, destPos = 0; destPos < destSize;) {
  ------------------
  |  Branch (905:47): [True: 119k, False: 72]
  ------------------
  906|   119k|    unsigned long buffer = 0;
  907|   621k|    for (int bufferPos = 3; bufferPos >= 0 && srcPos < src.size(); srcPos++) {
  ------------------
  |  Branch (907:29): [True: 502k, False: 118k]
  |  Branch (907:47): [True: 502k, False: 40]
  ------------------
  908|   502k|      unsigned long srcValue = decodeBase64Table[static_cast<unsigned char>(src[srcPos])];
  909|   502k|      if (srcValue == invalid)
  ------------------
  |  Branch (909:11): [True: 25.9k, False: 476k]
  ------------------
  910|  25.9k|        continue;
  911|   476k|      buffer |= srcValue << (bufferPos * 6);
  912|   476k|      bufferPos--;
  913|   476k|    }
  914|   476k|    for (int bufferPos = 2; bufferPos >= 0 && destPos < destSize; bufferPos--, destPos++) {
  ------------------
  |  Branch (914:29): [True: 357k, False: 118k]
  |  Branch (914:47): [True: 357k, False: 40]
  ------------------
  915|   357k|      dest.write_uint8(destPos, static_cast<byte>((buffer >> (bufferPos * 8))));
  916|   357k|    }
  917|   119k|  }
  918|     72|  return dest;
  919|     72|}
preview.cpp:_ZZN12_GLOBAL__N_112decodeBase64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_0clEh:
  896|   502k|      std::count_if(src.begin(), src.end(), [&](unsigned char c) { return decodeBase64Table.at(c) != invalid; }));
preview.cpp:_ZNK12_GLOBAL__N_113LoaderXmpJpeg13getPropertiesEv:
  811|     72|PreviewProperties LoaderXmpJpeg::getProperties() const {
  812|     72|  PreviewProperties prop = Loader::getProperties();
  813|     72|  prop.mimeType_ = "image/jpeg";
  814|     72|  prop.extension_ = ".jpg";
  815|     72|  return prop;
  816|     72|}
preview.cpp:_ZNK12_GLOBAL__N_113LoaderXmpJpeg7getDataEv:
  818|     72|DataBuf LoaderXmpJpeg::getData() const {
  819|     72|  if (!valid())
  ------------------
  |  Branch (819:7): [True: 0, False: 72]
  ------------------
  820|      0|    return {};
  821|     72|  return {preview_.c_data(), preview_.size()};
  822|     72|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpeg14readDimensionsEv:
  824|     72|bool LoaderXmpJpeg::readDimensions() {
  825|     72|  return valid();
  826|     72|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  328|   568k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   568k|  Loader::UniquePtr loader;
  330|   568k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 568k]
  |  Branch (330:17): [True: 0, False: 568k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   568k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 50.0k, False: 518k]
  |  Branch (333:7): [True: 49.7k, False: 518k]
  |  Branch (333:41): [True: 49.7k, False: 302]
  ------------------
  334|  49.7k|    return loader;
  335|       |
  336|   518k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   518k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 502k, False: 15.6k]
  ------------------
  338|   502k|    loader = nullptr;
  339|       |
  340|   518k|  return loader;
  341|   568k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  8.36k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  1.76M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  1.76M|  return ns_ == ns.ns_;
 4941|  1.76M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  58.3M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  58.3M|  return prefix_ == prefix.prefix_;
 4945|  58.3M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  1.84M|std::mutex& XmpProperties::getMutex() {
 4953|  1.84M|  static std::mutex m;
 4954|  1.84M|  return m;
 4955|  1.84M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  1.98M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  32.6M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 32.6M, False: 1.89M]
  ------------------
 4965|  32.6M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 90.4k, False: 32.5M]
  ------------------
 4966|  90.4k|      return &p;
 4967|  32.6M|  }
 4968|  1.89M|  return nullptr;
 4969|  1.98M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     24|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     24|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 24]
  ------------------
 4978|      0|    return;
 4979|     24|  std::string ns2 = ns;
 4980|     24|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 13, False: 11]
  |  Branch (4980:28): [True: 12, False: 1]
  ------------------
 4981|     12|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     24|  auto it = nsRegistry_.find(ns2);
 4985|     24|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 24]
  |  Branch (4985:7): [True: 0, False: 24]
  |  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|     24|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 24]
  ------------------
 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|     24|  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|     24|  XmpNsInfo xn;
 5005|     24|  auto c = new char[ns2.size() + 1];
 5006|     24|  std::strcpy(c, ns2.c_str());
 5007|     24|  xn.ns_ = c;
 5008|     24|  c = new char[prefix.size() + 1];
 5009|     24|  std::strcpy(c, prefix.c_str());
 5010|     24|  xn.prefix_ = c;
 5011|     24|  xn.xmpPropertyInfo_ = nullptr;
 5012|     24|  xn.desc_ = "";
 5013|     24|  nsRegistry_[ns2] = xn;
 5014|     24|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     24|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     24|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     24|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     48|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     48|  auto i = nsRegistry_.find(ns);
 5027|     48|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 24, False: 24]
  ------------------
 5028|     24|    delete[] i->second.prefix_;
 5029|     24|    delete[] i->second.ns_;
 5030|     24|    nsRegistry_.erase(i);
 5031|     24|  }
 5032|     48|}
_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|     25|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 24, False: 1]
  ------------------
 5046|     24|    auto kill = i++;
 5047|     24|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     24|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   128k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   128k|  std::string ns2 = ns;
 5058|   128k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 24.4k, False: 104k]
  |  Branch (5058:28): [True: 19.4k, False: 5.04k]
  ------------------
 5059|  19.4k|    ns2 += '/';
 5060|       |
 5061|   128k|  auto i = nsRegistry_.find(ns2);
 5062|   128k|  std::string p;
 5063|   128k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 80.7k, False: 48.0k]
  ------------------
 5064|  80.7k|    p = i->second.prefix_;
 5065|  48.0k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 11.9k, False: 36.0k]
  ------------------
 5066|  11.9k|    p = std::string(xn->prefix_);
 5067|   128k|  return p;
 5068|   128k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.01M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.01M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 85.6k, False: 925k]
  ------------------
 5077|  85.6k|    return xn->ns_;
 5078|   925k|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.01M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  8.21k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  8.21k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  8.21k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 4.76k, False: 3.45k]
  |  Branch (5083:59): [True: 3.42k, False: 24]
  ------------------
 5084|  8.21k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  44.3k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  44.3k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  44.3k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 42.9k, False: 1.39k]
  ------------------
 5114|  44.3k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  44.3k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  44.3k|  std::string prefix = key.groupName();
 5123|  44.3k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  44.3k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 44.3k]
  ------------------
 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|  44.3k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 44.3k, False: 0]
  ------------------
 5138|  5.93M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 5.93M, False: 1.39k]
  ------------------
 5139|  5.93M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 42.9k, False: 5.89M]
  ------------------
 5140|  42.9k|        return pl + j;
 5141|  42.9k|      }
 5142|  5.93M|    }
 5143|  44.3k|  }
 5144|  1.39k|  return nullptr;
 5145|  44.3k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  44.3k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  44.3k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  44.3k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|   969k|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|   969k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|   969k|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|   969k|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 969k, False: 0]
  ------------------
 5175|   969k|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|   969k|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 0, False: 969k]
  ------------------
 5177|      0|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|   969k|  return xn;
 5179|   969k|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   116k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   116k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 116k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   116k|  property_ = property;
 5256|   116k|  prefix_ = prefix;
 5257|   116k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   263k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   263k|  p_->decomposeKey(key);
 5261|   263k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   631k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   631k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   631k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   116k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   116k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.40M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   391k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   391k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   391k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   391k|  return UniquePtr(clone_());
 5288|   391k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   391k|XmpKey* XmpKey::clone_() const {
 5291|   391k|  return new XmpKey(*this);
 5292|   391k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  16.9M|std::string XmpKey::key() const {
 5295|  16.9M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  16.9M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|  44.3k|std::string XmpKey::groupName() const {
 5303|  44.3k|  return p_->prefix_;
 5304|  44.3k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|  44.3k|std::string XmpKey::tagName() const {
 5307|  44.3k|  return p_->property_;
 5308|  44.3k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5336|   263k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5337|   263k|  XmpProperties::XmpLock lock;
 5338|   263k|  decomposeKeyUnlocked(key, lock);
 5339|   263k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5341|   894k|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|   894k|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5343:7): [True: 283, False: 894k]
  ------------------
 5344|    283|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|   894k|  std::string::size_type pos1 = key.find('.');
 5346|   894k|  std::string::size_type pos0 = pos1 + 1;
 5347|   894k|  pos1 = key.find('.', pos0);
 5348|   894k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5348:7): [True: 0, False: 894k]
  ------------------
 5349|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5350|   894k|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5351|   894k|  if (prefix.empty())
  ------------------
  |  Branch (5351:7): [True: 0, False: 894k]
  ------------------
 5352|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5353|   894k|  std::string property = key.substr(pos1 + 1);
 5354|   894k|  if (property.empty())
  ------------------
  |  Branch (5354:7): [True: 0, False: 894k]
  ------------------
 5355|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5356|       |
 5357|       |  // Validate prefix unlocked (must hold lock)
 5358|   894k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5358:7): [True: 0, False: 894k]
  ------------------
 5359|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5360|       |
 5361|   894k|  property_ = std::move(property);
 5362|   894k|  prefix_ = std::move(prefix);
 5363|   894k|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|   894k|  Impl() = default;                                                                             //!< Default constructor

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  103|    801|    Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io), params) {
  104|    801|}  // PsdImage::PsdImage
_ZNK5Exiv28PsdImage8mimeTypeEv:
  106|    849|std::string PsdImage::mimeType() const {
  107|    849|  return "image/x-photoshop";
  108|    849|}
_ZN5Exiv28PsdImage12readMetadataEv:
  115|    791|void PsdImage::readMetadata() {
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  118|       |#endif
  119|    791|  if (io_->open() != 0) {
  ------------------
  |  Branch (119:7): [True: 0, False: 791]
  ------------------
  120|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  121|      0|  }
  122|    791|  IoCloser closer(*io_);
  123|       |  // Ensure that this is the correct image type
  124|    791|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (124:7): [True: 0, False: 791]
  ------------------
  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|    791|  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|    791|  byte buf[26];
  147|    791|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (147:7): [True: 0, False: 791]
  ------------------
  148|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  149|      0|  }
  150|    791|  pixelWidth_ = getLong(buf + 18, bigEndian);
  151|    791|  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|    791|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (155:7): [True: 0, False: 791]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  157|      0|  }
  158|       |
  159|       |  // skip it
  160|    791|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (160:7): [True: 11, False: 780]
  ------------------
  161|     11|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  162|     11|  }
  163|       |
  164|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  165|    780|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (165:7): [True: 10, False: 770]
  ------------------
  166|     10|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  167|     10|  }
  168|    770|  uint32_t resourcesLength = getULong(buf, bigEndian);
  169|    770|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  170|       |
  171|  2.25k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (171:10): [True: 1.96k, False: 293]
  ------------------
  172|  1.96k|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  173|  1.96k|    resourcesLength -= 8;
  174|  1.96k|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (174:9): [True: 22, False: 1.94k]
  ------------------
  175|     22|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  176|     22|    }
  177|       |
  178|  1.94k|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (178:9): [True: 440, False: 1.50k]
  ------------------
  179|    440|      break;  // bad resource type
  180|    440|    }
  181|  1.50k|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  182|  1.50k|    uint32_t resourceNameLength = buf[6] & ~1;
  183|       |
  184|       |    // skip the resource name, plus any padding
  185|  1.50k|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  186|  1.50k|    resourcesLength -= resourceNameLength;
  187|  1.50k|    io_->seek(resourceNameLength, BasicIo::cur);
  188|       |
  189|       |    // read resource size
  190|  1.50k|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  191|  1.50k|    resourcesLength -= 4;
  192|  1.50k|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (192:9): [True: 15, False: 1.48k]
  ------------------
  193|     15|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  194|     15|    }
  195|  1.48k|    uint32_t resourceSize = getULong(buf, bigEndian);
  196|  1.48k|    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.48k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  204|  1.48k|    readResourceBlock(resourceId, resourceSize);
  205|  1.48k|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  206|  1.48k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  207|  1.48k|    resourcesLength -= resourceSize;
  208|  1.48k|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  209|  1.48k|  }
  210|       |
  211|    770|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  213|  1.38k|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  214|  1.38k|  switch (resourceId) {
  215|     76|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (215:5): [True: 76, False: 1.31k]
  ------------------
  216|     76|      DataBuf rawIPTC(resourceSize);
  217|     76|      io_->read(rawIPTC.data(), rawIPTC.size());
  218|     76|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (218:11): [True: 0, False: 76]
  |  Branch (218:27): [True: 10, False: 66]
  ------------------
  219|     10|        throw Error(ErrorCode::kerFailedToReadImageData);
  220|     66|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (220:11): [True: 36, False: 30]
  ------------------
  221|     36|#ifndef SUPPRESS_WARNINGS
  222|     36|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     36|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 36]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     36|  LogMsg(LogMsg::warn).os()
  ------------------
  223|     36|#endif
  224|     36|        iptcData_.clear();
  225|     36|      }
  226|     66|      break;
  227|     76|    }
  228|       |
  229|    115|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (229:5): [True: 115, False: 1.27k]
  ------------------
  230|    115|      DataBuf rawExif(resourceSize);
  231|    115|      io_->read(rawExif.data(), rawExif.size());
  232|    115|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (232:11): [True: 0, False: 115]
  |  Branch (232:27): [True: 10, False: 105]
  ------------------
  233|     10|        throw Error(ErrorCode::kerFailedToReadImageData);
  234|    105|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size());
  235|    105|      setByteOrder(bo);
  236|    105|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (236:11): [True: 10, False: 95]
  |  Branch (236:31): [True: 0, False: 10]
  ------------------
  237|      0|#ifndef SUPPRESS_WARNINGS
  238|      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()
  ------------------
  239|      0|#endif
  240|      0|        exifData_.clear();
  241|      0|      }
  242|    105|      break;
  243|    115|    }
  244|       |
  245|     65|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (245:5): [True: 65, False: 1.32k]
  ------------------
  246|     65|      DataBuf xmpPacket(resourceSize);
  247|     65|      io_->read(xmpPacket.data(), xmpPacket.size());
  248|     65|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (248:11): [True: 0, False: 65]
  |  Branch (248:27): [True: 10, False: 55]
  ------------------
  249|     10|        throw Error(ErrorCode::kerFailedToReadImageData);
  250|     55|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  251|     55|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (251:11): [True: 44, False: 11]
  |  Branch (251:34): [True: 44, False: 0]
  ------------------
  252|     44|#ifndef SUPPRESS_WARNINGS
  253|     44|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     44|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 44]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     44|  LogMsg(LogMsg::warn).os()
  ------------------
  254|     44|#endif
  255|     44|      }
  256|     55|      break;
  257|     65|    }
  258|       |
  259|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  260|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  261|    884|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (261:5): [True: 884, False: 502]
  ------------------
  262|    913|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (262:5): [True: 29, False: 1.35k]
  ------------------
  263|       |      /*
  264|       |        Photoshop thumbnail resource header
  265|       |
  266|       |        offset  length    name            description
  267|       |        ======  ========  ====            ===========
  268|       |         0      4 bytes   format          = 1 (kJpegRGB). Also supports kRawRGB (0).
  269|       |         4      4 bytes   width           Width of thumbnail in pixels.
  270|       |         8      4 bytes   height          Height of thumbnail in pixels.
  271|       |        12      4 bytes   widthbytes      Padded row bytes as (width * bitspixel + 31) / 32 * 4.
  272|       |        16      4 bytes   size            Total size as widthbytes * height * planes
  273|       |        20      4 bytes   compressedsize  Size after compression. Used for consistency check.
  274|       |        24      2 bytes   bitspixel       = 24. Bits per pixel.
  275|       |        26      2 bytes   planes          = 1. Number of planes.
  276|       |        28      variable  data            JFIF data in RGB format.
  277|       |                                          Note: For resource ID 1033 the data is in BGR format.
  278|       |      */
  279|    913|      byte buf[28];
  280|    913|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (280:11): [True: 18, False: 895]
  ------------------
  281|     18|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  282|     18|      }
  283|    895|      NativePreview nativePreview;
  284|    895|      nativePreview.position_ = io_->tell();
  285|    895|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  286|    895|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  287|    895|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  288|    895|      const uint32_t format = getLong(buf + 0, bigEndian);
  289|       |
  290|    895|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  291|    895|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  292|       |
  293|    895|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (293:11): [True: 824, False: 71]
  |  Branch (293:38): [True: 824, False: 0]
  ------------------
  294|    824|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  295|    824|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (295:13): [True: 0, False: 824]
  |  Branch (295:29): [True: 49, False: 775]
  ------------------
  296|     49|          throw Error(ErrorCode::kerFailedToReadImageData);
  297|       |
  298|       |        // unsupported format of native preview
  299|    775|        if (format != 1)
  ------------------
  |  Branch (299:13): [True: 73, False: 702]
  ------------------
  300|     73|          break;
  301|    702|        nativePreview.filter_ = "";
  302|    702|        nativePreview.mimeType_ = "image/jpeg";
  303|    702|        nativePreviews_.push_back(std::move(nativePreview));
  304|    702|      }
  305|    773|      break;
  306|    895|    }
  307|       |
  308|    773|    default:
  ------------------
  |  Branch (308:5): [True: 217, False: 1.16k]
  ------------------
  309|    217|      break;
  310|  1.38k|  }
  311|  1.38k|}  // PsdImage::readResourceBlock
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  677|    801|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  678|    801|  auto image = std::make_unique<PsdImage>(std::move(io), params);
  679|    801|  if (!image->good()) {
  ------------------
  |  Branch (679:7): [True: 10, False: 791]
  ------------------
  680|     10|    return nullptr;
  681|     10|  }
  682|    791|  return image;
  683|    801|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  685|  17.1k|bool isPsdType(BasicIo& iIo, bool advance) {
  686|  17.1k|  const int32_t len = 6;
  687|  17.1k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  688|  17.1k|  std::array<byte, len> buf;
  689|  17.1k|  iIo.read(buf.data(), len);
  690|  17.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (690:7): [True: 0, False: 17.1k]
  |  Branch (690:22): [True: 308, False: 16.8k]
  ------------------
  691|    308|    return false;
  692|    308|  }
  693|  16.8k|  bool matched = buf == PsdHeader;
  694|  16.8k|  if (!advance || !matched) {
  ------------------
  |  Branch (694:7): [True: 16.8k, False: 0]
  |  Branch (694:19): [True: 0, False: 0]
  ------------------
  695|  16.8k|    iIo.seek(-len, BasicIo::cur);
  696|  16.8k|  }
  697|       |
  698|  16.8k|  return matched;
  699|  17.1k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  3.98k|    Image(ImageType::qtime, mdNone, std::move(io), params),
  541|  3.98k|    mvhdTimeScale_(1),
  542|  3.98k|    mdhdTimeScale_(1),
  543|  3.98k|    currentStream_(Null),
  544|  3.98k|    max_recursion_depth_(params.max_recursion_depth()) {
  545|  3.98k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  4.76k|std::string QuickTimeVideo::mimeType() const {
  548|  4.76k|  return "video/quicktime";
  549|  4.76k|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  3.96k|void QuickTimeVideo::readMetadata() {
  555|  3.96k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.96k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  3.96k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 3.96k]
  ------------------
  560|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  |  Branch (560:25): [True: 0, False: 0]
  ------------------
  561|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  562|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  563|      0|  }
  564|       |
  565|  3.96k|  IoCloser closer(*io_);
  566|  3.96k|  clearMetadata();
  567|  3.96k|  continueTraversing_ = true;
  568|  3.96k|  height_ = width_ = 1;
  569|       |
  570|  3.96k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  3.96k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  40.2k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 36.2k, False: 3.96k]
  ------------------
  574|  36.2k|    decodeBlock(0);
  575|       |
  576|  3.96k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  3.96k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  47.7k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|  47.7k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|  47.7k|  const long bufMinSize = 4;
  583|  47.7k|  DataBuf buf(bufMinSize + 1);
  584|  47.7k|  uint64_t size = 0;
  585|  47.7k|  buf.data()[4] = '\0';
  586|       |
  587|  47.7k|  io_->read(buf.data(), 4);
  588|  47.7k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 296, False: 47.4k]
  ------------------
  589|    296|    continueTraversing_ = false;
  590|    296|    return;
  591|    296|  }
  592|       |
  593|  47.4k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|  47.4k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|  47.4k|  size_t hdrsize = 8;
  599|       |
  600|  47.4k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 149, False: 47.2k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    149|    DataBuf data(8);
  603|    149|    hdrsize += 8;
  604|    149|    io_->readOrThrow(data.data(), data.size());
  605|    149|    size = data.read_uint64(0, bigEndian);
  606|  47.2k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 305, False: 46.9k]
  |  Branch (606:27): [True: 159, False: 146]
  ------------------
  607|    159|    size = buf.read_uint32(0, bigEndian);
  608|    159|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|    159|  }
  610|       |
  611|  47.4k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|  47.4k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|  47.4k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|  47.4k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|  47.4k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 1.57k, False: 45.8k]
  ------------------
  618|  1.57k|    discard(newsize);
  619|  1.57k|    return;
  620|  1.57k|  }
  621|  45.8k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 25.9k, False: 19.8k]
  ------------------
  622|  25.9k|    buf.resize(newsize);
  623|  25.9k|  }
  624|  45.8k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|  45.8k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  45.2k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  45.2k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  45.2k|  assert(buf.size() > 4);
  638|       |
  639|  45.2k|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 45.2k]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  45.2k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 6.52k, False: 38.6k]
  ------------------
  643|  6.52k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|  38.6k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 8.22k, False: 30.4k]
  ------------------
  645|  8.22k|    fileTypeDecoder(size);
  646|       |
  647|  30.4k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 2.13k, False: 28.3k]
  ------------------
  648|  2.13k|    setMediaStream(size);
  649|       |
  650|  28.3k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 387, False: 27.9k]
  ------------------
  651|    387|    movieHeaderDecoder(size);
  652|       |
  653|  27.9k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 859, False: 27.0k]
  ------------------
  654|    859|    trackHeaderDecoder(size);
  655|       |
  656|  27.0k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 781, False: 26.3k]
  ------------------
  657|    781|    mediaHeaderDecoder(size);
  658|       |
  659|  26.3k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 1.43k, False: 24.8k]
  ------------------
  660|  1.43k|    handlerDecoder(size);
  661|       |
  662|  24.8k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 3.13k, False: 21.7k]
  ------------------
  663|  3.13k|    videoHeaderDecoder(size);
  664|       |
  665|  21.7k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 4.67k, False: 17.0k]
  ------------------
  666|  4.67k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  17.0k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 2.22k, False: 14.8k]
  ------------------
  669|  2.22k|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  14.8k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 1.29k, False: 13.5k]
  ------------------
  672|  1.29k|    sampleDesc(size);
  673|       |
  674|  13.5k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 764, False: 12.7k]
  ------------------
  675|    764|    timeToSampleDecoder();
  676|       |
  677|  12.7k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 288, False: 12.4k]
  ------------------
  678|    288|    previewTagDecoder(size);
  679|       |
  680|  12.4k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 1.25k, False: 11.2k]
  ------------------
  681|  1.25k|    trackApertureTagDecoder(size);
  682|       |
  683|  11.2k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 233, False: 10.9k]
  ------------------
  684|    233|    keysTagDecoder(size);
  685|       |
  686|  10.9k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 547, False: 10.4k]
  ------------------
  687|    547|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 173, False: 374]
  ------------------
  688|    173|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    374|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 81, False: 293]
  ------------------
  690|     81|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|    293|    else
  692|    293|      discard(size);
  693|    547|  }
  694|       |
  695|  10.4k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 612, False: 9.83k]
  ------------------
  696|    612|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 272, False: 340]
  ------------------
  697|    272|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    340|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 125, False: 215]
  ------------------
  699|    125|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|    215|    else
  701|    215|      discard(size);
  702|    612|  }
  703|       |
  704|  9.83k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 65, False: 9.77k]
  ------------------
  705|     65|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|     65|  }
  707|       |
  708|  9.77k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 39, False: 9.73k]
  ------------------
  709|     39|    io_->readOrThrow(buf.data(), 4);
  710|     39|    io_->readOrThrow(buf.data(), 4);
  711|     39|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|     39|  }
  713|       |
  714|  9.73k|  else {
  715|  9.73k|    discard(size);
  716|  9.73k|  }
  717|  45.2k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  11.8k|void QuickTimeVideo::discard(size_t size) {
  720|  11.8k|  size_t cur_pos = io_->tell();
  721|  11.8k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  11.8k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|    288|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|    288|  DataBuf buf(4);
  726|    288|  size_t cur_pos = io_->tell();
  727|    288|  io_->readOrThrow(buf.data(), 4);
  728|    288|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|    288|  io_->readOrThrow(buf.data(), 2);
  730|    288|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|    288|  io_->readOrThrow(buf.data(), 4);
  733|    288|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 6, False: 282]
  ------------------
  734|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|    282|  else
  736|    282|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|    288|  io_->seek(cur_pos + size, BasicIo::beg);
  739|    288|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|    233|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|    233|  DataBuf buf(4);
  743|    233|  size_t cur_pos = io_->tell();
  744|    233|  io_->readOrThrow(buf.data(), 4);
  745|    233|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|    233|  io_->readOrThrow(buf.data(), 2);
  747|    233|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|    233|  io_->readOrThrow(buf.data(), 4);
  750|    233|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 18, False: 215]
  ------------------
  751|     18|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    215|  else
  753|    215|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|    233|  io_->seek(cur_pos + size, BasicIo::beg);
  756|    233|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|  1.25k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|  1.25k|  DataBuf buf(4);
  760|  1.25k|  DataBuf buf2(2);
  761|  1.25k|  size_t cur_pos = io_->tell();
  762|  1.25k|  byte n = 3;
  763|       |
  764|  4.99k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 3.74k, False: 1.25k]
  ------------------
  765|  3.74k|    io_->seek(4L, BasicIo::cur);
  766|  3.74k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  3.74k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 220, False: 3.52k]
  ------------------
  769|    220|      io_->seek(4L, BasicIo::cur);
  770|    220|      io_->readOrThrow(buf.data(), 2);
  771|    220|      io_->readOrThrow(buf2.data(), 2);
  772|    220|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|    220|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    220|#define stringFormat std::format
  ------------------
  774|    220|      io_->readOrThrow(buf.data(), 2);
  775|    220|      io_->readOrThrow(buf2.data(), 2);
  776|    220|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|    220|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    220|#define stringFormat std::format
  ------------------
  778|    220|    }
  779|       |
  780|  3.52k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 126, False: 3.40k]
  ------------------
  781|    126|      io_->seek(4L, BasicIo::cur);
  782|    126|      io_->readOrThrow(buf.data(), 2);
  783|    126|      io_->readOrThrow(buf2.data(), 2);
  784|    126|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|    126|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    126|#define stringFormat std::format
  ------------------
  786|    126|      io_->readOrThrow(buf.data(), 2);
  787|    126|      io_->readOrThrow(buf2.data(), 2);
  788|    126|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|    126|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    126|#define stringFormat std::format
  ------------------
  790|    126|    }
  791|       |
  792|  3.40k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 5, False: 3.39k]
  ------------------
  793|      5|      io_->seek(4L, BasicIo::cur);
  794|      5|      io_->readOrThrow(buf.data(), 2);
  795|      5|      io_->readOrThrow(buf2.data(), 2);
  796|      5|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|      5|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|      5|#define stringFormat std::format
  ------------------
  798|      5|      io_->readOrThrow(buf.data(), 2);
  799|      5|      io_->readOrThrow(buf2.data(), 2);
  800|      5|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|      5|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|      5|#define stringFormat std::format
  ------------------
  802|      5|    }
  803|  3.74k|  }
  804|  1.25k|  io_->seek(cur_pos + size, BasicIo::beg);
  805|  1.25k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|    501|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|    501|  size_t cur_pos = io_->tell();
  809|    501|  DataBuf buf(50);
  810|    501|  DataBuf buf2(4);
  811|       |
  812|    501|  io_->readOrThrow(buf.data(), 4);
  813|    501|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 406, False: 95]
  ------------------
  814|    406|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|    406|    io_->readOrThrow(buf.data(), 24);
  817|    406|    xmpData_["Xmp.video.Make"] = buf.data();
  818|    406|    io_->readOrThrow(buf.data(), 14);
  819|    406|    xmpData_["Xmp.video.Model"] = buf.data();
  820|    406|    io_->readOrThrow(buf.data(), 4);
  821|    406|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|    406|#define stringFormat std::format
  ------------------
  822|    406|    io_->readOrThrow(buf.data(), 4);
  823|    406|    io_->readOrThrow(buf2.data(), 4);
  824|    406|    xmpData_["Xmp.video.FNumber"] =
  825|    406|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|    406|    io_->readOrThrow(buf.data(), 4);
  827|    406|    io_->readOrThrow(buf2.data(), 4);
  828|    406|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|    406|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|    406|    io_->readOrThrow(buf.data(), 10);
  831|    406|    io_->readOrThrow(buf.data(), 4);
  832|    406|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 86, False: 320]
  ------------------
  833|     86|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|     86|#define _(String) (String)
  ------------------
  834|    406|    io_->readOrThrow(buf.data(), 4);
  835|    406|    io_->readOrThrow(buf2.data(), 4);
  836|    406|    xmpData_["Xmp.video.FocalLength"] =
  837|    406|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|    406|    io_->seek(95L, BasicIo::cur);
  839|    406|    io_->readOrThrow(buf.data(), 48);
  840|    406|    buf.write_uint8(48, 0);
  841|    406|    xmpData_["Xmp.video.Software"] = buf.data();
  842|    406|    io_->readOrThrow(buf.data(), 4);
  843|    406|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|    406|  }
  845|       |
  846|    501|  io_->seek(cur_pos + size, BasicIo::beg);
  847|    501|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|  4.70k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|  4.70k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|  4.70k|  const size_t start_pos = io_->tell();
  852|  4.70k|  const TagVocabulary* td;
  853|  4.70k|  const TagVocabulary* tv;
  854|  4.70k|  const TagVocabulary* tv_internal;
  855|       |
  856|  4.70k|  const long bufMinSize = 100;
  857|  4.70k|  DataBuf buf(bufMinSize);
  858|  4.70k|  size_t size_internal = outer_size;
  859|  4.70k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  8.84k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 6.17k, False: 2.66k]
  |  Branch (861:38): [True: 6.17k, False: 0]
  ------------------
  862|  6.17k|    const size_t loop_start_pos = io_->tell();
  863|  6.17k|    buf.data()[4] = '\0';
  864|  6.17k|    io_->readOrThrow(buf.data(), 4);
  865|  6.17k|    const size_t size = buf.read_uint32(0, bigEndian);
  866|  6.17k|    if (size > size_internal)
  ------------------
  |  Branch (866:9): [True: 1.98k, False: 4.19k]
  ------------------
  867|  1.98k|      break;
  868|  4.19k|    size_internal -= size;
  869|  4.19k|    io_->readOrThrow(buf.data(), 4);
  870|       |
  871|  4.19k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (871:9): [True: 18, False: 4.17k]
  ------------------
  872|     18|      buf.data()[0] = ' ';
  873|  4.19k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  874|       |
  875|  4.19k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  876|       |
  877|  4.19k|    if (size <= 12)
  ------------------
  |  Branch (877:9): [True: 52, False: 4.14k]
  ------------------
  878|     52|      break;
  879|       |
  880|  4.14k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (880:9): [True: 18, False: 4.12k]
  |  Branch (880:40): [True: 10, False: 4.11k]
  ------------------
  881|     28|      userDataDecoder(size - 8, recursion_depth + 1);
  882|       |
  883|  4.11k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (883:14): [True: 1.25k, False: 2.86k]
  ------------------
  884|  1.25k|      NikonTagsDecoder(size - 8);
  885|       |
  886|  2.86k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (886:14): [True: 501, False: 2.36k]
  ------------------
  887|    501|      CameraTagsDecoder(size - 8);
  888|       |
  889|  2.36k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (889:14): [True: 10, False: 2.35k]
  |  Branch (889:45): [True: 42, False: 2.31k]
  |  Branch (889:76): [True: 104, False: 2.20k]
  ------------------
  890|  2.20k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (890:14): [True: 53, False: 2.15k]
  |  Branch (890:45): [True: 35, False: 2.12k]
  ------------------
  891|    244|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  892|    244|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    244|#define _(String) (String)
  ------------------
  893|    244|    }
  894|       |
  895|  2.12k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (895:14): [True: 93, False: 2.02k]
  |  Branch (895:45): [True: 0, False: 2.02k]
  ------------------
  896|     93|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  897|     93|      io_->readOrThrow(buf.data(), 2);
  898|     93|      buf.data()[2] = '\0';
  899|     93|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  900|       |
  901|     93|      if (tv_internal)
  ------------------
  |  Branch (901:11): [True: 68, False: 25]
  ------------------
  902|     68|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     68|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     68|#define _(String) (String)
  ------------------
  903|     25|      else
  904|     25|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     25|#define _(String) (String)
  ------------------
  905|     93|    }
  906|       |
  907|  2.02k|    else if (tv) {
  ------------------
  |  Branch (907:14): [True: 74, False: 1.95k]
  ------------------
  908|     74|      io_->readOrThrow(buf.data(), 4);
  909|     74|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|     74|#define _(String) (String)
  ------------------
  910|     74|    }
  911|       |
  912|  1.95k|    else if (td)
  ------------------
  |  Branch (912:14): [True: 1.32k, False: 632]
  ------------------
  913|  1.32k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  914|       |
  915|  4.14k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  916|  4.14k|  }
  917|       |
  918|  4.70k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  919|  4.70k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  921|  1.25k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  922|  1.25k|  size_t cur_pos = io_->tell();
  923|  1.25k|  DataBuf buf(201);
  924|  1.25k|  DataBuf buf2(4 + 1);
  925|  1.25k|  uint32_t TagID = 0;
  926|  1.25k|  uint16_t dataLength = 0;
  927|  1.25k|  uint16_t dataType = 2;
  928|  1.25k|  const TagDetails* td;
  929|  1.25k|  const TagDetails* td2;
  930|       |
  931|  52.7k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (931:19): [True: 51.5k, False: 1.25k]
  ------------------
  932|  51.5k|    io_->readOrThrow(buf.data(), 4);
  933|  51.5k|    TagID = buf.read_uint32(0, bigEndian);
  934|  51.5k|    td = Exiv2::find(NikonNCTGTags, TagID);
  935|       |
  936|  51.5k|    io_->readOrThrow(buf.data(), 2);
  937|  51.5k|    dataType = buf.read_uint16(0, bigEndian);
  938|       |
  939|  51.5k|    std::memset(buf.data(), 0x0, buf.size());
  940|  51.5k|    io_->readOrThrow(buf.data(), 2);
  941|       |
  942|  51.5k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (942:9): [True: 2.86k, False: 48.6k]
  ------------------
  943|  2.86k|      size_t local_pos = io_->tell();
  944|  2.86k|      dataLength = buf.read_uint16(0, bigEndian);
  945|  2.86k|      std::memset(buf.data(), 0x0, buf.size());
  946|       |
  947|  2.86k|      io_->readOrThrow(buf.data(), 4);
  948|  2.86k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  949|  2.86k|      io_->readOrThrow(buf.data(), 20);
  950|  2.86k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  951|  2.86k|      io_->readOrThrow(buf.data(), 20);
  952|  2.86k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  953|  2.86k|      io_->readOrThrow(buf.data(), 4);
  954|  2.86k|      std::memset(buf.data(), 0x0, buf.size());
  955|       |
  956|  2.86k|      io_->readOrThrow(buf.data(), 1);
  957|  2.86k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  958|  2.86k|      if (td2)
  ------------------
  |  Branch (958:11): [True: 2.04k, False: 829]
  ------------------
  959|  2.04k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.04k|#define _(String) (String)
  ------------------
  960|    829|      else
  961|    829|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  962|       |
  963|  2.86k|      io_->readOrThrow(buf.data(), 1);
  964|  2.86k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  965|  2.86k|      if (td2)
  ------------------
  |  Branch (965:11): [True: 2.06k, False: 802]
  ------------------
  966|  2.06k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.06k|#define _(String) (String)
  ------------------
  967|       |
  968|  2.86k|      io_->readOrThrow(buf.data(), 1);
  969|  2.86k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  970|  2.86k|      if (td2)
  ------------------
  |  Branch (970:11): [True: 2.14k, False: 720]
  ------------------
  971|  2.14k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  2.14k|#define _(String) (String)
  ------------------
  972|    720|      else
  973|    720|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  974|       |
  975|  2.86k|      io_->readOrThrow(buf.data(), 1);
  976|  2.86k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  977|  2.86k|      if (td2)
  ------------------
  |  Branch (977:11): [True: 2.02k, False: 844]
  ------------------
  978|  2.02k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  2.02k|#define _(String) (String)
  ------------------
  979|    844|      else
  980|    844|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  981|       |
  982|  2.86k|      io_->readOrThrow(buf.data(), 1);
  983|  2.86k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  984|  2.86k|      if (td2)
  ------------------
  |  Branch (984:11): [True: 2.01k, False: 856]
  ------------------
  985|  2.01k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  2.01k|#define _(String) (String)
  ------------------
  986|    856|      else
  987|    856|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  988|       |
  989|  2.86k|      io_->readOrThrow(buf.data(), 1);
  990|  2.86k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  991|  2.86k|      if (td2)
  ------------------
  |  Branch (991:11): [True: 1.99k, False: 876]
  ------------------
  992|  1.99k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  1.99k|#define _(String) (String)
  ------------------
  993|    876|      else
  994|    876|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  2.86k|      io_->readOrThrow(buf.data(), 1);
  997|  2.86k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  998|       |
  999|  2.86k|      io_->readOrThrow(buf.data(), 1);
 1000|  2.86k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
 1001|  2.86k|      if (td2)
  ------------------
  |  Branch (1001:11): [True: 461, False: 2.40k]
  ------------------
 1002|    461|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    461|#define _(String) (String)
  ------------------
 1003|  2.40k|      else
 1004|  2.40k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1005|       |
 1006|  2.86k|      io_->readOrThrow(buf.data(), 1);
 1007|  2.86k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1008|  2.86k|      if (td2)
  ------------------
  |  Branch (1008:11): [True: 862, False: 2.00k]
  ------------------
 1009|    862|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|    862|#define _(String) (String)
  ------------------
 1010|  2.00k|      else
 1011|  2.00k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  2.86k|      io_->readOrThrow(buf.data(), 1);
 1014|  2.86k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1015|       |
 1016|  2.86k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1017|  2.86k|    }
 1018|       |
 1019|  48.6k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1019:14): [True: 431, False: 48.2k]
  ------------------
 1020|    431|      size_t local_pos = io_->tell();
 1021|    431|      dataLength = buf.read_uint16(0, bigEndian);
 1022|    431|      std::memset(buf.data(), 0x0, buf.size());
 1023|       |
 1024|    431|      io_->readOrThrow(buf.data(), 2);
 1025|    431|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1026|    431|      io_->readOrThrow(buf.data(), 1);
 1027|    431|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1028|    431|      if (td2)
  ------------------
  |  Branch (1028:11): [True: 366, False: 65]
  ------------------
 1029|    366|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    366|#define _(String) (String)
  ------------------
 1030|       |
 1031|    431|      io_->readOrThrow(buf.data(), 1);
 1032|    431|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1033|    431|      if (td2)
  ------------------
  |  Branch (1033:11): [True: 115, False: 316]
  ------------------
 1034|    115|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    115|#define _(String) (String)
  ------------------
 1035|       |
 1036|    431|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1037|    431|    }
 1038|       |
 1039|  48.2k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1039:14): [True: 1.77k, False: 46.4k]
  |  Branch (1039:31): [True: 263, False: 46.1k]
  ------------------
 1040|  1.31k|      dataLength = buf.read_uint16(0, bigEndian);
 1041|  1.31k|      std::memset(buf.data(), 0x0, buf.size());
 1042|       |
 1043|       |      // Sanity check with an "unreasonably" large number
 1044|  1.31k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1044:11): [True: 328, False: 985]
  ------------------
 1045|    328|#ifndef SUPPRESS_WARNINGS
 1046|    328|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    328|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 328]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    328|  LogMsg(LogMsg::error).os()
  ------------------
 1047|      0|                  << " Entries considered invalid. Not Processed.\n";
 1048|    328|#endif
 1049|    328|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1050|    328|        buf.data()[0] = '\0';
 1051|    985|      } else {
 1052|    985|        io_->readOrThrow(buf.data(), dataLength);
 1053|    985|        buf.data()[dataLength] = '\0';
 1054|    985|      }
 1055|       |
 1056|  1.31k|      if (td) {
  ------------------
  |  Branch (1056:11): [True: 367, False: 946]
  ------------------
 1057|    367|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    367|#define _(String) (String)
  ------------------
 1058|    367|      }
 1059|  46.9k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1059:16): [True: 520, False: 46.3k]
  ------------------
 1060|    520|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1061|    520|      std::memset(buf.data(), 0x0, buf.size());
 1062|    520|      io_->readOrThrow(buf.data(), 4);
 1063|    520|      if (td)
  ------------------
  |  Branch (1063:11): [True: 189, False: 331]
  ------------------
 1064|    189|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    189|#define _(String) (String)
  ------------------
 1065|       |
 1066|       |      // Sanity check with an "unreasonably" large number
 1067|    520|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1067:11): [True: 331, False: 189]
  |  Branch (1067:31): [True: 99, False: 90]
  ------------------
 1068|    427|#ifndef SUPPRESS_WARNINGS
 1069|    427|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    427|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 427]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    427|  LogMsg(LogMsg::error).os()
  ------------------
 1070|      0|                  << " Entries considered invalid. Not Processed.\n";
 1071|    427|#endif
 1072|    427|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1073|    427|      } else
 1074|     93|        io_->readOrThrow(buf.data(), dataLength - 4);
 1075|  46.3k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1075:16): [True: 843, False: 45.5k]
  ------------------
 1076|    843|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1077|    843|      std::memset(buf.data(), 0x0, buf.size());
 1078|    843|      io_->readOrThrow(buf.data(), 2);
 1079|    843|      if (td)
  ------------------
  |  Branch (1079:11): [True: 193, False: 650]
  ------------------
 1080|    193|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    193|#define _(String) (String)
  ------------------
 1081|       |
 1082|       |      // Sanity check with an "unreasonably" large number
 1083|    843|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1083:11): [True: 341, False: 502]
  |  Branch (1083:31): [True: 349, False: 153]
  ------------------
 1084|    689|#ifndef SUPPRESS_WARNINGS
 1085|    689|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    689|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 689]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    689|  LogMsg(LogMsg::error).os()
  ------------------
 1086|      0|                  << " Entries considered invalid. Not Processed.\n";
 1087|    689|#endif
 1088|    689|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1089|    689|      } else
 1090|    154|        io_->readOrThrow(buf.data(), dataLength - 2);
 1091|  45.5k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1091:16): [True: 605, False: 44.9k]
  ------------------
 1092|    605|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1093|    605|      std::memset(buf.data(), 0x0, buf.size());
 1094|    605|      io_->readOrThrow(buf.data(), 4);
 1095|    605|      io_->readOrThrow(buf2.data(), 4);
 1096|    605|      if (td)
  ------------------
  |  Branch (1096:11): [True: 391, False: 214]
  ------------------
 1097|    391|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    391|#define _(String) (String)
  ------------------
 1098|    391|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1099|       |
 1100|       |      // Sanity check with an "unreasonably" large number
 1101|    605|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1101:11): [True: 283, False: 322]
  |  Branch (1101:31): [True: 99, False: 223]
  ------------------
 1102|    381|#ifndef SUPPRESS_WARNINGS
 1103|    381|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    381|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 381]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    381|  LogMsg(LogMsg::error).os()
  ------------------
 1104|      0|                  << " Entries considered invalid. Not Processed.\n";
 1105|    381|#endif
 1106|    381|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1107|    381|      } else
 1108|    224|        io_->readOrThrow(buf.data(), dataLength - 8);
 1109|  44.9k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1109:16): [True: 487, False: 44.4k]
  ------------------
 1110|    487|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1111|    487|      std::memset(buf.data(), 0x0, buf.size());
 1112|    487|      io_->readOrThrow(buf.data(), 2);
 1113|    487|      io_->readOrThrow(buf2.data(), 2);
 1114|    487|      if (td)
  ------------------
  |  Branch (1114:11): [True: 175, False: 312]
  ------------------
 1115|    175|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    175|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    175|#define stringFormat std::format
  ------------------
 1116|       |
 1117|       |      // Sanity check with an "unreasonably" large number
 1118|    487|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1118:11): [True: 261, False: 226]
  |  Branch (1118:31): [True: 130, False: 96]
  ------------------
 1119|    390|#ifndef SUPPRESS_WARNINGS
 1120|    390|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    390|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 390]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    390|  LogMsg(LogMsg::error).os()
  ------------------
 1121|      0|                  << " Entries considered invalid. Not Processed.\n";
 1122|    390|#endif
 1123|    390|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1124|    390|      } else
 1125|     97|        io_->readOrThrow(buf.data(), dataLength - 4);
 1126|    487|    }
 1127|  51.5k|  }
 1128|       |
 1129|  1.25k|  io_->seek(cur_pos + size, BasicIo::beg);
 1130|  1.25k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1132|  2.13k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1133|  2.13k|  size_t current_position = io_->tell();
 1134|  2.13k|  size_t search_end = Safe::add(current_position, atom_size);
 1135|  2.13k|  if (search_end > io_->size())
  ------------------
  |  Branch (1135:7): [True: 0, False: 2.13k]
  ------------------
 1136|      0|    search_end = io_->size();
 1137|  2.13k|  DataBuf buf(4 + 1);
 1138|       |
 1139|  33.9k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1139:10): [True: 33.9k, False: 0]
  |  Branch (1139:25): [True: 33.0k, False: 878]
  ------------------
 1140|  33.0k|    io_->readOrThrow(buf.data(), 4);
 1141|  33.0k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1141:9): [True: 1.25k, False: 31.8k]
  ------------------
 1142|  1.25k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1142:11): [True: 95, False: 1.15k]
  ------------------
 1143|     95|        break;
 1144|  1.15k|      io_->readOrThrow(buf.data(), 4);
 1145|  1.15k|      io_->readOrThrow(buf.data(), 4);
 1146|  1.15k|      io_->readOrThrow(buf.data(), 4);
 1147|       |
 1148|  1.15k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1148:11): [True: 14, False: 1.14k]
  ------------------
 1149|     14|        currentStream_ = Video;
 1150|  1.14k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1150:16): [True: 520, False: 625]
  ------------------
 1151|    520|        currentStream_ = Audio;
 1152|    625|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1152:16): [True: 104, False: 521]
  ------------------
 1153|    104|        currentStream_ = Hint;
 1154|    521|      else
 1155|    521|        currentStream_ = GenMediaHeader;
 1156|  1.15k|      break;
 1157|  1.25k|    }
 1158|  33.0k|  }
 1159|       |
 1160|  2.13k|  io_->seek(current_position, BasicIo::beg);
 1161|  2.13k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1163|    764|void QuickTimeVideo::timeToSampleDecoder() {
 1164|    764|  DataBuf buf(4 + 1);
 1165|    764|  io_->readOrThrow(buf.data(), 4);
 1166|    764|  io_->readOrThrow(buf.data(), 4);
 1167|    764|  uint64_t totalframes = 0;
 1168|    764|  uint64_t timeOfFrames = 0;
 1169|    764|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1170|       |
 1171|  1.88k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1171:24): [True: 1.11k, False: 764]
  ------------------
 1172|  1.11k|    io_->readOrThrow(buf.data(), 4);
 1173|  1.11k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1174|  1.11k|    totalframes = Safe::add(totalframes, temp);
 1175|  1.11k|    io_->readOrThrow(buf.data(), 4);
 1176|  1.11k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1177|  1.11k|  }
 1178|    764|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1178:7): [True: 286, False: 478]
  ------------------
 1179|    286|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1179:9): [True: 31, False: 255]
  ------------------
 1180|     31|      timeOfFrames = 1;
 1181|    286|    xmpData_["Xmp.video.FrameRate"] =
 1182|    286|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1183|    286|  }
 1184|    764|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1186|  1.29k|void QuickTimeVideo::sampleDesc(size_t size) {
 1187|  1.29k|  DataBuf buf(100);
 1188|  1.29k|  size_t cur_pos = io_->tell();
 1189|  1.29k|  io_->readOrThrow(buf.data(), 4);
 1190|  1.29k|  io_->readOrThrow(buf.data(), 4);
 1191|  1.29k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1192|       |
 1193|  90.8k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1193:24): [True: 89.8k, False: 1.02k]
  ------------------
 1194|  89.8k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1194:9): [True: 46.6k, False: 43.2k]
  ------------------
 1195|  46.6k|      imageDescDecoder();
 1196|  43.2k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1196:14): [True: 42.9k, False: 271]
  ------------------
 1197|  42.9k|      audioDescDecoder();
 1198|    271|    else
 1199|    271|      break;
 1200|  89.8k|  }
 1201|  1.29k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1202|  1.29k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1204|  42.9k|void QuickTimeVideo::audioDescDecoder() {
 1205|  42.9k|  DataBuf buf(40);
 1206|  42.9k|  std::memset(buf.data(), 0x0, buf.size());
 1207|  42.9k|  buf.data()[4] = '\0';
 1208|  42.9k|  io_->readOrThrow(buf.data(), 4);
 1209|  42.9k|  size_t size = 82;
 1210|       |
 1211|  42.9k|  const TagVocabulary* td;
 1212|       |
 1213|   901k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1213:19): [True: 858k, False: 42.9k]
  ------------------
 1214|   858k|    io_->readOrThrow(buf.data(), 4);
 1215|   858k|    switch (i) {
 1216|  42.9k|      case AudioFormat:
  ------------------
  |  Branch (1216:7): [True: 42.9k, False: 815k]
  ------------------
 1217|  42.9k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1218|  42.9k|        if (td)
  ------------------
  |  Branch (1218:13): [True: 383, False: 42.5k]
  ------------------
 1219|    383|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    383|#define _(String) (String)
  ------------------
 1220|  42.5k|        else
 1221|  42.5k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1222|  42.9k|        break;
 1223|  42.9k|      case AudioVendorID:
  ------------------
  |  Branch (1223:7): [True: 42.9k, False: 815k]
  ------------------
 1224|  42.9k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1225|  42.9k|        if (td)
  ------------------
  |  Branch (1225:13): [True: 1.48k, False: 41.4k]
  ------------------
 1226|  1.48k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.48k|#define _(String) (String)
  ------------------
 1227|  42.9k|        break;
 1228|  42.9k|      case AudioChannels:
  ------------------
  |  Branch (1228:7): [True: 42.9k, False: 815k]
  ------------------
 1229|  42.9k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1230|  42.9k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1231|  42.9k|        break;
 1232|  42.9k|      case AudioSampleRate:
  ------------------
  |  Branch (1232:7): [True: 42.9k, False: 815k]
  ------------------
 1233|  42.9k|        xmpData_["Xmp.audio.SampleRate"] =
 1234|  42.9k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1235|  42.9k|        break;
 1236|   686k|      default:
  ------------------
  |  Branch (1236:7): [True: 686k, False: 171k]
  ------------------
 1237|   686k|        break;
 1238|   858k|    }
 1239|   858k|  }
 1240|  42.9k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1241|  42.9k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1243|  46.6k|void QuickTimeVideo::imageDescDecoder() {
 1244|  46.6k|  DataBuf buf(40);
 1245|  46.6k|  std::memset(buf.data(), 0x0, buf.size());
 1246|  46.6k|  buf.data()[4] = '\0';
 1247|  46.6k|  io_->readOrThrow(buf.data(), 4);
 1248|  46.6k|  size_t size = 82;
 1249|       |
 1250|  46.6k|  const TagVocabulary* td;
 1251|       |
 1252|   558k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1252:19): [True: 512k, False: 46.4k]
  ------------------
 1253|   512k|    io_->readOrThrow(buf.data(), 4);
 1254|       |
 1255|   512k|    switch (i) {
 1256|  46.5k|      case codec:
  ------------------
  |  Branch (1256:7): [True: 46.5k, False: 465k]
  ------------------
 1257|  46.5k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1258|  46.5k|        if (td)
  ------------------
  |  Branch (1258:13): [True: 1.58k, False: 44.9k]
  ------------------
 1259|  1.58k|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|  1.58k|#define _(String) (String)
  ------------------
 1260|  44.9k|        else
 1261|  44.9k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1262|  46.5k|        break;
 1263|  46.5k|      case VendorID:
  ------------------
  |  Branch (1263:7): [True: 46.5k, False: 465k]
  ------------------
 1264|  46.5k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1265|  46.5k|        if (td)
  ------------------
  |  Branch (1265:13): [True: 996, False: 45.5k]
  ------------------
 1266|    996|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    996|#define _(String) (String)
  ------------------
 1267|  46.5k|        break;
 1268|  46.5k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1268:7): [True: 46.5k, False: 465k]
  ------------------
 1269|  46.5k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1270|  46.5k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1271|  46.5k|        break;
 1272|  46.5k|      case XResolution:
  ------------------
  |  Branch (1272:7): [True: 46.5k, False: 465k]
  ------------------
 1273|  46.5k|        xmpData_["Xmp.video.XResolution"] =
 1274|  46.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1275|  46.5k|        break;
 1276|  46.5k|      case YResolution:
  ------------------
  |  Branch (1276:7): [True: 46.5k, False: 465k]
  ------------------
 1277|  46.5k|        xmpData_["Xmp.video.YResolution"] =
 1278|  46.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1279|  46.5k|        io_->readOrThrow(buf.data(), 3);
 1280|  46.5k|        size -= 3;
 1281|  46.5k|        break;
 1282|  46.5k|      case CompressorName:
  ------------------
  |  Branch (1282:7): [True: 46.5k, False: 465k]
  ------------------
 1283|  46.5k|        io_->readOrThrow(buf.data(), 32);
 1284|  46.5k|        size -= 32;
 1285|  46.5k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1286|  46.5k|        break;
 1287|   232k|      default:
  ------------------
  |  Branch (1287:7): [True: 232k, False: 279k]
  ------------------
 1288|   232k|        break;
 1289|   512k|    }
 1290|   512k|  }
 1291|  46.4k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1292|  46.4k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1293|  46.4k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1295|  2.22k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1296|  2.22k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1297|  2.22k|  DataBuf buf(4 + 1);
 1298|  2.22k|  io_->readOrThrow(buf.data(), 4);
 1299|  2.22k|  io_->readOrThrow(buf.data(), 4);
 1300|  2.22k|  uint32_t noOfEntries;
 1301|       |
 1302|  2.22k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1303|       |
 1304|  7.12k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1304:24): [True: 4.99k, False: 2.13k]
  |  Branch (1304:43): [True: 4.89k, False: 95]
  ------------------
 1305|  4.89k|    decodeBlock(recursion_depth + 1);
 1306|  4.89k|  }
 1307|  2.22k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1309|  3.13k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1310|  3.13k|  DataBuf buf(3);
 1311|  3.13k|  std::memset(buf.data(), 0x0, buf.size());
 1312|  3.13k|  buf.data()[2] = '\0';
 1313|  3.13k|  currentStream_ = Video;
 1314|       |
 1315|  3.13k|  const TagDetails* td;
 1316|       |
 1317|  21.0k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1317:19): [True: 17.8k, False: 3.13k]
  ------------------
 1318|  17.8k|    io_->readOrThrow(buf.data(), 2);
 1319|       |
 1320|  17.8k|    switch (i) {
 1321|  3.09k|      case GraphicsMode:
  ------------------
  |  Branch (1321:7): [True: 3.09k, False: 14.7k]
  ------------------
 1322|  3.09k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1323|  3.09k|        if (td)
  ------------------
  |  Branch (1323:13): [True: 2.46k, False: 634]
  ------------------
 1324|  2.46k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.46k|#define _(String) (String)
  ------------------
 1325|  3.09k|        break;
 1326|  1.71k|      case OpColor:
  ------------------
  |  Branch (1326:7): [True: 1.71k, False: 16.1k]
  ------------------
 1327|  1.71k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1328|  1.71k|        break;
 1329|  13.0k|      default:
  ------------------
  |  Branch (1329:7): [True: 13.0k, False: 4.81k]
  ------------------
 1330|  13.0k|        break;
 1331|  17.8k|    }
 1332|  17.8k|  }
 1333|  3.13k|  io_->readOrThrow(buf.data(), size % 2);
 1334|  3.13k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1336|  1.43k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1337|  1.43k|  size_t cur_pos = io_->tell();
 1338|  1.43k|  DataBuf buf(100);
 1339|  1.43k|  std::memset(buf.data(), 0x0, buf.size());
 1340|  1.43k|  buf.data()[4] = '\0';
 1341|       |
 1342|  1.43k|  const TagVocabulary* tv;
 1343|       |
 1344|  8.59k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1344:19): [True: 7.17k, False: 1.42k]
  ------------------
 1345|  7.17k|    io_->readOrThrow(buf.data(), 4);
 1346|       |
 1347|  7.17k|    switch (i) {
  ------------------
  |  Branch (1347:13): [True: 4.30k, False: 2.87k]
  ------------------
 1348|  1.43k|      case HandlerClass:
  ------------------
  |  Branch (1348:7): [True: 1.43k, False: 5.74k]
  ------------------
 1349|  1.43k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1350|  1.43k|        if (tv) {
  ------------------
  |  Branch (1350:13): [True: 209, False: 1.22k]
  ------------------
 1351|    209|          if (currentStream_ == Video)
  ------------------
  |  Branch (1351:15): [True: 66, False: 143]
  ------------------
 1352|     66|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     66|#define _(String) (String)
  ------------------
 1353|    143|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1353:20): [True: 10, False: 133]
  ------------------
 1354|     10|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     10|#define _(String) (String)
  ------------------
 1355|    209|        }
 1356|  1.43k|        break;
 1357|  1.43k|      case HandlerType:
  ------------------
  |  Branch (1357:7): [True: 1.43k, False: 5.74k]
  ------------------
 1358|  1.43k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1359|  1.43k|        if (tv) {
  ------------------
  |  Branch (1359:13): [True: 1.09k, False: 339]
  ------------------
 1360|  1.09k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1360:15): [True: 70, False: 1.02k]
  ------------------
 1361|     70|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|     70|#define _(String) (String)
  ------------------
 1362|  1.02k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1362:20): [True: 89, False: 937]
  ------------------
 1363|     89|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|     89|#define _(String) (String)
  ------------------
 1364|  1.09k|        }
 1365|  1.43k|        break;
 1366|  1.43k|      case HandlerVendorID:
  ------------------
  |  Branch (1366:7): [True: 1.43k, False: 5.74k]
  ------------------
 1367|  1.43k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1368|  1.43k|        if (tv) {
  ------------------
  |  Branch (1368:13): [True: 689, False: 744]
  ------------------
 1369|    689|          if (currentStream_ == Video)
  ------------------
  |  Branch (1369:15): [True: 58, False: 631]
  ------------------
 1370|     58|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|     58|#define _(String) (String)
  ------------------
 1371|    631|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1371:20): [True: 98, False: 533]
  ------------------
 1372|     98|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|     98|#define _(String) (String)
  ------------------
 1373|    689|        }
 1374|  1.43k|        break;
 1375|  7.17k|    }
 1376|  7.17k|  }
 1377|  1.42k|  io_->seek(cur_pos + size, BasicIo::beg);
 1378|  1.42k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1380|  8.22k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1381|  8.22k|  DataBuf buf(5);
 1382|  8.22k|  std::memset(buf.data(), 0x0, buf.size());
 1383|  8.22k|  buf.data()[4] = '\0';
 1384|  8.22k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1385|  8.22k|  const TagVocabulary* td;
 1386|       |
 1387|   388k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1387:19): [True: 380k, False: 8.22k]
  ------------------
 1388|   380k|    io_->readOrThrow(buf.data(), 4);
 1389|   380k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1390|       |
 1391|   380k|    switch (i) {
 1392|  7.29k|      case 0:
  ------------------
  |  Branch (1392:7): [True: 7.29k, False: 373k]
  ------------------
 1393|  7.29k|        if (td)
  ------------------
  |  Branch (1393:13): [True: 6.78k, False: 506]
  ------------------
 1394|  6.78k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  6.78k|#define _(String) (String)
  ------------------
 1395|  7.29k|        break;
 1396|  1.43k|      case 1:
  ------------------
  |  Branch (1396:7): [True: 1.43k, False: 379k]
  ------------------
 1397|  1.43k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1398|  1.43k|        break;
 1399|   371k|      default:
  ------------------
  |  Branch (1399:7): [True: 371k, False: 8.72k]
  ------------------
 1400|   371k|        if (td)
  ------------------
  |  Branch (1400:13): [True: 1.06k, False: 370k]
  ------------------
 1401|  1.06k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.06k|#define _(String) (String)
  ------------------
 1402|   370k|        else
 1403|   370k|          v->read(Exiv2::toString(buf.data()));
 1404|   371k|        break;
 1405|   380k|    }
 1406|   380k|  }
 1407|  8.22k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1408|  8.22k|  io_->readOrThrow(buf.data(), size % 4);
 1409|  8.22k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1411|    781|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1412|    781|  DataBuf buf(5);
 1413|    781|  std::memset(buf.data(), 0x0, buf.size());
 1414|    781|  buf.data()[4] = '\0';
 1415|    781|  int64_t time_scale = 1;
 1416|       |
 1417|  5.58k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1417:19): [True: 4.80k, False: 781]
  ------------------
 1418|  4.80k|    io_->readOrThrow(buf.data(), 4);
 1419|       |
 1420|  4.80k|    switch (i) {
 1421|    768|      case MediaHeaderVersion:
  ------------------
  |  Branch (1421:7): [True: 768, False: 4.03k]
  ------------------
 1422|    768|        if (currentStream_ == Video)
  ------------------
  |  Branch (1422:13): [True: 269, False: 499]
  ------------------
 1423|    269|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    499|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1424:18): [True: 283, False: 216]
  ------------------
 1425|    283|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1426|    768|        break;
 1427|    475|      case MediaCreateDate:
  ------------------
  |  Branch (1427:7): [True: 475, False: 4.33k]
  ------------------
 1428|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1429|    475|        if (currentStream_ == Video)
  ------------------
  |  Branch (1429:13): [True: 124, False: 351]
  ------------------
 1430|    124|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    351|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1431:18): [True: 268, False: 83]
  ------------------
 1432|    268|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1433|    475|        break;
 1434|    473|      case MediaModifyDate:
  ------------------
  |  Branch (1434:7): [True: 473, False: 4.33k]
  ------------------
 1435|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1436|    473|        if (currentStream_ == Video)
  ------------------
  |  Branch (1436:13): [True: 123, False: 350]
  ------------------
 1437|    123|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    350|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1438:18): [True: 268, False: 82]
  ------------------
 1439|    268|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1440|    473|        break;
 1441|    472|      case MediaTimeScale:
  ------------------
  |  Branch (1441:7): [True: 472, False: 4.33k]
  ------------------
 1442|    472|        if (currentStream_ == Video)
  ------------------
  |  Branch (1442:13): [True: 122, False: 350]
  ------------------
 1443|    122|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    350|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1444:18): [True: 268, False: 82]
  ------------------
 1445|    268|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1446|    472|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1447|    472|        mdhdTimeScale_ = time_scale;
 1448|    472|        break;
 1449|    469|      case MediaDuration:
  ------------------
  |  Branch (1449:7): [True: 469, False: 4.33k]
  ------------------
 1450|    469|        if (currentStream_ == Video)
  ------------------
  |  Branch (1450:13): [True: 121, False: 348]
  ------------------
 1451|    121|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 121, False: 0]
  ------------------
 1452|    348|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1452:18): [True: 268, False: 80]
  ------------------
 1453|    268|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1453:49): [True: 268, False: 0]
  ------------------
 1454|    469|        break;
 1455|    469|      case MediaLanguageCode:
  ------------------
  |  Branch (1455:7): [True: 469, False: 4.33k]
  ------------------
 1456|    469|        if (currentStream_ == Video)
  ------------------
  |  Branch (1456:13): [True: 121, False: 348]
  ------------------
 1457|    121|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    348|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1458:18): [True: 268, False: 80]
  ------------------
 1459|    268|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1460|    469|        break;
 1461|       |
 1462|  1.68k|      default:
  ------------------
  |  Branch (1462:7): [True: 1.68k, False: 3.12k]
  ------------------
 1463|  1.68k|        break;
 1464|  4.80k|    }
 1465|  4.80k|  }
 1466|    781|  io_->readOrThrow(buf.data(), size % 4);
 1467|    781|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1469|    859|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1470|    859|  DataBuf buf(5);
 1471|    859|  std::memset(buf.data(), 0x0, buf.size());
 1472|    859|  buf.data()[4] = '\0';
 1473|    859|  int64_t temp = 0;
 1474|       |
 1475|  12.4k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1475:19): [True: 11.6k, False: 859]
  ------------------
 1476|  11.6k|    io_->readOrThrow(buf.data(), 4);
 1477|       |
 1478|  11.6k|    switch (i) {
 1479|    556|      case TrackHeaderVersion:
  ------------------
  |  Branch (1479:7): [True: 556, False: 11.0k]
  ------------------
 1480|    556|        if (currentStream_ == Video)
  ------------------
  |  Branch (1480:13): [True: 107, False: 449]
  ------------------
 1481|    107|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    449|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1482:18): [True: 20, False: 429]
  ------------------
 1483|     20|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1484|    556|        break;
 1485|    518|      case TrackCreateDate:
  ------------------
  |  Branch (1485:7): [True: 518, False: 11.1k]
  ------------------
 1486|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1487|    518|        if (currentStream_ == Video)
  ------------------
  |  Branch (1487:13): [True: 100, False: 418]
  ------------------
 1488|    100|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    418|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1489:18): [True: 20, False: 398]
  ------------------
 1490|     20|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1491|    518|        break;
 1492|    507|      case TrackModifyDate:
  ------------------
  |  Branch (1492:7): [True: 507, False: 11.1k]
  ------------------
 1493|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1494|    507|        if (currentStream_ == Video)
  ------------------
  |  Branch (1494:13): [True: 100, False: 407]
  ------------------
 1495|    100|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    407|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1496:18): [True: 19, False: 388]
  ------------------
 1497|     19|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1498|    507|        break;
 1499|    506|      case TrackID:
  ------------------
  |  Branch (1499:7): [True: 506, False: 11.1k]
  ------------------
 1500|    506|        if (currentStream_ == Video)
  ------------------
  |  Branch (1500:13): [True: 100, False: 406]
  ------------------
 1501|    100|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    406|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1502:18): [True: 19, False: 387]
  ------------------
 1503|     19|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1504|    506|        break;
 1505|    503|      case TrackDuration:
  ------------------
  |  Branch (1505:7): [True: 503, False: 11.1k]
  ------------------
 1506|    503|        if (currentStream_ == Video)
  ------------------
  |  Branch (1506:13): [True: 100, False: 403]
  ------------------
 1507|    100|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 100, False: 0]
  ------------------
 1508|    403|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1508:18): [True: 18, False: 385]
  ------------------
 1509|     18|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1509:49): [True: 18, False: 0]
  ------------------
 1510|    503|        break;
 1511|    500|      case TrackLayer:
  ------------------
  |  Branch (1511:7): [True: 500, False: 11.1k]
  ------------------
 1512|    500|        if (currentStream_ == Video)
  ------------------
  |  Branch (1512:13): [True: 100, False: 400]
  ------------------
 1513|    100|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    400|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1514:18): [True: 18, False: 382]
  ------------------
 1515|     18|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1516|    500|        break;
 1517|    499|      case TrackVolume:
  ------------------
  |  Branch (1517:7): [True: 499, False: 11.1k]
  ------------------
 1518|    499|        if (currentStream_ == Video)
  ------------------
  |  Branch (1518:13): [True: 100, False: 399]
  ------------------
 1519|    100|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    399|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1520:18): [True: 18, False: 381]
  ------------------
 1521|     18|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1522|    499|        break;
 1523|    463|      case ImageWidth:
  ------------------
  |  Branch (1523:7): [True: 463, False: 11.1k]
  ------------------
 1524|    463|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1524:13): [True: 66, False: 397]
  ------------------
 1525|     66|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1526|     66|          xmpData_["Xmp.video.Width"] = temp;
 1527|     66|          width_ = temp;
 1528|     66|        }
 1529|    463|        break;
 1530|    463|      case ImageHeight:
  ------------------
  |  Branch (1530:7): [True: 463, False: 11.1k]
  ------------------
 1531|    463|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1531:13): [True: 66, False: 397]
  ------------------
 1532|     66|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1533|     66|          xmpData_["Xmp.video.Height"] = temp;
 1534|     66|          height_ = temp;
 1535|     66|        }
 1536|    463|        break;
 1537|  7.12k|      default:
  ------------------
  |  Branch (1537:7): [True: 7.12k, False: 4.51k]
  ------------------
 1538|  7.12k|        break;
 1539|  11.6k|    }
 1540|  11.6k|  }
 1541|    859|  io_->readOrThrow(buf.data(), size % 4);
 1542|    859|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1544|    387|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1545|    387|  DataBuf buf(5);
 1546|    387|  std::memset(buf.data(), 0x0, buf.size());
 1547|    387|  buf.data()[4] = '\0';
 1548|       |
 1549|  1.93k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1549:19): [True: 1.54k, False: 387]
  ------------------
 1550|  1.54k|    io_->readOrThrow(buf.data(), 4);
 1551|       |
 1552|  1.54k|    switch (i) {
 1553|    150|      case MovieHeaderVersion:
  ------------------
  |  Branch (1553:7): [True: 150, False: 1.39k]
  ------------------
 1554|    150|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1555|    150|        break;
 1556|    142|      case CreateDate:
  ------------------
  |  Branch (1556:7): [True: 142, False: 1.40k]
  ------------------
 1557|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1558|    142|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1559|    142|        break;
 1560|    140|      case ModifyDate:
  ------------------
  |  Branch (1560:7): [True: 140, False: 1.40k]
  ------------------
 1561|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1562|    140|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1563|    140|        break;
 1564|    130|      case TimeScale:
  ------------------
  |  Branch (1564:7): [True: 130, False: 1.41k]
  ------------------
 1565|    130|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1566|    130|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1567|    130|        break;
 1568|    129|      case Duration:
  ------------------
  |  Branch (1568:7): [True: 129, False: 1.41k]
  ------------------
 1569|    129|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1569:13): [True: 129, False: 0]
  ------------------
 1570|    129|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1571|    129|        }
 1572|    129|        break;
 1573|    129|      case PreferredRate:
  ------------------
  |  Branch (1573:7): [True: 129, False: 1.41k]
  ------------------
 1574|    129|        xmpData_["Xmp.video.PreferredRate"] =
 1575|    129|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1576|    129|        break;
 1577|    125|      case PreferredVolume:
  ------------------
  |  Branch (1577:7): [True: 125, False: 1.42k]
  ------------------
 1578|    125|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1579|    125|        break;
 1580|     18|      case PreviewTime:
  ------------------
  |  Branch (1580:7): [True: 18, False: 1.52k]
  ------------------
 1581|     18|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1582|     18|        break;
 1583|     18|      case PreviewDuration:
  ------------------
  |  Branch (1583:7): [True: 18, False: 1.52k]
  ------------------
 1584|     18|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1585|     18|        break;
 1586|     17|      case PosterTime:
  ------------------
  |  Branch (1586:7): [True: 17, False: 1.52k]
  ------------------
 1587|     17|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1588|     17|        break;
 1589|     16|      case SelectionTime:
  ------------------
  |  Branch (1589:7): [True: 16, False: 1.52k]
  ------------------
 1590|     16|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1591|     16|        break;
 1592|     16|      case SelectionDuration:
  ------------------
  |  Branch (1592:7): [True: 16, False: 1.52k]
  ------------------
 1593|     16|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1594|     16|        break;
 1595|     16|      case CurrentTime:
  ------------------
  |  Branch (1595:7): [True: 16, False: 1.52k]
  ------------------
 1596|     16|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1597|     16|        break;
 1598|     15|      case NextTrackID:
  ------------------
  |  Branch (1598:7): [True: 15, False: 1.53k]
  ------------------
 1599|     15|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1600|     15|        break;
 1601|    484|      default:
  ------------------
  |  Branch (1601:7): [True: 484, False: 1.06k]
  ------------------
 1602|    484|        break;
 1603|  1.54k|    }
 1604|  1.54k|  }
 1605|    387|  io_->readOrThrow(buf.data(), size % 4);
 1606|    387|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1608|  3.98k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1609|  3.98k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1610|  3.98k|  if (!image->good()) {
  ------------------
  |  Branch (1610:7): [True: 14, False: 3.96k]
  ------------------
 1611|     14|    return nullptr;
 1612|     14|  }
 1613|  3.96k|  return image;
 1614|  3.98k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1616|  20.7k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1617|  20.7k|  auto buf = DataBuf(12);
 1618|  20.7k|  iIo.read(buf.data(), 12);
 1619|       |
 1620|  20.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1620:7): [True: 0, False: 20.7k]
  |  Branch (1620:22): [True: 297, False: 20.4k]
  ------------------
 1621|    297|    return false;
 1622|    297|  }
 1623|  20.4k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1624|       |
 1625|  20.4k|  bool matched = false;
 1626|       |
 1627|   106k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1627:24): [True: 106k, False: 5.31k]
  ------------------
 1628|   106k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1629|   106k|    if (tmp == 0) {
  ------------------
  |  Branch (1629:9): [True: 15.1k, False: 91.8k]
  ------------------
 1630|       |      // we only match if we actually know the video type. This is done
 1631|       |      // to avoid matching just on ftyp because bmffimage also has that
 1632|       |      // header.
 1633|  15.1k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1633:11): [True: 11.9k, False: 3.21k]
  ------------------
 1634|  11.9k|        matched = true;
 1635|  11.9k|      }
 1636|  15.1k|      break;
 1637|  15.1k|    }
 1638|   106k|  }
 1639|       |
 1640|  20.4k|  if (!advance || !matched) {
  ------------------
  |  Branch (1640:7): [True: 20.4k, False: 0]
  |  Branch (1640:19): [True: 0, False: 0]
  ------------------
 1641|  20.4k|    iIo.seek(0L, BasicIo::beg);
 1642|  20.4k|  }
 1643|       |
 1644|  20.4k|  return matched;
 1645|  20.7k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|  90.6k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|  90.6k|  const char ignoreList[13][5] = {
  505|  90.6k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|  90.6k|  };
  507|       |
  508|  90.6k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.17M, False: 89.0k]
  ------------------
  509|  1.17M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 1.57k, False: 1.17M]
  ------------------
  510|  1.57k|      return true;
  511|       |
  512|  89.0k|  return false;
  513|  90.6k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  45.2k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  45.2k|  const char ignoreList[8][5] = {
  524|  45.2k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  45.2k|  };
  526|       |
  527|  45.2k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 338k, False: 38.6k]
  ------------------
  528|   338k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 6.52k, False: 331k]
  ------------------
  529|  6.52k|      return true;
  530|       |
  531|  38.6k|  return false;
  532|  45.2k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  1.93M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  1.93M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  1.93M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  1.93M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.24M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  1.02k|static std::string readString(BasicIo& io, size_t size) {
  628|  1.02k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  1.02k|  Exiv2::DataBuf str(size + 1);
  630|  1.02k|  io.readOrThrow(str.data(), size);
  631|  1.02k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  1.02k|  return Exiv2::toString(str.data());
  633|  1.02k|}

_ZN5Exiv28RafImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   25|    172|    Image(ImageType::raf, mdExif | mdIptc | mdXmp, std::move(io), params) {
   26|    172|}  // RafImage::RafImage
_ZNK5Exiv28RafImage8mimeTypeEv:
   28|     18|std::string RafImage::mimeType() const {
   29|     18|  return "image/x-fuji-raf";
   30|     18|}
_ZNK5Exiv28RafImage10pixelWidthEv:
   32|     11|uint32_t RafImage::pixelWidth() const {
   33|     11|  if (pixelWidth_ != 0)
  ------------------
  |  Branch (33:7): [True: 0, False: 11]
  ------------------
   34|      0|    return pixelWidth_;
   35|       |
   36|     11|  auto widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Fujifilm.RawImageFullWidth"));
   37|     11|  if (widthIter == exifData_.end() || widthIter->count() == 0)
  ------------------
  |  Branch (37:7): [True: 11, False: 0]
  |  Branch (37:7): [True: 11, False: 0]
  |  Branch (37:39): [True: 0, False: 0]
  ------------------
   38|     11|    return 0;
   39|      0|  return widthIter->toUint32();
   40|     11|}
_ZNK5Exiv28RafImage11pixelHeightEv:
   42|     11|uint32_t RafImage::pixelHeight() const {
   43|     11|  if (pixelHeight_ != 0)
  ------------------
  |  Branch (43:7): [True: 0, False: 11]
  ------------------
   44|      0|    return pixelHeight_;
   45|       |
   46|     11|  auto heightIter = exifData_.findKey(Exiv2::ExifKey("Exif.Fujifilm.RawImageFullHeight"));
   47|     11|  if (heightIter == exifData_.end() || heightIter->count() == 0)
  ------------------
  |  Branch (47:7): [True: 11, False: 0]
  |  Branch (47:7): [True: 11, False: 0]
  |  Branch (47:40): [True: 0, False: 0]
  ------------------
   48|     11|    return 0;
   49|      0|  return heightIter->toUint32();
   50|     11|}
_ZN5Exiv28RafImage12readMetadataEv:
  252|    172|void RafImage::readMetadata() {
  253|       |#ifdef EXIV2_DEBUG_MESSAGES
  254|       |  std::cerr << "Reading RAF file " << io_->path() << "\n";
  255|       |#endif
  256|    172|  if (io_->open() != 0)
  ------------------
  |  Branch (256:7): [True: 0, False: 172]
  ------------------
  257|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  258|    172|  IoCloser closer(*io_);
  259|       |  // Ensure that this is the correct image type
  260|    172|  if (!isRafType(*io_, false)) {
  ------------------
  |  Branch (260:7): [True: 0, False: 172]
  ------------------
  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|    172|  clearMetadata();
  267|       |
  268|    172|  if (io_->seek(84, BasicIo::beg) != 0)
  ------------------
  |  Branch (268:7): [True: 11, False: 161]
  ------------------
  269|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  270|    161|  byte jpg_img_offset[4];
  271|    161|  if (io_->read(jpg_img_offset, 4) != 4)
  ------------------
  |  Branch (271:7): [True: 10, False: 151]
  ------------------
  272|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  273|    151|  byte jpg_img_length[4];
  274|    151|  if (io_->read(jpg_img_length, 4) != 4)
  ------------------
  |  Branch (274:7): [True: 10, False: 141]
  ------------------
  275|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  276|    141|  uint32_t jpg_img_off_u32 = Exiv2::getULong(jpg_img_offset, bigEndian);
  277|    141|  uint32_t jpg_img_len_u32 = Exiv2::getULong(jpg_img_length, bigEndian);
  278|       |
  279|    141|  Internal::enforce(Safe::add(jpg_img_off_u32, jpg_img_len_u32) <= io_->size(), ErrorCode::kerCorruptedMetadata);
  280|       |
  281|    141|  auto jpg_img_off = static_cast<long>(jpg_img_off_u32);
  282|    141|  auto jpg_img_len = static_cast<long>(jpg_img_len_u32);
  283|       |
  284|    141|  Internal::enforce(jpg_img_len >= 12, ErrorCode::kerCorruptedMetadata);
  285|       |
  286|    141|  DataBuf jpg_buf(jpg_img_len);
  287|    141|  if (io_->seek(jpg_img_off, BasicIo::beg) != 0)
  ------------------
  |  Branch (287:7): [True: 0, False: 141]
  ------------------
  288|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  289|       |
  290|    141|  if (!jpg_buf.empty()) {
  ------------------
  |  Branch (290:7): [True: 98, False: 43]
  ------------------
  291|     98|    io_->read(jpg_buf.data(), jpg_buf.size());
  292|     98|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (292:9): [True: 0, False: 98]
  |  Branch (292:25): [True: 0, False: 98]
  ------------------
  293|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  294|     98|  }
  295|       |
  296|       |  // Retrieve metadata from embedded JPEG preview image.
  297|    141|  try {
  298|    141|    auto jpg_io = std::make_unique<Exiv2::MemIo>(jpg_buf.data(), jpg_buf.size());
  299|    141|    auto jpg_img = JpegImage(std::move(jpg_io), ImageCtorParams(false, 0));
  300|    141|    jpg_img.readMetadata();
  301|    141|    setByteOrder(jpg_img.byteOrder());
  302|    141|    xmpData_ = jpg_img.xmpData();
  303|    141|    exifData_ = jpg_img.exifData();
  304|    141|    iptcData_ = jpg_img.iptcData();
  305|    141|    comment_ = jpg_img.comment();
  306|    141|  } catch (const Exiv2::Error&) {
  307|     96|  }
  308|       |
  309|    141|  exifData_["Exif.Image2.JPEGInterchangeFormat"] = getULong(jpg_img_offset, bigEndian);
  310|     98|  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|     98|  std::array<byte, 4> readBuff;
  319|     98|  if (io_->seek(100, BasicIo::beg) != 0)
  ------------------
  |  Branch (319:7): [True: 11, False: 87]
  ------------------
  320|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  321|     87|  if (io_->read(readBuff.data(), 4) != 4)
  ------------------
  |  Branch (321:7): [True: 10, False: 77]
  ------------------
  322|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  323|     77|  uint32_t tiffOffset = Exiv2::getULong(readBuff.data(), bigEndian);
  324|       |
  325|     77|  if (io_->read(readBuff.data(), 4) != 4)
  ------------------
  |  Branch (325:7): [True: 11, False: 66]
  ------------------
  326|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
  327|     66|  uint32_t tiffLength = Exiv2::getULong(readBuff.data(), bigEndian);
  328|       |
  329|       |  // sanity check.  Does tiff lie inside the file?
  330|     66|  Internal::enforce(Safe::add(tiffOffset, tiffLength) <= io_->size(), ErrorCode::kerCorruptedMetadata);
  331|       |
  332|     66|  if (io_->seek(tiffOffset, BasicIo::beg) != 0)
  ------------------
  |  Branch (332:7): [True: 0, False: 66]
  ------------------
  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|     66|  if (io_->read(readBuff.data(), 4) != 4) {
  ------------------
  |  Branch (338:7): [True: 14, False: 52]
  ------------------
  339|     14|    throw Error(ErrorCode::kerFailedToReadImageData);
  340|     14|  }
  341|     52|  io_->seek(-4, BasicIo::cur);
  342|     52|  const std::array<byte, 4> Id1{0x49, 0x49, 0x2A, 0x00};
  343|     52|  const std::array<byte, 4> Id2{0x4D, 0x4D, 0x00, 0x2A};
  344|     52|  if (readBuff == Id1 || readBuff == Id2) {
  ------------------
  |  Branch (344:7): [True: 36, False: 16]
  |  Branch (344:26): [True: 1, False: 15]
  ------------------
  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|      TiffParser::decode(exifData_, iptcData_, xmpData_, tiff.c_data(), tiff.size());
  350|      3|    }
  351|      3|  }
  352|     52|}
_ZN5Exiv214newRafInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  361|    172|Image::UniquePtr newRafInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  362|    172|  auto image = std::make_unique<RafImage>(std::move(io), params);
  363|    172|  if (!image->good()) {
  ------------------
  |  Branch (363:7): [True: 0, False: 172]
  ------------------
  364|      0|    return nullptr;
  365|      0|  }
  366|    172|  return image;
  367|    172|}
_ZN5Exiv29isRafTypeERNS_7BasicIoEb:
  369|  21.2k|bool isRafType(BasicIo& iIo, bool advance) {
  370|  21.2k|  const int32_t len = 8;
  371|  21.2k|  constexpr std::array<byte, len> RafId{'F', 'U', 'J', 'I', 'F', 'I', 'L', 'M'};
  372|  21.2k|  std::array<byte, len> buf;
  373|  21.2k|  iIo.read(buf.data(), len);
  374|  21.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (374:7): [True: 0, False: 21.2k]
  |  Branch (374:22): [True: 0, False: 21.2k]
  ------------------
  375|      0|    return false;
  376|      0|  }
  377|  21.2k|  bool rc = buf == RafId;
  378|  21.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (378:7): [True: 21.2k, False: 0]
  |  Branch (378:19): [True: 0, False: 0]
  ------------------
  379|  21.2k|    iIo.seek(-len, BasicIo::cur);
  380|  21.2k|  }
  381|  21.2k|  return rc;
  382|  21.2k|}

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  365|    842|    Image(ImageType::riff, mdNone, std::move(io), params) {
  366|    842|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  368|    896|std::string RiffVideo::mimeType() const {
  369|    896|  return "video/riff";
  370|    896|}
_ZN5Exiv29RiffVideo12readMetadataEv:
  375|    842|void RiffVideo::readMetadata() {
  376|    842|  if (io_->open() != 0)
  ------------------
  |  Branch (376:7): [True: 0, False: 842]
  ------------------
  377|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  378|       |
  379|       |  // Ensure that this is the correct image type
  380|    842|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (380:7): [True: 0, False: 842]
  ------------------
  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|    842|  IoCloser closer(*io_);
  387|    842|  clearMetadata();
  388|       |
  389|    842|  xmpData_["Xmp.video.FileSize"] = io_->size();
  390|    842|  xmpData_["Xmp.video.MimeType"] = mimeType();
  391|       |
  392|    842|  HeaderReader header(io_);
  393|    842|  xmpData_["Xmp.video.Container"] = header.getId();
  394|       |
  395|    842|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  396|       |
  397|    842|  decodeBlocks();
  398|    842|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  400|  11.2k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  401|  11.2k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  402|  11.2k|  id_ = readStringTag(io);
  403|  11.2k|  size_ = readDWORDTag(io);
  404|  11.2k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  406|  69.7k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  407|  69.7k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (407:7): [True: 31.8k, False: 37.8k]
  ------------------
  408|  31.8k|    return false;
  409|       |
  410|  37.8k|  return Internal::upper(str1) == str2;
  411|  69.7k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  413|  1.16k|void RiffVideo::readList(const HeaderReader& header_) {
  414|  1.16k|  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.16k|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (421:7): [True: 420, False: 747]
  ------------------
  422|    420|    readInfoListChunk(header_.getSize());
  423|    747|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (423:12): [True: 274, False: 473]
  ------------------
  424|    274|    readMoviList(header_.getSize());
  425|    274|  }
  426|  1.16k|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  428|  9.03k|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|  9.03k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (435:7): [True: 850, False: 8.18k]
  ------------------
  436|    850|    readAviHeader();
  437|  8.18k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (437:12): [True: 835, False: 7.34k]
  ------------------
  438|    835|    readStreamHeader();
  439|  7.34k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (439:12): [True: 1.31k, False: 6.03k]
  ------------------
  440|  1.31k|    readStreamFormat(header_.getSize());
  441|  6.03k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (441:12): [True: 983, False: 5.04k]
  ------------------
  442|    983|    streamType_ = Audio;
  443|    983|    readStreamFormat(header_.getSize());
  444|  5.04k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (444:14): [True: 340, False: 4.70k]
  ------------------
  445|    340|    readStreamData(header_.getSize());
  446|  4.70k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (446:12): [True: 327, False: 4.38k]
  ------------------
  447|    327|    StreamName(header_.getSize());
  448|  4.38k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (448:12): [True: 194, False: 4.18k]
  ------------------
  449|    194|    readVPRPChunk(header_.getSize());
  450|  4.18k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (450:12): [True: 218, False: 3.96k]
  ------------------
  451|    218|    readIndexChunk(header_.getSize());
  452|  3.96k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (452:12): [True: 78, False: 3.89k]
  ------------------
  453|     78|    readDataChunk(header_.getSize());
  454|  3.89k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (454:12): [True: 35, False: 3.85k]
  ------------------
  455|     35|    readJunk(header_.getSize());
  456|  3.85k|  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|  3.85k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  463|  3.85k|  }
  464|  9.03k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  466|    842|void RiffVideo::decodeBlocks() {
  467|  10.3k|  do {
  468|  10.3k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (468:35): [True: 1.16k, False: 9.21k]
  ------------------
  469|  1.16k|      readList(header);
  470|  9.21k|    } else {
  471|  9.21k|      readChunk(header);
  472|  9.21k|    }
  473|  10.3k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (473:12): [True: 9.56k, False: 814]
  |  Branch (473:27): [True: 9.53k, False: 28]
  ------------------
  474|    842|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  476|    850|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|    850|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  497|    850|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  498|    850|  double frame_rate = 1000000. / TimeBetweenFrames;
  499|       |
  500|    850|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  501|       |
  502|    850|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  503|    850|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  504|       |
  505|    850|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  506|    850|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  507|       |
  508|    850|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  509|    850|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  510|       |
  511|    850|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  512|       |
  513|    850|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  514|       |
  515|    850|  uint32_t width = readDWORDTag(io_);
  516|    850|  xmpData_["Xmp.video.Width"] = width;
  517|       |
  518|    850|  uint32_t height = readDWORDTag(io_);
  519|    850|  xmpData_["Xmp.video.Height"] = height;
  520|       |
  521|    850|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  522|    850|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  523|       |
  524|    850|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  525|       |
  526|    850|  fillDuration(frame_rate, frame_count);
  527|    850|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  529|    835|void RiffVideo::readStreamHeader() {
  530|    835|  std::string stream = readStringTag(io_);
  531|    835|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (531:17): [True: 176, False: 659]
  ------------------
  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|    835|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  556|       |
  557|    835|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  558|    835|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  559|       |
  560|    835|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  561|       |
  562|    835|  if (divisor) {
  ------------------
  |  Branch (562:7): [True: 655, False: 180]
  ------------------
  563|    655|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  564|    655|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (564:14): [True: 97, False: 558]
  ------------------
  565|    655|  }
  566|    835|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  567|       |
  568|    835|  if (divisor) {
  ------------------
  |  Branch (568:7): [True: 642, False: 193]
  ------------------
  569|    642|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  570|    642|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (570:14): [True: 93, False: 549]
  ------------------
  571|    642|  }
  572|       |
  573|    835|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  574|       |
  575|    835|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (575:12): [True: 154, False: 681]
  ------------------
  576|       |
  577|    835|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (577:12): [True: 145, False: 690]
  ------------------
  578|    835|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  579|    835|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  581|  2.30k|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.30k|  if (streamType_ == Video) {
  ------------------
  |  Branch (612:7): [True: 1.27k, False: 1.02k]
  ------------------
  613|  1.27k|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  614|  1.27k|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  615|  1.27k|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  616|  1.27k|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  617|  1.27k|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  618|  1.27k|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  619|  1.27k|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  620|  1.27k|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  621|  1.27k|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (621:18): [True: 815, False: 462]
  ------------------
  622|    815|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  623|    462|    else
  624|    462|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  625|  1.27k|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (625:18): [True: 204, False: 1.07k]
  ------------------
  626|    204|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  627|  1.07k|    else
  628|  1.07k|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  629|  1.27k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (629:14): [True: 988, False: 35]
  ------------------
  630|    988|    uint16_t format_tag = readWORDTag(io_);
  631|    988|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (631:67): [True: 450, False: 538]
  ------------------
  632|    450|      xmpData_["Xmp.audio.Compressor"] = it->second;
  633|    538|    else
  634|    538|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  635|       |
  636|    988|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  637|    988|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  638|    988|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  639|    988|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  640|    988|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  641|    988|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (641:9): [True: 76, False: 912]
  ------------------
  642|     76|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  643|    988|  } else {
  644|     35|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  645|     35|  }
  646|  2.30k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  648|    340|void RiffVideo::readStreamData(uint64_t size_) const {
  649|    340|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  650|    340|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  652|    327|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|    327|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  655|    327|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  657|    420|void RiffVideo::readInfoListChunk(uint64_t size_) {
  658|    420|  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|    420|  std::map<std::string, std::string> table;
  663|  2.70k|  while (current_size < size_) {
  ------------------
  |  Branch (663:10): [True: 2.28k, False: 420]
  ------------------
  664|  2.28k|    std::string type = readStringTag(io_);
  665|  2.28k|    size_t size = readDWORDTag(io_);
  666|  2.28k|    std::string content = readStringTag(io_, size);
  667|  2.28k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
  ------------------
  |  Branch (667:50): [True: 106, False: 2.17k]
  ------------------
  668|       |      // Check that it isn't a duplicate.
  669|    106|      Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
  670|    106|      table[it->second] = content;
  671|    106|    }
  672|  2.28k|    current_size += DWORD * 2;
  673|  2.28k|    current_size += size;
  674|  2.28k|  }
  675|       |  // Copy the elements from the temporary table to xmpData_.
  676|    420|  for (const auto& it : table) {
  ------------------
  |  Branch (676:23): [True: 27, False: 420]
  ------------------
  677|     27|    xmpData_[it.first] = it.second;
  678|     27|  }
  679|    420|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  681|    274|void RiffVideo::readMoviList(uint64_t size_) const {
  682|    274|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  683|    274|}
_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|    218|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|    218|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|    218|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  731|     78|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|     78|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  743|     78|  if (size_ % 2 != 0)
  ------------------
  |  Branch (743:7): [True: 10, False: 68]
  ------------------
  744|     10|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  745|     78|}
_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.82k|std::string RiffVideo::getStreamType(uint32_t stream) {
  752|  1.82k|  if (stream == 1)
  ------------------
  |  Branch (752:7): [True: 354, False: 1.47k]
  ------------------
  753|    354|    return "Mono";
  754|  1.47k|  if (stream == 2)
  ------------------
  |  Branch (754:7): [True: 69, False: 1.40k]
  ------------------
  755|     69|    return "Stereo";
  756|  1.40k|  if (stream == 5)
  ------------------
  |  Branch (756:7): [True: 159, False: 1.24k]
  ------------------
  757|    159|    return "5.1 Surround Sound";
  758|  1.24k|  if (stream == 7)
  ------------------
  |  Branch (758:7): [True: 180, False: 1.06k]
  ------------------
  759|    180|    return "7.1 Surround Sound";
  760|  1.06k|  return "Mono";
  761|  1.24k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  763|    819|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  764|    819|  if (frame_rate == 0)
  ------------------
  |  Branch (764:7): [True: 0, False: 819]
  ------------------
  765|      0|    return;
  766|       |
  767|    819|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  768|    819|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  769|    819|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  770|    819|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|    842|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|    842|  auto image = std::make_unique<RiffVideo>(std::move(io), params);
  774|    842|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 842]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|    842|  return image;
  778|    842|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  780|  9.79k|bool isRiffType(BasicIo& iIo, bool advance) {
  781|  9.79k|  constexpr int len = 4;
  782|  9.79k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  783|  9.79k|  std::array<byte, len> buf;
  784|  9.79k|  iIo.read(buf.data(), len);
  785|  9.79k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 9.79k]
  |  Branch (785:22): [True: 297, False: 9.49k]
  ------------------
  786|    297|    return false;
  787|    297|  }
  788|  9.49k|  bool matched = buf == RiffVideoId;
  789|  9.49k|  if (!advance || !matched) {
  ------------------
  |  Branch (789:7): [True: 9.49k, False: 0]
  |  Branch (789:19): [True: 0, False: 0]
  ------------------
  790|  9.49k|    iIo.seek(-1 * len, BasicIo::cur);
  791|  9.49k|  }
  792|  9.49k|  return matched;
  793|  9.79k|}

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

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

_ZN4Safe3addIjEET_S1_S1_:
  137|  12.6k|T add(T summand_1, T summand_2) {
  138|  12.6k|  T res = 0;
  139|  12.6k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 25, False: 12.5k]
  ------------------
  140|     25|    throw std::overflow_error("Overflow in addition");
  141|     25|  }
  142|  12.5k|  return res;
  143|  12.6k|}
_ZN4Safe8Internal20builtin_add_overflowIjEEbT_S2_RS2_:
   96|  12.6k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  12.6k|#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|  12.6k|    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|  12.6k|}
_ZN4Safe3addImEET_S1_S1_:
  137|   756k|T add(T summand_1, T summand_2) {
  138|   756k|  T res = 0;
  139|   756k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 7, False: 756k]
  ------------------
  140|      7|    throw std::overflow_error("Overflow in addition");
  141|      7|  }
  142|   756k|  return res;
  143|   756k|}
_ZN4Safe8Internal20builtin_add_overflowImEEbT_S2_RS2_:
   96|   756k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|   756k|#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|   756k|    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|   756k|}

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  6.38k|  static constexpr auto tagList() {
   30|  6.38k|    return tagInfo_;
   31|  6.38k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    269|  static constexpr auto tagListCs() {
   34|    269|    return tagInfoCs_;
   35|    269|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    250|  static constexpr auto tagListCs2() {
   38|    250|    return tagInfoCs2_;
   39|    250|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  2.41k|  static constexpr auto tagListFp() {
   42|  2.41k|    return tagInfoFp_;
   43|  2.41k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|    631|  static constexpr auto tagListSonyMisc1() {
   46|    631|    return tagInfoSonyMisc1_;
   47|    631|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  1.45k|  static constexpr auto tagListSonyMisc2b() {
   50|  1.45k|    return tagInfoSonyMisc2b_;
   51|  1.45k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  14.0k|  static constexpr auto tagListSonyMisc3c() {
   54|  14.0k|    return tagInfoSonyMisc3c_;
   55|  14.0k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|  1.79k|  static constexpr auto tagListSonySInfo1() {
   58|  1.79k|    return tagInfoSonySInfo1_;
   59|  1.79k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.81M|const TagInfo* ifdTagList() {
 1779|  1.81M|  return ifdTagInfo;
 1780|  1.81M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|  14.6k|const TagInfo* exifTagList() {
 2217|  14.6k|  return exifTagInfo;
 2218|  14.6k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|  2.08k|const TagInfo* gpsTagList() {
 2433|  2.08k|  return gpsTagInfo;
 2434|  2.08k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|    964|const TagInfo* iopTagList() {
 2508|    964|  return iopTagInfo;
 2509|    964|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  11.8k|const TagInfo* mnTagList() {
 2524|  11.8k|  return mnTagInfo;
 2525|  11.8k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|   609k|bool isMakerIfd(IfdId ifdId) {
 2528|   609k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 609k, False: 0]
  ------------------
 2529|   609k|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|   609k|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  1.81M|bool isExifIfd(IfdId ifdId) {
 2534|  1.81M|  switch (ifdId) {
 2535|   453k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 453k, False: 1.35M]
  ------------------
 2536|   462k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 9.26k, False: 1.80M]
  ------------------
 2537|   464k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 1.39k, False: 1.81M]
  ------------------
 2538|   465k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 964, False: 1.81M]
  ------------------
 2539|   554k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 89.1k, False: 1.72M]
  ------------------
 2540|   588k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 34.4k, False: 1.77M]
  ------------------
 2541|   589k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 694, False: 1.81M]
  ------------------
 2542|   589k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 1.81M]
  ------------------
 2543|   761k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 172k, False: 1.64M]
  ------------------
 2544|   829k|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 68.0k, False: 1.74M]
  ------------------
 2545|   949k|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 120k, False: 1.69M]
  ------------------
 2546|  1.08M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 138k, False: 1.67M]
  ------------------
 2547|  1.10M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 14.3k, False: 1.79M]
  ------------------
 2548|  1.11M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 12.4k, False: 1.80M]
  ------------------
 2549|  1.12M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 12.2k, False: 1.80M]
  ------------------
 2550|  1.13M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 11.4k, False: 1.80M]
  ------------------
 2551|  1.15M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 11.6k, False: 1.80M]
  ------------------
 2552|  1.20M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 51.7k, False: 1.76M]
  ------------------
 2553|  1.20M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 909, False: 1.81M]
  ------------------
 2554|  1.20M|      return true;
 2555|   609k|    default:
  ------------------
  |  Branch (2555:5): [True: 609k, False: 1.20M]
  ------------------
 2556|   609k|      return false;
 2557|  1.81M|  }
 2558|  1.81M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  2.59M|const TagInfo* tagList(IfdId ifdId) {
 2569|  2.59M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 2.59M, False: 0]
  ------------------
 2570|  2.59M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 2.59M, False: 0]
  ------------------
 2571|  2.59M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  2.59M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  1.81M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  1.81M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 1.81M, False: 0]
  ------------------
 2577|  1.81M|    int idx = 0;
 2578|  99.5M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 98.9M, False: 592k]
  ------------------
 2579|  98.9M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.21M, False: 97.7M]
  ------------------
 2580|  1.21M|        break;
 2581|  98.9M|    }
 2582|  1.81M|    return ti + idx;
 2583|  1.81M|  }
 2584|      0|  return nullptr;
 2585|  1.81M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   782k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   782k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 782k]
  ------------------
 2589|      0|    return nullptr;
 2590|   782k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 782k, False: 0]
  ------------------
 2591|  25.0M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 25.0M, False: 0]
  ------------------
 2592|  25.0M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 782k, False: 24.2M]
  ------------------
 2593|   782k|        return ti + idx;
 2594|   782k|      }
 2595|  25.0M|    }
 2596|   782k|  }
 2597|      0|  return nullptr;
 2598|   782k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  1.96M|IfdId groupId(const std::string& groupName) {
 2601|  1.96M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 1.96M, False: 0]
  ------------------
 2602|  1.96M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  1.96M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|   883k|const char* groupName(IfdId ifdId) {
 2613|   883k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 883k, False: 0]
  ------------------
 2614|   883k|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|   883k|}
_ZN5Exiv28Internal7fnumberEf:
 2647|     11|float fnumber(float apertureValue) {
 2648|     11|  float result = std::exp2(apertureValue / 2.F);
 2649|     11|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 11]
  ------------------
 2650|      0|    result = 3.5F;
 2651|      0|  }
 2652|     11|  return result;
 2653|     11|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|     11|URational exposureTime(float shutterSpeedValue) {
 2656|     11|  URational ur(1, 1);
 2657|     11|  const double tmp = std::exp2(shutterSpeedValue);
 2658|     11|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 0, False: 11]
  ------------------
 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|     11|  } else {
 2665|     11|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     11|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 11, False: 0]
  |  Branch (2667:19): [True: 11, False: 0]
  ------------------
 2668|     11|      ur.first = static_cast<uint32_t>(x);
 2669|     11|    }
 2670|     11|  }
 2671|     11|  return ur;
 2672|     11|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   782k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   782k|  auto ti = tagInfo(tagName, ifdId);
 2676|   782k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 782k, False: 0]
  |  Branch (2676:13): [True: 782k, False: 0]
  ------------------
 2677|   782k|    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|  9.36k|const TagInfo* tagList(const std::string& groupName) {
 3295|  9.36k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  9.36k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 9.36k]
  |  Branch (3296:14): [True: 0, False: 9.36k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  9.36k|  return ii->tagList_();
 3300|  9.36k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  5.03M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  5.03M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 5.03M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 1.01M, False: 4.01M]
  |  Branch (42:86): [True: 11.4k, False: 4.00M]
  ------------------
   43|  1.02M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 10.8k, False: 1.01M]
  ------------------
   44|  5.03M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  4.38k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  4.38k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 0, False: 4.38k]
  |  Branch (48:20): [True: 0, False: 4.38k]
  ------------------
   49|      0|    wroteHeader_ = true;
   50|  4.38k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|   341k|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|   341k|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 4.38k, False: 337k]
  |  Branch (53:24): [True: 4.38k, False: 0]
  ------------------
   54|  4.38k|    io_.write(pHeader_, size_);
   55|  4.38k|    wroteHeader_ = true;
   56|  4.38k|  }
   57|   341k|  return io_.write(pData, wcount);
   58|   341k|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  5.28k|int IoWrapper::putb(byte data) {
   61|  5.28k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 5.28k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  5.28k|  return io_.putb(data);
   66|  5.28k|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|  50.3k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|  50.3k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  9.21k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  9.21k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  3.43k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  3.43k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  3.43k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  5.07k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  5.07k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  1.74k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  1.74k|    cfgSelFct_(cfgSelFct),
   99|  1.74k|    arraySet_(arraySet),
  100|  1.74k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  1.74k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  1.35M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  1.35M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  1.35M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  64.3k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  64.3k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  73.2k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  73.2k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  12.6k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  12.6k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  12.6k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  2.82M|int TiffEntryBase::idx() const {
  206|  2.82M|  return idx_;
  207|  2.82M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|  36.0k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|  36.0k|  storage_ = std::move(buf);
  211|  36.0k|  pData_ = storage_->data();
  212|  36.0k|  size_ = storage_->size();
  213|  36.0k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|   859k|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|   859k|  pData_ = pData;
  217|   859k|  size_ = size;
  218|   859k|  storage_ = std::move(storage);
  219|   859k|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 859k]
  ------------------
  220|      0|    size_ = 0;
  221|   859k|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|   140k|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|   140k|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 140k]
  ------------------
  225|      0|    return;
  226|   140k|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 35.8k, False: 104k]
  ------------------
  227|  35.8k|    auto d = std::make_shared<DataBuf>(newSize);
  228|  35.8k|    setData(std::move(d));
  229|  35.8k|  }
  230|   140k|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 35.8k, False: 104k]
  ------------------
  231|  35.8k|    memset(pData_, 0x0, size_);
  232|  35.8k|  }
  233|   140k|  size_ = value->copy(pData_, byteOrder);
  234|   140k|  setValue(std::move(value));
  235|   140k|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  1.01M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  1.01M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 1.01M]
  ------------------
  239|      0|    return;
  240|  1.01M|  tiffType_ = toTiffType(value->typeId());
  241|  1.01M|  count_ = value->count();
  242|  1.01M|  pValue_ = std::move(value);
  243|  1.01M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  8.79k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  8.79k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 383, False: 8.41k]
  |  Branch (246:20): [True: 432, False: 7.98k]
  ------------------
  247|    815|#ifndef SUPPRESS_WARNINGS
  248|    815|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    815|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 815]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    815|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|    815|#endif
  251|    815|    return;
  252|    815|  }
  253|  7.98k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 877, False: 7.10k]
  ------------------
  254|    877|#ifndef SUPPRESS_WARNINGS
  255|    877|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    877|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 877]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    877|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|    877|#endif
  258|    877|    return;
  259|    877|  }
  260|  7.10k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 891, False: 6.21k]
  ------------------
  261|    891|#ifndef SUPPRESS_WARNINGS
  262|    891|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    891|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 891]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    891|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|    891|#endif
  266|    891|    return;
  267|    891|  }
  268|  6.21k|  size_t size = 0;
  269|  26.7k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 20.5k, False: 6.21k]
  ------------------
  270|  20.5k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  20.5k|  }
  272|  6.21k|  const size_t offset = pValue()->toUint32(0);
  273|  6.21k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 744, False: 5.47k]
  |  Branch (273:26): [True: 385, False: 5.08k]
  |  Branch (273:54): [True: 10, False: 5.07k]
  ------------------
  274|  1.13k|#ifndef SUPPRESS_WARNINGS
  275|  1.13k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.13k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.13k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.13k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.13k|#endif
  278|  1.13k|    return;
  279|  1.13k|  }
  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.07k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 321, False: 4.75k]
  ------------------
  283|    321|#ifndef SUPPRESS_WARNINGS
  284|    321|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    321|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 321]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    321|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    321|#endif
  287|    321|    return;
  288|    321|  }
  289|  4.75k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  4.75k|  sizeDataArea_ = size;
  291|  4.75k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  4.75k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  35.6k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  35.6k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 1.40k, False: 34.2k]
  |  Branch (295:20): [True: 735, False: 33.5k]
  ------------------
  296|  2.14k|#ifndef SUPPRESS_WARNINGS
  297|  2.14k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.14k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.14k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.14k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  2.14k|#endif
  300|  2.14k|    return;
  301|  2.14k|  }
  302|  33.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 4.85k, False: 28.6k]
  ------------------
  303|  4.85k|#ifndef SUPPRESS_WARNINGS
  304|  4.85k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  4.85k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.85k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.85k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  4.85k|#endif
  308|  4.85k|    return;
  309|  4.85k|  }
  310|   133k|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 105k, False: 28.6k]
  ------------------
  311|   105k|    const size_t offset = pValue()->toUint32(i);
  312|   105k|    const size_t size = pSize->toUint32(i);
  313|       |
  314|   105k|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 28.3k, False: 76.9k]
  |  Branch (314:28): [True: 18.4k, False: 58.5k]
  |  Branch (314:56): [True: 18, False: 58.5k]
  ------------------
  315|  46.8k|#ifndef SUPPRESS_WARNINGS
  316|  46.8k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  46.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  46.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  46.8k|#endif
  319|  58.5k|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 33.5k, False: 24.9k]
  ------------------
  320|  33.5k|      const byte* pStrip = pData + baseOffset + offset;
  321|  33.5k|      strips_.emplace_back(pStrip, size);
  322|  33.5k|    }
  323|   105k|  }
  324|  28.6k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  2.99k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  2.99k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 792, False: 2.20k]
  ------------------
  328|    792|    return 0;
  329|  2.20k|  return pHeader_->ifdOffset();
  330|  2.99k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  5.96k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  5.96k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 1.58k, False: 4.38k]
  |  Branch (333:20): [True: 3.21k, False: 1.17k]
  ------------------
  334|  4.79k|    return imageByteOrder_;
  335|  4.79k|  }
  336|  1.17k|  return pHeader_->byteOrder();
  337|  5.96k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  2.96k|size_t TiffIfdMakernote::mnOffset() const {
  340|  2.96k|  return mnOffset_;
  341|  2.96k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  2.99k|size_t TiffIfdMakernote::baseOffset() const {
  344|  2.99k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 792, False: 2.20k]
  ------------------
  345|    792|    return 0;
  346|  2.20k|  return pHeader_->baseOffset(mnOffset_);
  347|  2.99k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  3.43k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  3.43k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 792, False: 2.64k]
  ------------------
  351|    792|    return true;
  352|  2.64k|  return pHeader_->read(pData, size, byteOrder);
  353|  3.43k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|   701k|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|   701k|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|   701k|  return count_ * TypeInfo::typeSize(typeId);
  375|   701k|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  1.39k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  1.39k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 666, False: 733]
  ------------------
  394|    666|    return true;  // Not a complex array
  395|       |
  396|    733|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|    733|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 409, False: 324]
  ------------------
  398|    409|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|    409|    arrayDef_ = arraySet_[idx].def_;
  400|    409|    defSize_ = arraySet_[idx].defSize_;
  401|    409|  }
  402|    733|  return idx > -1;
  403|  1.39k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  6.81k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  6.81k|  origData_ = const_cast<byte*>(pData());
  407|  6.81k|  origSize_ = TiffEntryBase::doSize();
  408|  6.81k|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|   350k|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|   350k|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|   350k|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|   350k|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|   350k|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|   350k|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 350k]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|   350k|  tp->setStart(pData() + idx);
  429|   350k|  auto s = storage();
  430|   350k|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|   350k|  tp->setElDef(def);
  432|   350k|  tp->setElByteOrder(cfg()->byteOrder_);
  433|   350k|  addChild(std::move(tc));
  434|   350k|  return sz;
  435|   350k|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|   297k|                                      TiffComponent::UniquePtr object) {
  439|   297k|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|   297k|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|   148k|                                        TiffComponent::UniquePtr /*object*/) {
  444|   148k|  return this;
  445|   148k|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|   148k|                                        TiffComponent::UniquePtr object) {
  449|   148k|  tiffPath.pop();
  450|   148k|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|   148k|  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|   148k|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 0, False: 148k]
  |  Branch (457:31): [True: 0, False: 148k]
  |  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|   148k|  if (tc)
  ------------------
  |  Branch (470:7): [True: 0, False: 148k]
  ------------------
  471|      0|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|   148k|  auto atc = [&] {
  474|   148k|    if (tiffPath.size() == 1 && object) {
  475|   148k|      return std::move(object);
  476|   148k|    }
  477|   148k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   148k|  }();
  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|   148k|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 148k, False: 0]
  |  Branch (482:31): [True: 0, False: 148k]
  ------------------
  483|      0|    return nullptr;
  484|       |
  485|   148k|  tc = [&] {
  486|   148k|    if (tpi.extendedTag() == Tag::next)
  487|   148k|      return this->addNext(std::move(atc));
  488|   148k|    return this->addChild(std::move(atc));
  489|   148k|  }();
  490|   148k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|   148k|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  1.37M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  1.37M|  return doAddChild(std::move(tiffComponent));
  573|  1.37M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  1.00M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  1.00M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  1.00M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  23.7k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  23.7k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  23.7k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 23.7k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  23.7k|  return ifds_.emplace_back(std::move(d)).get();
  589|  23.7k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|   350k|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|   350k|  setDecoded(true);
  604|   350k|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|   350k|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  2.01k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  2.01k|  return doAddNext(std::move(tiffComponent));
  609|  2.01k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  2.01k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  2.01k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 2.01k, False: 0]
  ------------------
  617|  2.01k|    pNext_ = std::move(tiffComponent);
  618|  2.01k|    return pNext_.get();
  619|  2.01k|  }
  620|      0|  return nullptr;
  621|  2.01k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  20.2M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  20.2M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 20.2M, False: 12.8k]
  ------------------
  636|  20.2M|    doAccept(visitor);  // one for NVI :)
  637|  20.2M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  12.7M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  12.7M|  visitor.visitEntry(this);
  641|  12.7M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   132k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   132k|  visitor.visitDataEntry(this);
  645|   132k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  2.10M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  2.10M|  visitor.visitImageEntry(this);
  649|  2.10M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.61M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.61M|  visitor.visitSizeEntry(this);
  653|  2.61M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|   603k|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|   603k|  visitor.visitDirectory(this);
  657|  18.0M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 18.0M, False: 465k]
  ------------------
  658|  18.0M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 137k, False: 17.9M]
  ------------------
  659|   137k|      break;
  660|  17.9M|    component->accept(visitor);
  661|  17.9M|  }
  662|   603k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 462k, False: 141k]
  ------------------
  663|   462k|    visitor.visitDirectoryNext(this);
  664|   603k|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 42.6k, False: 561k]
  ------------------
  665|  42.6k|    pNext_->accept(visitor);
  666|   603k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 450k, False: 153k]
  ------------------
  667|   450k|    visitor.visitDirectoryEnd(this);
  668|   603k|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   138k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   138k|  visitor.visitSubIfd(this);
  672|   432k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 432k, False: 107k]
  ------------------
  673|   432k|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 30.6k, False: 401k]
  ------------------
  674|  30.6k|      break;
  675|   401k|    ifd->accept(visitor);
  676|   401k|  }
  677|   138k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|  57.4k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|  57.4k|  visitor.visitMnEntry(this);
  681|  57.4k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 12.2k, False: 45.1k]
  ------------------
  682|  12.2k|    mn_->accept(visitor);
  683|  57.4k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.90k, False: 55.4k]
  ------------------
  684|  1.90k|    mn_ = nullptr;
  685|  1.90k|  }
  686|       |
  687|  57.4k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  12.2k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  12.2k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 12.2k, False: 0]
  ------------------
  691|  12.2k|    visitor.visitIfdMakernote(this);
  692|  12.2k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 11.7k, False: 469]
  ------------------
  693|  11.7k|    ifd_.accept(visitor);
  694|  12.2k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 11.7k, False: 469]
  |  Branch (694:52): [True: 7.91k, False: 3.88k]
  ------------------
  695|  7.91k|    visitor.visitIfdMakernoteEnd(this);
  696|  12.2k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|  50.6k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|  50.6k|  visitor.visitBinaryArray(this);
  700|  1.72M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 1.72M, False: 50.1k]
  ------------------
  701|  1.72M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 561, False: 1.72M]
  ------------------
  702|    561|      break;
  703|  1.72M|    element->accept(visitor);
  704|  1.72M|  }
  705|  50.6k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 43.6k, False: 7.06k]
  ------------------
  706|  43.6k|    visitor.visitBinaryArrayEnd(this);
  707|  50.6k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  1.75M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  1.75M|  visitor.visitBinaryElement(this);
  711|  1.75M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|   148k|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|   148k|  doEncode(encoder, datum);
  715|   148k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|   109k|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|   109k|  encoder.encodeTiffEntry(this, datum);
  731|   109k|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  18.2k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  18.2k|  encoder.encodeImageEntry(this, datum);
  735|  18.2k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  21.3k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  21.3k|  encoder.encodeSizeEntry(this, datum);
  743|  21.3k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|   190k|size_t TiffComponent::count() const {
  750|   190k|  return doCount();
  751|   190k|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|  4.38k|size_t TiffDirectory::doCount() const {
  754|  4.38k|  return components_.size();
  755|  4.38k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|   186k|size_t TiffEntryBase::doCount() const {
  758|   186k|  return count_;
  759|   186k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|   152k|                            size_t& imageIdx) {
  807|   152k|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|   152k|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  4.38k|                              size_t& imageIdx) {
  812|  4.38k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  4.38k|  const size_t compCount = count();
  816|  4.38k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 4.38k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  4.38k|  size_t sizeNext = 0;
  821|  4.38k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 0, False: 4.38k]
  ------------------
  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.38k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 0, False: 4.38k]
  |  Branch (825:25): [True: 0, False: 0]
  ------------------
  826|      0|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  4.38k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 0, False: 4.38k]
  ------------------
  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.38k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 4.38k, 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.38k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 4.38k, False: 0]
  ------------------
  842|  4.38k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  4.38k|  }
  844|       |  // Size of IFD values and additional data
  845|  4.38k|  size_t sizeValue = 0;
  846|  4.38k|  size_t sizeData = 0;
  847|   148k|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 148k, False: 4.38k]
  ------------------
  848|   148k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 10.8k, False: 137k]
  ------------------
  849|  10.8k|      sv += sv & 1;  // Align value to word boundary
  850|  10.8k|      sizeValue += sv;
  851|  10.8k|    }
  852|       |    // Also add the size of data, but only if needed
  853|   148k|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 148k, False: 0]
  ------------------
  854|   148k|      auto sd = component->sizeData();
  855|   148k|      sd += sd & 1;  // Align data to word boundary
  856|   148k|      sizeData += sd;
  857|   148k|    }
  858|   148k|  }
  859|       |
  860|  4.38k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  4.38k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  4.38k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  4.38k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 4.38k, False: 0]
  ------------------
  864|  4.38k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  4.38k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  4.38k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  4.38k|  byte buf[4];
  870|  4.38k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  4.38k|  ioWrapper.write(buf, 2);
  872|  4.38k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|   148k|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 148k, False: 4.38k]
  ------------------
  875|   148k|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|   148k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 10.8k, False: 137k]
  ------------------
  877|  10.8k|      sv += sv & 1;  // Align value to word boundary
  878|  10.8k|      valueIdx += sv;
  879|  10.8k|    }
  880|   148k|    auto sd = component->sizeData();
  881|   148k|    sd += sd & 1;  // Align data to word boundary
  882|   148k|    dataIdx += sd;
  883|   148k|  }
  884|       |  // c) Pointer to the next IFD
  885|  4.38k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 4.33k, False: 48]
  ------------------
  886|  4.33k|    memset(buf, 0x0, 4);
  887|  4.33k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 0, False: 4.33k]
  |  Branch (887:19): [True: 0, False: 0]
  ------------------
  888|      0|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|      0|    }
  890|  4.33k|    ioWrapper.write(buf, 4);
  891|  4.33k|    idx += 4;
  892|  4.33k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  4.38k|  valueIdx = sizeDir;
  896|  4.38k|  dataIdx = sizeDir + sizeValue;
  897|   147k|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 147k, False: 4.38k]
  ------------------
  898|   147k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 10.7k, False: 136k]
  ------------------
  899|  10.7k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  10.7k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  10.7k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 4.31k, False: 6.45k]
  ------------------
  902|  4.31k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  4.31k|        sv += 1;
  904|  4.31k|      }
  905|  10.7k|      idx += sv;
  906|  10.7k|      valueIdx += sv;
  907|  10.7k|    }
  908|   147k|    auto sd = component->sizeData();
  909|   147k|    sd += sd & 1;  // Align data to word boundary
  910|   147k|    dataIdx += sd;
  911|   147k|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  4.38k|  dataIdx = sizeDir + sizeValue;
  915|  4.38k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  4.38k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 0, False: 4.38k]
  |  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.38k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 4.29k, False: 89]
  ------------------
  924|  4.29k|    idx += writeImage(ioWrapper, byteOrder);
  925|  4.29k|  }
  926|       |
  927|  4.38k|  return idx;
  928|  4.38k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|   148k|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|   148k|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|   148k|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 148k]
  ------------------
  934|      0|    return 0;
  935|   148k|  byte buf[8];
  936|   148k|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|   148k|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|   148k|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|   148k|  ioWrapper.write(buf, 8);
  940|   148k|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 10.8k, False: 137k]
  ------------------
  941|  10.8k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  10.8k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  10.8k|    ioWrapper.write(buf, 4);
  944|   137k|  } else {
  945|   137k|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|   137k|#ifndef SUPPRESS_WARNINGS
  947|   137k|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 0, False: 137k]
  ------------------
  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|   137k|#endif
  951|   137k|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 129k, False: 7.91k]
  ------------------
  952|   129k|      memset(buf, 0x0, 4);
  953|   129k|      ioWrapper.write(buf, 4 - len);
  954|   129k|    }
  955|   137k|  }
  956|   148k|  return 12;
  957|   148k|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|   130k|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|   130k|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 0, False: 130k]
  |  Branch (961:19): [True: 104k, False: 25.5k]
  ------------------
  962|   104k|    return 0;
  963|       |
  964|  25.5k|  DataBuf buf(pValue_->size());
  965|  25.5k|  pValue_->copy(buf.data(), byteOrder);
  966|  25.5k|  ioWrapper.write(buf.c_data(), buf.size());
  967|  25.5k|  return buf.size();
  968|   130k|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  47.8k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  47.8k|  size_t rc = 0;
  972|  47.8k|  switch (tiffType) {
  973|  1.10k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 1.10k, False: 46.7k]
  ------------------
  974|  3.29k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 2.18k, False: 45.6k]
  ------------------
  975|  3.29k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 24, False: 3.27k]
  ------------------
  976|     24|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  3.27k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  3.27k|      break;
  979|  43.2k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 43.2k, False: 4.56k]
  ------------------
  980|  44.4k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 1.20k, False: 46.6k]
  ------------------
  981|  44.4k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  44.4k|      break;
  983|     65|    default:
  ------------------
  |  Branch (983:5): [True: 65, False: 47.7k]
  ------------------
  984|     65|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  47.8k|  }
  986|  47.7k|  return rc;
  987|  47.8k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  17.8k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  17.8k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  17.8k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 0, False: 17.8k]
  ------------------
 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|  17.8k|  DataBuf buf(strips_.size() * 4);
 1018|  17.8k|  size_t idx = 0;
 1019|  47.8k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 47.8k, False: 17.8k]
  ------------------
 1020|  47.8k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  47.8k|    const auto sz = Safe::add(off, off & 1);
 1023|  47.8k|    o2 = Safe::add(o2, sz);
 1024|  47.8k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 47.7k, False: 89]
  ------------------
 1025|  47.7k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  47.8k|  }
 1027|  17.8k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  17.8k|  return buf.size();
 1029|  17.8k|}  // TiffImageEntry::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|   150k|                                size_t& imageIdx) const {
 1135|   150k|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|   150k|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  4.29k|                                  size_t& imageIdx) const {
 1140|  4.29k|  size_t len = 0;
 1141|   146k|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 146k, False: 4.29k]
  ------------------
 1142|   146k|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|   146k|  }
 1144|  4.29k|  return len;
 1145|  4.29k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|   128k|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|   128k|  return 0;
 1150|   128k|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  17.5k|                                   size_t& /*imageIdx*/) const {
 1154|  17.5k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  17.5k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 0, False: 17.5k]
  ------------------
 1157|      0|    len = writeImage(ioWrapper, byteOrder);
 1158|      0|  }
 1159|  17.5k|  return len;
 1160|  17.5k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   150k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   150k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   150k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  4.29k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  4.29k|  size_t len = 0;
 1203|  4.29k|  const TiffComponent* pSubIfd = nullptr;
 1204|   146k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 146k, False: 4.29k]
  ------------------
 1205|   146k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 146k]
  ------------------
 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|   146k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   146k|  }
 1217|  4.29k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 0, False: 4.29k]
  ------------------
 1218|      0|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|      0|  }
 1220|  4.29k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 0, False: 4.29k]
  ------------------
 1221|      0|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|      0|  }
 1223|  4.29k|  return len;
 1224|  4.29k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   128k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   128k|  return 0;
 1228|   128k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  17.5k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  17.5k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 0, False: 17.5k]
  ------------------
 1245|      0|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  17.5k|  size_t len = pValue()->sizeDataArea();
 1248|  17.5k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 1.75k, False: 15.8k]
  ------------------
 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.75k|    DataBuf buf = pValue()->dataArea();
 1254|  1.75k|    ioWrapper.write(buf.c_data(), buf.size());
 1255|  1.75k|    size_t align = len & 1;  // Align image data to word boundary
 1256|  1.75k|    if (align)
  ------------------
  |  Branch (1256:9): [True: 961, False: 798]
  ------------------
 1257|    961|      ioWrapper.putb(0x0);
 1258|  1.75k|    len += align;
 1259|  15.8k|  } 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|  15.8k|    len = 0;
 1265|  15.8k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 0, False: 15.8k]
  ------------------
 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|  15.8k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  17.5k|  return len;
 1278|  17.5k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|   600k|size_t TiffComponent::size() const {
 1281|   600k|  return doSize();
 1282|   600k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  1.59M|size_t TiffEntryBase::doSize() const {
 1311|  1.59M|  return size_;
 1312|  1.59M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|  71.4k|size_t TiffImageEntry::doSize() const {
 1315|  71.4k|  return strips_.size() * 4;
 1316|  71.4k|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|   443k|size_t TiffComponent::sizeData() const {
 1370|   443k|  return doSizeData();
 1371|   443k|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|   390k|size_t TiffEntryBase::doSizeData() const {
 1378|   390k|  return 0;
 1379|   390k|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  53.5k|size_t TiffImageEntry::doSizeData() const {
 1382|  53.5k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  53.5k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 0, False: 53.5k]
  ------------------
 1385|      0|    len = sizeImage();
 1386|      0|  }
 1387|  53.5k|  return len;
 1388|  53.5k|}
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  1.90M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  1.90M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  1.90M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 1.16k, False: 1.90M]
  ------------------
 1456|  1.16k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 397, False: 766]
  ------------------
 1457|    397|      ti = comment;
 1458|    397|    }
 1459|  1.16k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  1.90M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 863k, False: 1.04M]
  ------------------
 1463|   863k|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 649, False: 863k]
  |  Branch (1463:26): [True: 8, False: 641]
  |  Branch (1463:58): [True: 184, False: 863k]
  |  Branch (1463:75): [True: 13, False: 171]
  ------------------
 1464|     21|    ti = Exiv2::signedByte;
 1465|     21|  }
 1466|  1.90M|  return ti;
 1467|  1.90M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  1.01M|TiffType toTiffType(TypeId typeId) {
 1470|  1.01M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 1.01M]
  ------------------
 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.01M|  return static_cast<TiffType>(typeId);
 1478|  1.01M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  1.46M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  1.46M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 486k, False: 976k]
  ------------------
 1482|   486k|    return lhs->tag() < rhs->tag();
 1483|   976k|  return lhs->idx() < rhs->idx();
 1484|  1.46M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|   834k|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|   834k|  return std::make_unique<TiffEntry>(tag, group);
 1488|   834k|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  12.6k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  12.6k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  12.6k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|   355k|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|   355k|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|   355k|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|   148k|  auto atc = [&] {
  474|   148k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 148k, False: 0]
  |  Branch (474:33): [True: 0, False: 148k]
  ------------------
  475|      0|      return std::move(object);
  476|      0|    }
  477|   148k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   148k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|   148k|  tc = [&] {
  486|   148k|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 0, False: 148k]
  ------------------
  487|      0|      return this->addNext(std::move(atc));
  488|   148k|    return this->addChild(std::move(atc));
  489|   148k|  }();
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  7.96k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  7.96k|  const TagInfo* tags = [=] {
 1439|  7.96k|    if (group == IfdId::gpsId)
 1440|  7.96k|      return Internal::gpsTagList();
 1441|  7.96k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  7.96k|  }();
 1443|  7.96k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 1.49k, False: 6.47k]
  ------------------
 1444|  64.2k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 63.9k, False: 331]
  ------------------
 1445|  63.9k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 1.16k, False: 62.7k]
  ------------------
 1446|  1.16k|        return tags + idx;
 1447|  6.80k|  return nullptr;
 1448|  7.96k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  7.96k|  const TagInfo* tags = [=] {
 1439|  7.96k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 688, False: 7.27k]
  ------------------
 1440|    688|      return Internal::gpsTagList();
 1441|  7.27k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 806, False: 6.47k]
  ------------------
 1442|  7.96k|  }();

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|   297k|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|   297k|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|   445k|  [[nodiscard]] uint32_t extendedTag() const {
   86|   445k|    return extendedTag_;
   87|   445k|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|   148k|  [[nodiscard]] IfdId group() const {
   90|   148k|    return group_;
   91|   148k|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  1.40M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  1.40M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  1.25M|  void setStart(const byte* pStart) {
  217|  1.25M|    pStart_ = const_cast<byte*>(pStart);
  218|  1.25M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|  25.5M|  [[nodiscard]] uint16_t tag() const {
  241|  25.5M|    return tag_;
  242|  25.5M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  5.72M|  [[nodiscard]] IfdId group() const {
  245|  5.72M|    return group_;
  246|  5.72M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  1.30M|  [[nodiscard]] byte* start() const {
  249|  1.30M|    return pStart_;
  250|  1.30M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|   874k|  void setOffset(size_t offset) {
  417|   874k|    offset_ = offset;
  418|   874k|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|   208k|  [[nodiscard]] TiffType tiffType() const {
  459|   208k|    return tiffType_;
  460|   208k|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  10.8k|  [[nodiscard]] size_t offset() const {
  466|  10.8k|    return offset_;
  467|  10.8k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|   750k|  [[nodiscard]] const byte* pData() const {
  477|   750k|    return pData_;
  478|   750k|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  4.37M|  [[nodiscard]] const Value* pValue() const {
  481|  4.37M|    return pValue_.get();
  482|  4.37M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|   863k|  void setIdx(int idx) {
  502|   863k|    idx_ = idx;
  503|   863k|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|   350k|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|   350k|    return storage_;
  542|   350k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  48.3k|  [[nodiscard]] uint16_t szTag() const {
  624|  48.3k|    return szTag_;
  625|  48.3k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  48.3k|  [[nodiscard]] IfdId szGroup() const {
  628|  48.3k|    return szGroup_;
  629|  48.3k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  51.8k|  [[nodiscard]] uint16_t dtTag() const {
  790|  51.8k|    return dtTag_;
  791|  51.8k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  51.8k|  [[nodiscard]] IfdId dtGroup() const {
  794|  51.8k|    return dtGroup_;
  795|  51.8k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  15.7k|  [[nodiscard]] bool hasNext() const {
  843|  15.7k|    return hasNext_;
  844|  15.7k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  3.43k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  3.43k|    imageByteOrder_ = byteOrder;
 1108|  3.43k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|   682k|  bool operator==(size_t idx) const {
 1218|   682k|    return idx_ == idx;
 1219|   682k|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|   351k|  [[nodiscard]] size_t tagStep() const {
 1235|   351k|    return elDefaultDef_.size(0, group_);
 1236|   351k|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|   353k|  void setDecoded(bool decoded) {
 1311|   353k|    decoded_ = decoded;
 1312|   353k|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  1.40M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  1.40M|    return arrayCfg_;
 1320|  1.40M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|  1.07k|  [[nodiscard]] const ArrayDef* def() const {
 1323|  1.07k|    return arrayDef_;
 1324|  1.07k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  1.07k|  [[nodiscard]] size_t defSize() const {
 1327|  1.07k|    return defSize_;
 1328|  1.07k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|  5.48k|  [[nodiscard]] bool decoded() const {
 1331|  5.48k|    return decoded_;
 1332|  5.48k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|   350k|  void setElDef(const ArrayDef& def) {
 1405|   350k|    elDef_ = def;
 1406|   350k|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|   350k|  void setElByteOrder(ByteOrder byteOrder) {
 1411|   350k|    elByteOrder_ = byteOrder;
 1412|   350k|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|   355k|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|   355k|    return &elDef_;
 1422|   355k|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|   355k|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|   355k|    return elByteOrder_;
 1428|   355k|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  15.8k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  15.8k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  15.8k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    325|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    325|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    325|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     61|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     61|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     61|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    847|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    847|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    847|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    183|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    183|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    183|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    227|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    227|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    227|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.1k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.1k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.1k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.75k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.75k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.75k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.65k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.65k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.65k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    963|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    963|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    963|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.7k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.7k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.7k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  22.2k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  22.2k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  22.2k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.29k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.29k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.29k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.63k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.63k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.63k|}
_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.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    939|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    939|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    939|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    539|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    539|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    539|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  5.92k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  5.92k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  5.92k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.12k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.12k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.12k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    918|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    918|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    918|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    699|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    699|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    699|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    586|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    586|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    586|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    306|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    306|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    306|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    838|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    838|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    838|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    402|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    402|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    402|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.71k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.71k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.71k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.93k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.93k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.93k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    484|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    484|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    484|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.79k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.79k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.79k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.76k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.76k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.76k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.99k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.99k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.99k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    793|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    793|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    793|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    475|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    475|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    475|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.85k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.85k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.85k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.80k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.80k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.80k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    352|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    352|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    352|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    268|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    268|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    268|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    326|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    326|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    326|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    262|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    262|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    262|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    265|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    265|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    265|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    509|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    509|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    509|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    564|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    564|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    564|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     98|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     98|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     98|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    351|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    351|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    351|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    227|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    227|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    227|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    161|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    161|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    161|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    517|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    517|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    517|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    355|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    355|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    355|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    235|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    235|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    235|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    144|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    144|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    144|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    246|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    246|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    246|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    277|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    277|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    277|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    428|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    428|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    428|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     83|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     83|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     83|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    224|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    224|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    224|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     89|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     89|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     89|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    253|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    253|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    253|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    236|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    236|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    236|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    264|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    264|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    264|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    100|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    100|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    100|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    193|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    193|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    193|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    214|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    214|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    214|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    302|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    302|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    302|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    487|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    487|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    487|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     80|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     80|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     80|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  3.27k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  3.27k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  3.27k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.82k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.82k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.82k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    637|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    637|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    637|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    409|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    409|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    409|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    295|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    295|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    295|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  2.10k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  2.10k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  2.10k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  5.10k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  5.10k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  5.10k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    318|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    318|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    318|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    102|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    102|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    102|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    117|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    117|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    117|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    301|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    301|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    301|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    161|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    161|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    161|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    251|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    251|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    251|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     72|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     72|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     72|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__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_5IfdIdE3EEENSt3__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_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    199|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    199|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    199|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     59|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     59|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     59|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    218|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    218|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    218|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    109|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    109|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    109|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    216|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    216|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    216|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    428|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    428|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    428|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     91|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     91|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     91|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     51|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     51|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     51|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    303|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    303|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    303|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     54|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     54|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     54|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     75|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     75|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     75|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     83|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     83|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     83|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     95|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     95|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     95|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     88|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     88|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     88|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     81|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     81|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     81|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    181|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    181|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    181|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     79|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     79|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     79|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     40|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     40|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     40|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    162|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    162|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    162|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     96|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     96|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     96|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     83|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     83|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     83|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     80|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     80|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    766|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    766|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    766|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    766|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    298|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    298|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    298|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    298|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    298|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    298|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     86|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     86|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     86|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     74|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     74|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     74|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    223|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    223|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    223|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    250|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    250|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    250|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    250|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    328|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    328|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    328|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    226|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    226|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    226|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     96|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     96|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     96|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    119|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    119|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    119|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    128|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    128|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    128|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    128|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     25|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     25|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     25|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    336|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    336|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    336|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    135|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    135|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    135|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     85|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     85|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     85|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__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_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     64|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     64|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     64|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    128|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    128|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    128|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     40|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     40|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     40|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     40|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     87|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     87|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     87|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     87|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    125|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    125|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    125|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    125|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     87|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     87|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     87|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     87|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     97|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     97|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     97|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     97|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    152|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    152|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    152|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    152|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    103|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    103|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    103|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    103|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     52|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     52|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     52|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     52|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     25|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     25|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     25|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     25|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     46|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     46|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     46|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     46|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     22|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     22|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     22|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     22|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     22|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     22|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     22|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     22|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     29|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     29|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     29|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     86|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     86|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     86|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     69|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     69|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     69|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     46|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     46|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     46|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     82|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     82|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     82|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     77|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     77|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     77|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     90|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     90|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     90|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     90|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     88|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     88|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_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_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    107|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    107|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    107|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    107|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    131|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    131|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    131|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    131|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    337|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    337|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    337|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    337|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     46|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     46|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     46|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     46|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    233|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    233|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    233|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    233|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     10|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     10|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     10|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    360|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    360|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    360|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    360|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    172|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    172|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    172|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    172|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     39|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     39|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     39|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     98|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     98|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     98|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     66|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     66|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     66|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     66|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    155|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    155|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    155|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  1.40M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  50.3k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  9.21k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  6.81k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|   148k|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|   148k|  return ifdId_ == md.ifdId();
   31|   148k|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|   862k|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|   862k|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|   862k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 10.8k, False: 851k]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  10.8k|    decoderFct = td->decoderFct_;
 1996|  10.8k|  }
 1997|   862k|  return decoderFct;
 1998|   862k|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|   148k|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|   148k|  EncoderFct encoderFct = nullptr;
 2002|   148k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 148k]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|      0|    encoderFct = td->encoderFct_;
 2005|      0|  }
 2006|   148k|  return encoderFct;
 2007|   148k|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  1.38M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  1.38M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  1.38M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  1.38M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 1.19M, False: 197k]
  ------------------
 2014|  1.19M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  1.19M|  }
 2016|  1.38M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 1.38M, False: 283]
  |  Branch (2016:7): [True: 1.37M, False: 8.89k]
  |  Branch (2016:37): [True: 1.37M, False: 8.61k]
  ------------------
 2017|  1.37M|    return i->second(tag, group);
 2018|  1.37M|  }
 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|  8.89k|  return nullptr;
 2028|  1.38M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|   148k|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|   148k|  TiffPath ret;
 2032|   297k|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 297k, Folded]
  ------------------
 2033|   297k|    ret.emplace(extendedTag, group);
 2034|   297k|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|   297k|    assert(ts != tiffTreeTable_.end());
 2036|   297k|    extendedTag = ts->second.second;
 2037|   297k|    group = ts->second.first;
 2038|   297k|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 148k, False: 148k]
  ------------------
 2039|   148k|      break;
 2040|   148k|    }
 2041|   297k|  }
 2042|   148k|  return ret;
 2043|   148k|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  13.1k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  13.1k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  13.1k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 12.8k, False: 317]
  ------------------
 2050|  12.8k|    ph = std::make_unique<TiffHeader>();
 2051|  12.8k|    pHeader = ph.get();
 2052|  12.8k|  }
 2053|       |
 2054|  13.1k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 12.7k, False: 410]
  ------------------
 2055|  12.7k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  12.7k|    rootDir->accept(decoder);
 2057|  12.7k|  }
 2058|  13.1k|  return pHeader->byteOrder();
 2059|       |
 2060|  13.1k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  4.38k|                                     OffsetWriter* pOffsetWriter) {
 2066|       |  /*
 2067|       |     1) parse the binary image, if one is provided, and
 2068|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2069|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2070|       |        writing"). If there is a parsed tree, it is only used to access the
 2071|       |        image data in this case.
 2072|       |   */
 2073|  4.38k|  WriteMethod writeMethod = wmIntrusive;
 2074|  4.38k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  4.38k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  4.38k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 0, False: 4.38k]
  ------------------
 2077|       |    // Attempt to update existing TIFF components based on metadata entries
 2078|      0|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2079|      0|    parsedTree->accept(encoder);
 2080|      0|    if (!encoder.dirty())
  ------------------
  |  Branch (2080:9): [True: 0, False: 0]
  ------------------
 2081|      0|      writeMethod = wmNonIntrusive;
 2082|      0|  }
 2083|  4.38k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 4.38k, False: 0]
  ------------------
 2084|  4.38k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  4.38k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 0, False: 4.38k]
  ------------------
 2086|       |      // Copy image tags from the original image to the composite
 2087|      0|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2088|      0|      parsedTree->accept(copier);
 2089|      0|    }
 2090|       |    // Add entries from metadata to composite
 2091|  4.38k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  4.38k|                        findEncoderFct);
 2093|  4.38k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  4.38k|    DataBuf header = pHeader->write();
 2096|  4.38k|    auto tempIo = MemIo();
 2097|  4.38k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  4.38k|    auto imageIdx(std::string::npos);
 2099|  4.38k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  4.38k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 0, False: 4.38k]
  ------------------
 2101|      0|      pOffsetWriter->writeOffsets(tempIo);
 2102|  4.38k|    io.transfer(tempIo);  // may throw
 2103|  4.38k|#ifndef SUPPRESS_WARNINGS
 2104|  4.38k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  4.38k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.38k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.38k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  4.38k|#endif
 2106|  4.38k|  }
 2107|      0|#ifndef SUPPRESS_WARNINGS
 2108|      0|  else {
 2109|      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()
  ------------------
 2110|      0|  }
 2111|  4.38k|#endif
 2112|  4.38k|  return writeMethod;
 2113|  4.38k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  17.5k|                                                 TiffHeaderBase* pHeader) {
 2117|  17.5k|  TiffComponent::UniquePtr rootDir;
 2118|  17.5k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 4.53k, False: 12.9k]
  |  Branch (2118:17): [True: 0, False: 12.9k]
  ------------------
 2119|  4.53k|    return rootDir;
 2120|  12.9k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 121, False: 12.8k]
  |  Branch (2120:38): [True: 139, False: 12.7k]
  ------------------
 2121|    260|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    260|  }
 2123|  12.7k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  12.7k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 12.7k, False: 0]
  ------------------
 2125|  12.7k|    rootDir->setStart(pData + pHeader->offset());
 2126|  12.7k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  12.7k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  12.7k|    rootDir->accept(reader);
 2129|  12.7k|    reader.postProcess();
 2130|  12.7k|  }
 2131|  12.7k|  return rootDir;
 2132|       |
 2133|  12.9k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  4.38k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  4.38k|  PrimaryGroups ret;
 2137|  4.38k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 4.38k, False: 0]
  ------------------
 2138|  4.38k|    return ret;
 2139|       |
 2140|      0|  static constexpr auto imageGroups = std::array{
 2141|      0|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2142|      0|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2143|      0|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2144|      0|  };
 2145|       |
 2146|      0|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2146:24): [True: 0, False: 0]
  ------------------
 2147|      0|    TiffFinder finder(0x00fe, imageGroup);
 2148|      0|    pSourceDir->accept(finder);
 2149|      0|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2150|      0|    if (!te)
  ------------------
  |  Branch (2150:9): [True: 0, False: 0]
  ------------------
 2151|      0|      continue;
 2152|      0|    const Value* pV = te->pValue();
 2153|      0|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2153:9): [True: 0, False: 0]
  |  Branch (2153:15): [True: 0, False: 0]
  |  Branch (2153:47): [True: 0, False: 0]
  |  Branch (2153:67): [True: 0, False: 0]
  ------------------
 2154|      0|      ret.push_back(te->group());
 2155|      0|    }
 2156|      0|  }
 2157|      0|  return ret;
 2158|  4.38k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   286k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   286k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   225k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   225k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 225k]
  |  Branch (2165:17): [True: 39, False: 225k]
  ------------------
 2166|     39|    return false;
 2167|       |
 2168|   225k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 16.3k, False: 209k]
  |  Branch (2168:26): [True: 16.0k, False: 281]
  ------------------
 2169|  16.0k|    byteOrder_ = littleEndian;
 2170|   209k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 29.1k, False: 180k]
  |  Branch (2170:33): [True: 28.8k, False: 373]
  ------------------
 2171|  28.8k|    byteOrder_ = bigEndian;
 2172|   180k|  } else {
 2173|   180k|    return false;
 2174|   180k|  }
 2175|  44.8k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|  44.8k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 44.8k, False: 13]
  |  Branch (2176:19): [True: 44.7k, False: 99]
  |  Branch (2176:33): [True: 2.19k, False: 42.5k]
  ------------------
 2177|  2.19k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  42.6k|  tag_ = t;
 2179|  42.6k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  42.6k|  return true;
 2182|  44.8k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  4.38k|DataBuf TiffHeaderBase::write() const {
 2185|  4.38k|  DataBuf buf(8);
 2186|  4.38k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 4.38k, False: 0]
  ------------------
 2187|  4.38k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 4.38k, False: 0]
  ------------------
 2188|  4.38k|      buf.write_uint8(0, 'I');
 2189|  4.38k|      break;
 2190|      0|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 0, False: 4.38k]
  ------------------
 2191|      0|      buf.write_uint8(0, 'M');
 2192|      0|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 4.38k]
  ------------------
 2194|      0|      break;
 2195|  4.38k|  }
 2196|  4.38k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  4.38k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  4.38k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  4.38k|  return buf;
 2200|  4.38k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|  56.2k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|  56.2k|  return byteOrder_;
 2220|  56.2k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  11.0k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  11.0k|  byteOrder_ = byteOrder;
 2224|  11.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  26.0k|uint32_t TiffHeaderBase::offset() const {
 2227|  26.0k|  return offset_;
 2228|  26.0k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  10.0k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  10.0k|  offset_ = offset;
 2232|  10.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  11.5k|uint16_t TiffHeaderBase::tag() const {
 2239|  11.5k|  return tag_;
 2240|  11.5k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|   231k|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|   231k|  const bool result = isTiffImageTagLookup(tag, group);
 2326|       |#ifdef EXIV2_DEBUG_MESSAGES
 2327|       |  if (result) {
 2328|       |    ExifKey key(tag, groupName(group));
 2329|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2330|       |  } else {
 2331|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2332|       |  }
 2333|       |#endif
 2334|   231k|  return result;
 2335|   231k|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   206k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   206k|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|   231k|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|   231k|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 0, False: 231k]
  ------------------
 2248|      0|    return false;
 2249|      0|  }
 2250|       |  //! List of TIFF image tags
 2251|   231k|  switch (tag) {
 2252|      0|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 0, False: 231k]
  ------------------
 2253|      0|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 0, False: 231k]
  ------------------
 2254|  9.38k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 9.38k, False: 222k]
  ------------------
 2255|  87.2k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 77.8k, False: 153k]
  ------------------
 2256|  93.7k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 6.44k, False: 225k]
  ------------------
 2257|  93.9k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 249, False: 231k]
  ------------------
 2258|  94.2k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 332, False: 231k]
  ------------------
 2259|  94.4k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 141, False: 231k]
  ------------------
 2260|   104k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 10.2k, False: 221k]
  ------------------
 2261|   104k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 150, False: 231k]
  ------------------
 2262|   105k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 163, False: 231k]
  ------------------
 2263|   112k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 7.94k, False: 223k]
  ------------------
 2264|   113k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 232, False: 231k]
  ------------------
 2265|   113k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 158, False: 231k]
  ------------------
 2266|   113k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 445, False: 231k]
  ------------------
 2267|   113k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 146, False: 231k]
  ------------------
 2268|   114k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 256, False: 231k]
  ------------------
 2269|   114k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 29, False: 231k]
  ------------------
 2270|   114k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 104, False: 231k]
  ------------------
 2271|   114k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 198, False: 231k]
  ------------------
 2272|   114k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 149, False: 231k]
  ------------------
 2273|   114k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 152, False: 231k]
  ------------------
 2274|   114k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 79, False: 231k]
  ------------------
 2275|   114k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 74, False: 231k]
  ------------------
 2276|   116k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 1.44k, False: 230k]
  ------------------
 2277|   116k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 97, False: 231k]
  ------------------
 2278|   116k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 157, False: 231k]
  ------------------
 2279|   116k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 82, False: 231k]
  ------------------
 2280|   116k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 105, False: 231k]
  ------------------
 2281|   117k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 1.00k, False: 230k]
  ------------------
 2282|   118k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 799, False: 231k]
  ------------------
 2283|   118k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 44, False: 231k]
  ------------------
 2284|   121k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 2.68k, False: 229k]
  ------------------
 2285|   122k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 748, False: 231k]
  ------------------
 2286|   122k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 122, False: 231k]
  ------------------
 2287|   122k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 146, False: 231k]
  ------------------
 2288|   122k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 89, False: 231k]
  ------------------
 2289|   122k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 293, False: 231k]
  ------------------
 2290|   123k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 411, False: 231k]
  ------------------
 2291|   123k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 111, False: 231k]
  ------------------
 2292|   123k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 48, False: 231k]
  ------------------
 2293|   123k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 129, False: 231k]
  ------------------
 2294|   123k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 326, False: 231k]
  ------------------
 2295|   123k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 117, False: 231k]
  ------------------
 2296|   123k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 62, False: 231k]
  ------------------
 2297|   124k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 306, False: 231k]
  ------------------
 2298|   127k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 2.91k, False: 228k]
  ------------------
 2299|   134k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 7.02k, False: 224k]
  ------------------
 2300|   146k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 12.6k, False: 219k]
  ------------------
 2301|   147k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 198, False: 231k]
  ------------------
 2302|   147k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 109, False: 231k]
  ------------------
 2303|   147k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 363, False: 231k]
  ------------------
 2304|   147k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 299, False: 231k]
  ------------------
 2305|   148k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 166, False: 231k]
  ------------------
 2306|   148k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 107, False: 231k]
  ------------------
 2307|   148k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 120, False: 231k]
  ------------------
 2308|   148k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 85, False: 231k]
  ------------------
 2309|   148k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 108, False: 231k]
  ------------------
 2310|   148k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 136, False: 231k]
  ------------------
 2311|   148k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 36, False: 231k]
  ------------------
 2312|   148k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 70, False: 231k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|   148k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 70, False: 231k]
  ------------------
 2315|   148k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 94, False: 231k]
  ------------------
 2316|   148k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 43, False: 231k]
  ------------------
 2317|   149k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 93, False: 231k]
  ------------------
 2318|   149k|      return true;
 2319|  82.8k|    default:
  ------------------
  |  Branch (2319:5): [True: 82.8k, False: 149k]
  ------------------
 2320|  82.8k|      return false;
 2321|   231k|  }
 2322|   231k|}

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

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

_ZN5Exiv28Internal11TiffVisitorD2Ev:
   64|  29.8k|  virtual ~TiffVisitor() = default;
_ZN5Exiv28Internal11TiffEncoderD2Ev:
  354|  4.38k|  ~TiffEncoder() override = default;
_ZN5Exiv28Internal11TiffRwStateC2ENS_9ByteOrderEm:
  537|  15.7k|  constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
  538|  15.7k|  }
_ZN5Exiv28Internal10TiffFinderC2EtNS_5IfdIdE:
  141|   135k|  constexpr TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  142|   135k|  }
_ZN5Exiv28Internal11TiffVisitorC2Ev:
   62|   165k|  TiffVisitor() = default;
_ZNK5Exiv28Internal10TiffFinder6resultEv:
  180|   135k|  [[nodiscard]] TiffComponent* result() const {
  181|   135k|    return tiffComponent_;
  182|   135k|  }
_ZNK5Exiv28Internal11TiffEncoder9byteOrderEv:
  457|   140k|  [[nodiscard]] ByteOrder byteOrder() const {
  458|   140k|    return byteOrder_;
  459|   140k|  }
_ZNK5Exiv28Internal11TiffEncoder11writeMethodEv:
  466|  20.4k|  [[nodiscard]] WriteMethod writeMethod() const {
  467|  20.4k|    return writeMethod_;
  468|  20.4k|  }
_ZNK5Exiv28Internal11TiffRwState9byteOrderEv:
  547|  3.99M|  [[nodiscard]] ByteOrder byteOrder() const {
  548|  3.99M|    return byteOrder_;
  549|  3.99M|  }
_ZNK5Exiv28Internal11TiffRwState10baseOffsetEv:
  561|   683k|  [[nodiscard]] size_t baseOffset() const {
  562|   683k|    return baseOffset_;
  563|   683k|  }

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  1.76M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  1.76M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 1.01M, False: 750k]
  ------------------
   88|  1.01M|    return tit->size_;
   89|   750k|  return 0;
   90|  1.76M|}
_ZN5Exiv27DataBufC2Em:
   92|   531k|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|   531k|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  52.6k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  52.6k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  14.2k|void DataBuf::alloc(size_t size) {
   99|  14.2k|  pData_.resize(size);
  100|  14.2k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   109k|void DataBuf::resize(size_t size) {
  103|   109k|  pData_.resize(size);
  104|   109k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  29.6k|void DataBuf::reset() {
  107|  29.6k|  pData_.clear();
  108|  29.6k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|   863k|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|   863k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 863k]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|   863k|  return pData_[offset];
  115|   863k|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|  2.51M|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|  2.51M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 2.51M]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|  2.51M|  pData_[offset] = x;
  122|  2.51M|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   315k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   315k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 315k]
  |  Branch (125:28): [True: 3, False: 315k]
  ------------------
  126|      3|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      3|  }
  128|   315k|  return getUShort(&pData_[offset], byteOrder);
  129|   315k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  4.38k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  4.38k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 4.38k]
  |  Branch (132:28): [True: 0, False: 4.38k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  4.38k|  us2Data(&pData_[offset], x, byteOrder);
  136|  4.38k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  138|   234k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  139|   234k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (139:7): [True: 3, False: 234k]
  |  Branch (139:28): [True: 3, False: 234k]
  ------------------
  140|      6|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      6|  }
  142|   234k|  return getULong(&pData_[offset], byteOrder);
  143|   234k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  4.38k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  4.38k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 4.38k]
  |  Branch (146:28): [True: 0, False: 4.38k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  4.38k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  4.38k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  5.12k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  5.12k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 5.12k]
  |  Branch (153:28): [True: 0, False: 5.12k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  5.12k|  return getULongLong(&pData_[offset], byteOrder);
  157|  5.12k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   329k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   329k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 329k]
  |  Branch (167:34): [True: 0, False: 329k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   329k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   329k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  4.85M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  4.85M|  return const_cast<byte*>(c_data(offset));
  175|  4.85M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  5.07M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  5.07M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 18.2k, False: 5.05M]
  |  Branch (178:25): [True: 759, False: 5.05M]
  ------------------
  179|  19.0k|    return nullptr;
  180|  19.0k|  }
  181|  5.05M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 5.05M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  5.05M|  return &pData_[offset];
  185|  5.05M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  68.6k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  68.6k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  68.6k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|  8.51M|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|  8.51M|  return os << r.first << "/" << r.second;
  212|  8.51M|}
_ZN5Exiv2rsERNSt3__113basic_istreamIcNS0_11char_traitsIcEEEERNS0_4pairIiiEE:
  235|     73|std::istream& operator>>(std::istream& is, Rational& r) {
  236|     73|  return fromStreamToRational(is, r);
  237|     73|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|  4.48k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|  4.48k|  return os << r.first << "/" << r.second;
  241|  4.48k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  3.66M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  3.66M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  3.66M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  3.53M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  3.53M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 1.21M, False: 2.32M]
  ------------------
  253|  1.21M|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|  1.21M|  }
  255|  2.32M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  3.53M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  33.9k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  33.9k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 4.80k, False: 29.1k]
  ------------------
  260|  4.80k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  4.80k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  4.80k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  4.80k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  4.80k|  }
  265|  29.1k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  29.1k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  29.1k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  29.1k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  33.9k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|   498k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|   498k|  uint32_t nominator = getULong(buf, byteOrder);
  273|   498k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|   498k|  return {nominator, denominator};
  275|   498k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|   309k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|   309k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 291k, False: 17.6k]
  ------------------
  279|   291k|    return buf[1] << 8 | buf[0];
  280|   291k|  }
  281|  17.6k|  return buf[0] << 8 | buf[1];
  282|   309k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|   577k|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|   577k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 347k, False: 230k]
  ------------------
  286|   347k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|   347k|  }
  288|   230k|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|   577k|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|   235k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|   235k|  int32_t nominator = getLong(buf, byteOrder);
  293|   235k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|   235k|  return {nominator, denominator};
  295|   235k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  82.8k|float getFloat(const byte* buf, ByteOrder byteOrder) {
  298|       |  // This algorithm assumes that the internal representation of the float
  299|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  300|       |  // required by the C++ standard.
  301|  82.8k|#ifdef __cpp_lib_bit_cast
  302|  82.8k|  return std::bit_cast<float>(getULong(buf, byteOrder));
  303|       |#else
  304|       |  union {
  305|       |    uint32_t ul_;
  306|       |    float f_;
  307|       |  } u;
  308|       |  u.ul_ = getULong(buf, byteOrder);
  309|       |  return u.f_;
  310|       |#endif
  311|  82.8k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|  34.7k|double getDouble(const byte* buf, ByteOrder byteOrder) {
  314|       |  // This algorithm assumes that the internal representation of the double
  315|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  316|       |  // required by the C++ standard.
  317|  34.7k|#ifdef __cpp_lib_bit_cast
  318|  34.7k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 3.02k, False: 31.7k]
  ------------------
  319|  3.02k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  3.02k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  3.02k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  3.02k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|  31.7k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|  31.7k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|  31.7k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|  31.7k|                               static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]));
  327|       |#else
  328|       |  union {
  329|       |    uint64_t ull_;
  330|       |    double d_;
  331|       |  } u;
  332|       |  u.ull_ = 0;
  333|       |  if (byteOrder == littleEndian) {
  334|       |    u.ull_ = static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  335|       |             static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  336|       |             static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  337|       |             static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  338|       |  } else {
  339|       |    u.ull_ = static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  340|       |             static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  341|       |             static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  342|       |             static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  343|       |  }
  344|       |  return u.d_;
  345|       |#endif
  346|  34.7k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|   471k|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|   471k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 471k, False: 404]
  ------------------
  350|   471k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|   471k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|   471k|  } else {
  353|    404|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|    404|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|    404|  }
  356|   471k|  return 2;
  357|   471k|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|   333k|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|   333k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 332k, False: 976]
  ------------------
  361|   332k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|   332k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|   332k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|   332k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|   332k|  } else {
  366|    976|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|    976|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|    976|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|    976|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|    976|  }
  371|   333k|  return 4;
  372|   333k|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|  18.5k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|  18.5k|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|  18.5k|  o += ul2Data(buf + o, l.second, byteOrder);
  392|  18.5k|  return o;
  393|  18.5k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|  13.5k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|  13.5k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 13.2k, False: 314]
  ------------------
  397|  13.2k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|  13.2k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|  13.2k|  } else {
  400|    314|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|    314|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|    314|  }
  403|  13.5k|  return 2;
  404|  13.5k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|   365k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|   365k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 364k, False: 758]
  ------------------
  408|   364k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|   364k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|   364k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|   364k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|   364k|  } else {
  413|    758|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  414|    758|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  415|    758|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  416|    758|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  417|    758|  }
  418|   365k|  return 4;
  419|   365k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|  86.9k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|  86.9k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|  86.9k|  o += l2Data(buf + o, l.second, byteOrder);
  424|  86.9k|  return o;
  425|  86.9k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|  20.6k|size_t f2Data(byte* buf, float f, ByteOrder byteOrder) {
  428|       |  // This algorithm assumes that the internal representation of the float
  429|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  430|       |  // required by the C++ standard.
  431|  20.6k|#ifdef __cpp_lib_bit_cast
  432|  20.6k|  return ul2Data(buf, std::bit_cast<uint32_t>(f), byteOrder);
  433|       |#else
  434|       |  union {
  435|       |    uint32_t ul_;
  436|       |    float f_;
  437|       |  } u;
  438|       |  u.f_ = f;
  439|       |  return ul2Data(buf, u.ul_, byteOrder);
  440|       |#endif
  441|  20.6k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|  5.35k|size_t d2Data(byte* buf, double d, ByteOrder byteOrder) {
  444|       |  // This algorithm assumes that the internal representation of the double
  445|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  446|       |  // required by the C++ standard.
  447|  5.35k|  union {
  448|  5.35k|    uint64_t ull_;
  449|  5.35k|    double d_;
  450|  5.35k|  } u;
  451|  5.35k|  u.d_ = d;
  452|  5.35k|  uint64_t m = 0xff;
  453|  5.35k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 5.06k, False: 295]
  ------------------
  454|  5.06k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|  5.06k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|  5.06k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|  5.06k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|  5.06k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|  5.06k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|  5.06k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|  5.06k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|  5.06k|  } else {
  463|    295|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|    295|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|    295|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|    295|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|    295|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|    295|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|    295|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|    295|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|    295|  }
  472|  5.35k|  return 8;
  473|  5.35k|}
_ZN5Exiv28stringToIbEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  557|     63|bool stringTo<bool>(const std::string& s, bool& ok) {
  558|     63|  if (s.empty())
  ------------------
  |  Branch (558:7): [True: 0, False: 63]
  ------------------
  559|      0|    return false;
  560|     63|  auto lcs = Internal::lower(s); /* lowercase string */
  561|       |  /* handle the same values as xmp sdk */
  562|     63|  if (lcs == "false" || lcs == "f" || lcs == "0") {
  ------------------
  |  Branch (562:7): [True: 0, False: 63]
  |  Branch (562:25): [True: 1, False: 62]
  |  Branch (562:39): [True: 0, False: 62]
  ------------------
  563|      1|    ok = true;
  564|      1|    return false;
  565|      1|  }
  566|     62|  if (lcs == "true" || lcs == "t" || lcs == "1") {
  ------------------
  |  Branch (566:7): [True: 0, False: 62]
  |  Branch (566:24): [True: 2, False: 60]
  |  Branch (566:38): [True: 0, False: 60]
  ------------------
  567|      2|    ok = true;
  568|      2|    return true;
  569|      2|  }
  570|     60|  ok = false;
  571|     60|  return false;
  572|     62|}
_ZN5Exiv210parseInt64ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERb:
  574|    144|int64_t parseInt64(const std::string& s, bool& ok) {
  575|    144|  auto ret = stringTo<int64_t>(s, ok);
  576|    144|  if (ok)
  ------------------
  |  Branch (576:7): [True: 70, False: 74]
  ------------------
  577|     70|    return ret;
  578|       |
  579|     74|  auto f = stringTo<float>(s, ok);
  580|     74|  if (ok)
  ------------------
  |  Branch (580:7): [True: 1, False: 73]
  ------------------
  581|      1|    return static_cast<int64_t>(f);
  582|       |
  583|     73|  auto [r, st] = stringTo<Rational>(s, ok);
  584|     73|  if (ok) {
  ------------------
  |  Branch (584:7): [True: 10, False: 63]
  ------------------
  585|     10|    if (st <= 0) {
  ------------------
  |  Branch (585:9): [True: 3, False: 7]
  ------------------
  586|      3|      ok = false;
  587|      3|      return 0;
  588|      3|    }
  589|      7|    return static_cast<int64_t>(static_cast<float>(r) / st);
  590|     10|  }
  591|       |
  592|     63|  bool b = stringTo<bool>(s, ok);
  593|     63|  if (ok)
  ------------------
  |  Branch (593:7): [True: 3, False: 60]
  ------------------
  594|      3|    return b ? 1 : 0;
  ------------------
  |  Branch (594:12): [True: 2, False: 1]
  ------------------
  595|       |
  596|       |  // everything failed, return from stringTo<int64_t> is probably the best fit
  597|     60|  return ret;
  598|     63|}
_ZN5Exiv219floatToRationalCastEf:
  651|     22|Rational floatToRationalCast(float f) {
  652|       |  // Convert f to double because it simplifies the range checks
  653|       |  // below. (All int values can be losslessly converted to double, but
  654|       |  // sometimes get rounded when converted to float.)
  655|     22|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|     22|  int32_t den;
  658|     22|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 18, False: 4]
  ------------------
  659|     18|    den = 1000000;
  660|     18|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (660:14): [True: 0, False: 4]
  ------------------
  661|      0|    den = 10000;
  662|      4|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (662:14): [True: 0, False: 4]
  ------------------
  663|      0|    den = 100;
  664|      4|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (664:14): [True: 0, False: 4]
  ------------------
  665|      0|    den = 1;
  666|      4|  } else {
  667|      4|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (667:13): [True: 0, False: 4]
  ------------------
  668|      4|  }
  669|     18|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|     18|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|     18|  return {nom / g, den / g};
  673|     22|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|  21.7M|  bool operator==(Exiv2::TypeId typeId) const {
   35|  21.7M|    return typeId_ == typeId;
   36|  21.7M|  }
types.cpp:_ZN5Exiv2L20fromStreamToRationalINSt3__14pairIiiEEEERNS1_13basic_istreamIcNS1_11char_traitsIcEEEES8_RT_:
  214|     73|static std::istream& fromStreamToRational(std::istream& is, auto& r) {
  215|       |  // http://dev.exiv2.org/boards/3/topics/1912?r=1915
  216|     73|  if (std::tolower(is.peek()) == 'f') {
  ------------------
  |  Branch (216:7): [True: 11, False: 62]
  ------------------
  217|     11|    char F = 0;
  218|     11|    float f = 0.F;
  219|     11|    is >> F >> f;
  220|     11|    f = 2.0F * std::log2(f);
  221|     11|    r = Exiv2::floatToRationalCast(f);
  222|     62|  } else {
  223|     62|    int32_t nominator = 0;
  224|     62|    int32_t denominator = 0;
  225|     62|    char c('\0');
  226|     62|    is >> nominator >> c >> denominator;
  227|     62|    if (c != '/')
  ------------------
  |  Branch (227:9): [True: 42, False: 20]
  ------------------
  228|     42|      is.setstate(std::ios::failbit);
  229|     62|    if (is)
  ------------------
  |  Branch (229:9): [True: 15, False: 47]
  ------------------
  230|     15|      r = {nominator, denominator};
  231|     62|  }
  232|     73|  return is;
  233|     73|}

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  1.48M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  1.48M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|   986k|Value::UniquePtr Value::create(TypeId typeId) {
   23|   986k|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 986k]
  ------------------
   25|  2.53k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 2.53k, False: 983k]
  ------------------
   26|   294k|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 292k, False: 694k]
  ------------------
   27|   294k|      return std::make_unique<DataValue>(typeId);
   28|  14.0k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 14.0k, False: 972k]
  ------------------
   29|  14.0k|      return std::make_unique<AsciiValue>();
   30|  57.5k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 57.5k, False: 928k]
  ------------------
   31|  57.5k|      return std::make_unique<ValueType<uint16_t>>();
   32|  42.2k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 42.2k, False: 944k]
  ------------------
   33|  45.4k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 3.13k, False: 983k]
  ------------------
   34|  45.4k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  6.52k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 6.52k, False: 979k]
  ------------------
   36|  6.52k|      return std::make_unique<ValueType<URational>>();
   37|  7.66k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 7.66k, False: 978k]
  ------------------
   38|  7.66k|      return std::make_unique<DataValue>();
   39|  13.0k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 13.0k, False: 973k]
  ------------------
   40|  13.0k|      return std::make_unique<ValueType<int16_t>>();
   41|  9.10k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 9.10k, False: 977k]
  ------------------
   42|  9.10k|      return std::make_unique<ValueType<int32_t>>();
   43|  3.88k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 3.88k, False: 982k]
  ------------------
   44|  3.88k|      return std::make_unique<ValueType<Rational>>();
   45|  2.90k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 2.90k, False: 983k]
  ------------------
   46|  2.90k|      return std::make_unique<ValueType<float>>();
   47|  5.24k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 5.24k, False: 981k]
  ------------------
   48|  5.24k|      return std::make_unique<ValueType<double>>();
   49|  33.5k|    case string:
  ------------------
  |  Branch (49:5): [True: 33.5k, False: 952k]
  ------------------
   50|  33.5k|      return std::make_unique<StringValue>();
   51|  7.94k|    case date:
  ------------------
  |  Branch (51:5): [True: 7.94k, False: 978k]
  ------------------
   52|  7.94k|      return std::make_unique<DateValue>();
   53|  15.5k|    case time:
  ------------------
  |  Branch (53:5): [True: 15.5k, False: 970k]
  ------------------
   54|  15.5k|      return std::make_unique<TimeValue>();
   55|    394|    case comment:
  ------------------
  |  Branch (55:5): [True: 394, False: 986k]
  ------------------
   56|    394|      return std::make_unique<CommentValue>();
   57|  44.3k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 44.3k, False: 942k]
  ------------------
   58|  44.3k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 986k]
  ------------------
   60|  8.22k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 8.22k, False: 978k]
  ------------------
   61|  8.22k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 986k]
  ------------------
   62|  8.22k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 986k]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|   416k|    default:
  ------------------
  |  Branch (65:5): [True: 416k, False: 570k]
  ------------------
   66|   416k|      return std::make_unique<DataValue>(typeId);
   67|   986k|  }
   68|   986k|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|  2.22k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|  2.22k|  return -1;
   72|  2.22k|}
_ZNK5Exiv25Value8toStringEv:
   74|  27.5k|std::string Value::toString() const {
   75|  27.5k|  std::ostringstream os;
   76|  27.5k|  write(os);
   77|  27.5k|  ok_ = !os.fail();
   78|  27.5k|  return os.str();
   79|  27.5k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  20.0k|size_t Value::sizeDataArea() const {
   86|  20.0k|  return 0;
   87|  20.0k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|    137|DataBuf Value::dataArea() const {
   90|    137|  return {nullptr, 0};
   91|    137|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|   718k|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|   718k|}
_ZNK5Exiv29DataValue5countEv:
  100|  1.03M|size_t DataValue::count() const {
  101|  1.03M|  return size();
  102|  1.03M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|   718k|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|   718k|  value_.assign(buf, buf + len);
  107|   718k|  return 0;
  108|   718k|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|   128k|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|   128k|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|   128k|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  1.39M|size_t DataValue::size() const {
  128|  1.39M|  return value_.size();
  129|  1.39M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  1.91M|DataValue* DataValue::clone_() const {
  132|  1.91M|  return new DataValue(*this);
  133|  1.91M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.30k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.30k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.83k, False: 468]
  ------------------
  137|  1.83k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.83k|    os << static_cast<int>(value_.back());
  139|  1.83k|  }
  140|  2.30k|  return os;
  141|  2.30k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  36.8k|int64_t DataValue::toInt64(size_t n) const {
  149|  36.8k|  ok_ = true;
  150|  36.8k|  return value_.at(n);
  151|  36.8k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|   129k|uint32_t DataValue::toUint32(size_t n) const {
  154|   129k|  ok_ = true;
  155|   129k|  return value_.at(n);
  156|   129k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  2.92k|int StringValueBase::read(const std::string& buf) {
  173|  2.92k|  value_ = buf;
  174|  2.92k|  return 0;
  175|  2.92k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  43.5k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  43.5k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 43.5k, False: 0]
  ------------------
  180|  43.5k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  43.5k|  return 0;
  182|  43.5k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  2.42k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  2.42k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 1.65k, False: 764]
  ------------------
  186|  1.65k|    return 0;
  187|       |  // byteOrder not needed
  188|    764|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  2.42k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|  68.6k|size_t StringValueBase::count() const {
  192|  68.6k|  return size();
  193|  68.6k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|  75.2k|size_t StringValueBase::size() const {
  196|  75.2k|  return value_.size();
  197|  75.2k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  47.6k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  47.6k|  ok_ = true;
  205|  47.6k|  return value_.at(n);
  206|  47.6k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  6.93k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  6.93k|  ok_ = true;
  210|  6.93k|  return value_.at(n);
  211|  6.93k|}
_ZN5Exiv211StringValueC2Ev:
  223|  33.5k|StringValue::StringValue() : StringValueBase(string) {
  224|  33.5k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|  59.0k|StringValue* StringValue::clone_() const {
  230|  59.0k|  return new StringValue(*this);
  231|  59.0k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  14.0k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  14.0k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  3.33k|int AsciiValue::read(const std::string& buf) {
  240|  3.33k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  3.33k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 14, False: 3.31k]
  |  Branch (242:25): [True: 3.31k, False: 0]
  ------------------
  243|  3.33k|    value_ += '\0';
  244|  3.33k|  }
  245|  3.33k|  return 0;
  246|  3.33k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|  34.3k|AsciiValue* AsciiValue::clone_() const {
  249|  34.3k|  return new AsciiValue(*this);
  250|  34.3k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  9.61k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  9.61k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  9.61k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 2.67k, False: 6.93k]
  ------------------
  256|  2.67k|    pos = value_.size();
  257|  9.61k|  return os << value_.substr(0, pos);
  258|  9.61k|}
_ZN5Exiv212CommentValueC2Ev:
  292|    394|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|    394|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|    394|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|    394|  byteOrder_ = byteOrder;
  331|    394|  return StringValueBase::read(buf, len, byteOrder);
  332|    394|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|    790|CommentValue* CommentValue::clone_() const {
  411|    790|  return new CommentValue(*this);
  412|    790|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  21.2k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  21.2k|  xmpArrayType_ = xmpArrayType;
  416|  21.2k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  10.5k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  10.5k|  xmpStruct_ = xmpStruct;
  420|  10.5k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|  7.90k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|  7.90k|  return xmpArrayType_;
  424|  7.90k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  21.0k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  21.0k|  XmpArrayType xa = xaNone;
  428|  21.0k|  switch (typeId) {
  429|    314|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 314, False: 20.7k]
  ------------------
  430|    314|      xa = xaAlt;
  431|    314|      break;
  432|    603|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 603, False: 20.4k]
  ------------------
  433|    603|      xa = xaBag;
  434|    603|      break;
  435|  10.4k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 10.4k, False: 10.6k]
  ------------------
  436|  10.4k|      xa = xaSeq;
  437|  10.4k|      break;
  438|  9.68k|    default:
  ------------------
  |  Branch (438:5): [True: 9.68k, False: 11.3k]
  ------------------
  439|  9.68k|      break;
  440|  21.0k|  }
  441|  21.0k|  return xa;
  442|  21.0k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|  7.81k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|  7.81k|  return xmpStruct_;
  446|  7.81k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   157k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   157k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   732k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   732k|  std::string b = buf;
  478|   732k|  std::string type;
  479|   732k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 1.33k, False: 731k]
  ------------------
  480|  1.33k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  1.33k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  1.33k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 1.26k, False: 69]
  |  Branch (483:26): [True: 769, False: 496]
  ------------------
  484|    769|      type = type.substr(1);
  485|  1.33k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 1.21k, False: 121]
  |  Branch (485:26): [True: 88, False: 1.12k]
  ------------------
  486|     88|      type.pop_back();
  487|  1.33k|    b.clear();
  488|  1.33k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 673, False: 661]
  ------------------
  489|    673|      b = buf.substr(pos + 1);
  490|  1.33k|  }
  491|   732k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 1.21k, False: 731k]
  ------------------
  492|  1.21k|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 46, False: 1.16k]
  ------------------
  493|     46|      setXmpArrayType(XmpValue::xaAlt);
  494|  1.16k|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 38, False: 1.12k]
  ------------------
  495|     38|      setXmpArrayType(XmpValue::xaBag);
  496|  1.12k|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 107, False: 1.02k]
  ------------------
  497|    107|      setXmpArrayType(XmpValue::xaSeq);
  498|  1.02k|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 462, False: 560]
  ------------------
  499|    462|      setXmpStruct();
  500|    560|    } else {
  501|    560|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    560|    }
  503|  1.21k|  }
  504|   732k|  value_ = std::move(b);
  505|   732k|  return 0;
  506|   732k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|  7.85k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|  7.85k|  bool del = false;
  524|  7.85k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 43, False: 7.81k]
  ------------------
  525|     43|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 43, False: 0]
  ------------------
  526|     39|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 39, False: 4]
  ------------------
  527|     39|        os << "type=\"Alt\"";
  528|     39|        break;
  529|      0|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 0, False: 43]
  ------------------
  530|      0|        os << "type=\"Bag\"";
  531|      0|        break;
  532|      4|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 4, False: 39]
  ------------------
  533|      4|        os << "type=\"Seq\"";
  534|      4|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 43]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|     43|    }
  538|     43|    del = true;
  539|  7.81k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 0, False: 7.81k]
  ------------------
  540|      0|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 0, False: 0]
  ------------------
  541|      0|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 0, False: 0]
  ------------------
  542|      0|        os << "type=\"Struct\"";
  543|      0|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 0]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|      0|    }
  547|      0|    del = true;
  548|      0|  }
  549|  7.85k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 43, False: 7.81k]
  |  Branch (549:14): [True: 0, False: 43]
  ------------------
  550|      0|    os << " ";
  551|  7.85k|  return os << value_;
  552|  7.85k|}
_ZNK5Exiv212XmpTextValue7toInt64Em:
  554|    144|int64_t XmpTextValue::toInt64(size_t /*n*/) const {
  555|    144|  return parseInt64(value_, ok_);
  556|    144|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   323k|XmpTextValue* XmpTextValue::clone_() const {
  571|   323k|  return new XmpTextValue(*this);
  572|   323k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  10.9k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  10.9k|  setXmpArrayType(xmpArrayType(typeId));
  576|  10.9k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   379k|int XmpArrayValue::read(const std::string& buf) {
  579|   379k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 336k, False: 43.3k]
  ------------------
  580|   336k|    value_.push_back(buf);
  581|   379k|  return 0;
  582|   379k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|    202|size_t XmpArrayValue::count() const {
  589|    202|  return value_.size();
  590|    202|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    194|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    194|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 185, False: 9]
  ------------------
  594|    185|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    185|    os << value_.back();
  596|    185|  }
  597|    194|  return os;
  598|    194|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|  2.19k|std::string XmpArrayValue::toString(size_t n) const {
  601|  2.19k|  ok_ = true;
  602|  2.19k|  return value_.at(n);
  603|  2.19k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  21.5k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  21.5k|  return new XmpArrayValue(*this);
  623|  21.5k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|    946|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|    946|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    176|size_t LangAltValue::count() const {
  680|    176|  return value_.size();
  681|    176|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|     64|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|     64|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|     64|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 64]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|     64|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 64, False: 64]
  ------------------
  694|     64|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 64, False: 0]
  ------------------
  695|     64|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 64]
  ------------------
  696|      0|        os << ", ";
  697|     64|      os << "lang=\"" << lang << "\" " << s;
  698|     64|      first = false;
  699|     64|    }
  700|     64|  }
  701|     64|  return os;
  702|     64|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    206|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    206|  return toString("x-default");
  706|    206|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    206|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    206|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 30, False: 176]
  ------------------
  710|     30|    ok_ = true;
  711|     30|    return i->second;
  712|     30|  }
  713|    176|  ok_ = false;
  714|    176|  return "";
  715|    206|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  1.65k|LangAltValue* LangAltValue::clone_() const {
  738|  1.65k|  return new LangAltValue(*this);
  739|  1.65k|}
_ZN5Exiv29DateValueC2Ev:
  741|  7.94k|DateValue::DateValue() : Value(date) {
  742|  7.94k|  date_ = {};
  743|  7.94k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  7.94k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  7.94k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  7.94k|  return read(str);
  752|  7.94k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  7.94k|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|  7.94k|  size_t monthPos = 0;
  758|  7.94k|  size_t dayPos = 0;
  759|       |
  760|  7.94k|  auto printWarning = [] {
  761|  7.94k|#ifndef SUPPRESS_WARNINGS
  762|  7.94k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  7.94k|#endif
  764|  7.94k|  };
  765|       |
  766|  7.94k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 362, False: 7.58k]
  ------------------
  767|    362|    printWarning();
  768|    362|    return 1;
  769|    362|  }
  770|       |
  771|  7.58k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 2.38k, False: 5.19k]
  |  Branch (771:28): [True: 1.87k, False: 512]
  |  Branch (771:45): [True: 616, False: 1.25k]
  |  Branch (771:63): [True: 5.17k, False: 1.78k]
  ------------------
  772|  5.79k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 616, False: 5.17k]
  ------------------
  773|    616|      monthPos = 5;
  774|    616|      dayPos = 8;
  775|  5.17k|    } else {
  776|  5.17k|      monthPos = 4;
  777|  5.17k|      dayPos = 6;
  778|  5.17k|    }
  779|       |
  780|  5.79k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  5.79k|      for (size_t i = start; i < start + count; ++i) {
  782|  5.79k|        if (!std::isdigit(buf[i])) {
  783|  5.79k|          printWarning();
  784|  5.79k|          return 1;
  785|  5.79k|        }
  786|  5.79k|      }
  787|  5.79k|      dest = std::stoul(buf.substr(start, count));
  788|  5.79k|      return 0;
  789|  5.79k|    };
  790|       |
  791|  5.79k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 1.54k, False: 4.25k]
  |  Branch (791:42): [True: 1.63k, False: 2.61k]
  |  Branch (791:83): [True: 499, False: 2.12k]
  ------------------
  792|  3.67k|      printWarning();
  793|  3.67k|      return 1;
  794|  3.67k|    }
  795|       |
  796|  2.12k|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 718, False: 1.40k]
  |  Branch (796:29): [True: 597, False: 805]
  ------------------
  797|  1.31k|      date_.month = 0;
  798|  1.31k|      date_.day = 0;
  799|  1.31k|      printWarning();
  800|  1.31k|      return 1;
  801|  1.31k|    }
  802|    805|    return 0;
  803|  2.12k|  }
  804|  1.78k|  printWarning();
  805|  1.78k|  return 1;
  806|  7.58k|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|    899|DateValue* DateValue::clone_() const {
  835|    899|  return new DateValue(*this);
  836|    899|}
_ZN5Exiv29TimeValueC2Ev:
  877|  15.5k|TimeValue::TimeValue() : Value(time) {
  878|  15.5k|  time_ = {};
  879|  15.5k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  15.5k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  15.5k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  15.5k|  return read(str);
  888|  15.5k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  15.5k|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|  15.5k|  auto printWarning = [] {
  896|  15.5k|#ifndef SUPPRESS_WARNINGS
  897|  15.5k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  15.5k|#endif
  899|  15.5k|    return 1;
  900|  15.5k|  };
  901|       |
  902|  15.5k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 372, False: 15.2k]
  ------------------
  903|    372|    return printWarning();
  904|       |
  905|  15.2k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 253k, False: 9.85k]
  ------------------
  906|   253k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 248k, False: 5.74k]
  |  Branch (906:21): [True: 243k, False: 5.05k]
  |  Branch (906:33): [True: 229k, False: 14.0k]
  |  Branch (906:45): [True: 227k, False: 1.14k]
  |  Branch (906:57): [True: 5.37k, False: 222k]
  ------------------
  907|  5.37k|      return printWarning();
  908|       |
  909|  9.85k|  size_t mpos;
  910|  9.85k|  size_t spos;
  911|  9.85k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 4.31k, False: 5.53k]
  ------------------
  912|  4.31k|    mpos = 3;
  913|  4.31k|    spos = 6;
  914|  5.53k|  } else {
  915|  5.53k|    mpos = 2;
  916|  5.53k|    spos = 4;
  917|  5.53k|  }
  918|       |
  919|  9.85k|  try {
  920|  9.85k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  9.85k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 414, False: 9.43k]
  |  Branch (921:19): [True: 116, False: 9.32k]
  ------------------
  922|    400|      return printWarning();
  923|  9.45k|    time_.hour = hi;
  924|  9.45k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 9.05k, False: 393]
  ------------------
  925|  9.05k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  9.05k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 448, False: 8.61k]
  |  Branch (926:21): [True: 217, False: 8.39k]
  ------------------
  927|    596|        return printWarning();
  928|  8.46k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  8.46k|    } else {
  930|    393|      time_.minute = 0;
  931|    393|    }
  932|  8.85k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 6.76k, False: 2.08k]
  ------------------
  933|  6.76k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  6.76k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 293, False: 6.47k]
  |  Branch (934:21): [True: 281, False: 6.19k]
  ------------------
  935|    499|        return printWarning();
  936|  6.27k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  6.27k|    } else {
  938|  2.08k|      time_.second = 0;
  939|  2.08k|    }
  940|       |
  941|  8.35k|    auto fpos = buf.find('+');
  942|  8.35k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 5.76k, False: 2.58k]
  ------------------
  943|  5.76k|      fpos = buf.find('-');
  944|       |
  945|  8.35k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 7.16k, False: 1.19k]
  ------------------
  946|  7.16k|      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|  7.16k|      const bool negative = format.at(0) == '-';
  952|  7.16k|      auto posColon = format.find(':');
  953|  7.16k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (953:11): [True: 4.00k, False: 3.15k]
  ------------------
  954|       |        // Extended format
  955|  4.00k|        auto tzhi = std::stoi(format.substr(0, 3));
  956|  4.00k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (956:13): [True: 95, False: 3.90k]
  |  Branch (956:27): [True: 168, False: 3.74k]
  ------------------
  957|    213|          return printWarning();
  958|  3.79k|        time_.tzHour = tzhi;
  959|  3.79k|        if (format.size() > 3) {
  ------------------
  |  Branch (959:13): [True: 3.23k, False: 559]
  ------------------
  960|  3.23k|          int minute = std::stoi(format.substr(3));
  961|  3.23k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (961:15): [True: 2.23k, False: 999]
  |  Branch (961:29): [True: 290, False: 709]
  ------------------
  962|    589|            return printWarning();
  963|  2.64k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (963:28): [True: 532, False: 2.11k]
  ------------------
  964|  2.64k|        }
  965|  3.79k|      } else {
  966|       |        // Basic format
  967|  3.15k|        auto tzhi = std::stoi(format.substr(0, posColon));
  968|  3.15k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (968:13): [True: 468, False: 2.69k]
  |  Branch (968:27): [True: 165, False: 2.52k]
  ------------------
  969|    443|          return printWarning();
  970|  2.71k|        time_.tzHour = tzhi;
  971|  2.71k|        int minute = std::stoi(format.substr(posColon + 1));
  972|  2.71k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (972:13): [True: 832, False: 1.88k]
  |  Branch (972:27): [True: 671, False: 1.21k]
  ------------------
  973|  1.02k|          return printWarning();
  974|  1.69k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (974:26): [True: 1.05k, False: 644]
  ------------------
  975|  1.69k|      }
  976|  7.16k|    }
  977|  8.35k|  } catch (std::exception&) {
  978|       |    // std::stoi might throw an exception if the syntax is invalid.
  979|  2.73k|    return printWarning();
  980|  2.73k|  }
  981|  3.35k|  return 0;
  982|  9.85k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1017|  3.71k|TimeValue* TimeValue::clone_() const {
 1018|  3.71k|  return new TimeValue(*this);
 1019|  3.71k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  10.8k|  auto printWarning = [] {
  761|  10.8k|#ifndef SUPPRESS_WARNINGS
  762|  10.8k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  10.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 10.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  10.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  10.8k|#endif
  764|  10.8k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  12.6k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  41.5k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 32.5k, False: 8.99k]
  ------------------
  782|  32.5k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 3.67k, False: 28.9k]
  ------------------
  783|  3.67k|          printWarning();
  784|  3.67k|          return 1;
  785|  3.67k|        }
  786|  32.5k|      }
  787|  8.99k|      dest = std::stoul(buf.substr(start, count));
  788|  8.99k|      return 0;
  789|  12.6k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  12.2k|  auto printWarning = [] {
  896|  12.2k|#ifndef SUPPRESS_WARNINGS
  897|  12.2k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  12.2k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 12.2k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  12.2k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  12.2k|#endif
  899|  12.2k|    return 1;
  900|  12.2k|  };

_ZN5Exiv29WebPImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   78|    426|    Image(ImageType::webp, mdNone, std::move(io), params) {
   79|    426|}  // WebPImage::WebPImage
_ZNK5Exiv29WebPImage8mimeTypeEv:
   81|     51|std::string WebPImage::mimeType() const {
   82|     51|  return "image/webp";
   83|     51|}
_ZN5Exiv29WebPImage12readMetadataEv:
  476|    426|void WebPImage::readMetadata() {
  477|    426|  if (io_->open() != 0)
  ------------------
  |  Branch (477:7): [True: 0, False: 426]
  ------------------
  478|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  479|    426|  IoCloser closer(*io_);
  480|       |  // Ensure that this is the correct image type
  481|    426|  if (!isWebPType(*io_, true)) {
  ------------------
  |  Branch (481:7): [True: 0, False: 426]
  ------------------
  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|    426|  clearMetadata();
  487|       |
  488|    426|  byte data[12];
  489|    426|  DataBuf chunkId(5);
  490|    426|  chunkId.write_uint8(4, '\0');
  491|       |
  492|    426|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  493|       |
  494|    426|  const uint32_t filesize = Safe::add(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian), 8U);
  495|    426|  Internal::enforce(filesize <= io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  496|       |
  497|    426|  WebPImage::decodeChunks(filesize);
  498|       |
  499|    426|}  // WebPImage::readMetadata
_ZN5Exiv29WebPImage12decodeChunksEj:
  501|    396|void WebPImage::decodeChunks(uint32_t filesize) {
  502|    396|  DataBuf chunkId(5);
  503|    396|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  504|    396|  bool has_canvas_data = false;
  505|       |
  506|       |#ifdef EXIV2_DEBUG_MESSAGES
  507|       |  std::cout << "Reading metadata" << '\n';
  508|       |#endif
  509|       |
  510|    396|  chunkId.write_uint8(4, '\0');
  511|  2.56k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (511:10): [True: 2.22k, False: 340]
  |  Branch (511:25): [True: 2.16k, False: 56]
  ------------------
  512|  2.16k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  513|  2.16k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  514|       |
  515|  2.16k|    const uint32_t size = Exiv2::getULong(size_buff.data(), littleEndian);
  516|       |
  517|       |    // Check that `size` is within bounds.
  518|  2.16k|    Internal::enforce(io_->tell() <= filesize, Exiv2::ErrorCode::kerCorruptedMetadata);
  519|  2.16k|    Internal::enforce(size <= (filesize - io_->tell()), Exiv2::ErrorCode::kerCorruptedMetadata);
  520|       |
  521|  2.16k|    if (DataBuf payload(size); payload.empty()) {
  ------------------
  |  Branch (521:32): [True: 1.21k, False: 952]
  ------------------
  522|  1.21k|      io_->seek(size, BasicIo::cur);
  523|  1.21k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_canvas_data) {
  ------------------
  |  Branch (523:16): [True: 33, False: 919]
  |  Branch (523:66): [True: 27, False: 6]
  ------------------
  524|     27|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  525|       |
  526|     27|      has_canvas_data = true;
  527|     27|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  528|       |
  529|     27|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  530|       |
  531|       |      // Fetch width
  532|     27|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  533|     27|      size_buf.back() = 0;
  534|     27|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  535|       |
  536|       |      // Fetch height
  537|     27|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  538|     27|      size_buf.back() = 0;
  539|     27|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  540|    925|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_canvas_data) {
  ------------------
  |  Branch (540:16): [True: 22, False: 903]
  |  Branch (540:65): [True: 16, False: 6]
  ------------------
  541|     16|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  542|       |
  543|     16|      has_canvas_data = true;
  544|     16|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  545|     16|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  546|       |
  547|       |      // Fetch width""
  548|     16|      std::copy_n(payload.begin() + 6, 2, size_buf.begin());
  549|     16|      size_buf[2] = 0;
  550|     16|      size_buf[3] = 0;
  551|     16|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  552|       |
  553|       |      // Fetch height
  554|     16|      std::copy_n(payload.begin() + 8, 2, size_buf.begin());
  555|     16|      size_buf[2] = 0;
  556|     16|      size_buf[3] = 0;
  557|     16|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  558|    909|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_canvas_data) {
  ------------------
  |  Branch (558:16): [True: 38, False: 871]
  |  Branch (558:66): [True: 28, False: 10]
  ------------------
  559|     28|      Internal::enforce(size >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  560|       |
  561|     28|      has_canvas_data = true;
  562|     28|      std::array<byte, 2> size_buf_w;
  563|     28|      std::array<byte, 3> size_buf_h;
  564|       |
  565|     28|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  566|       |
  567|       |      // Fetch width
  568|     28|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  569|     28|      size_buf_w.back() &= 0x3F;
  570|     28|      pixelWidth_ = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  571|       |
  572|       |      // Fetch height
  573|     28|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  574|     28|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  575|     28|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  576|     28|      pixelHeight_ = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  577|    881|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_canvas_data) {
  ------------------
  |  Branch (577:16): [True: 20, False: 861]
  |  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|    871|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (594:16): [True: 25, False: 846]
  ------------------
  595|     25|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  596|     25|      this->setIccProfile(std::move(payload));
  597|    846|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (597:16): [True: 341, False: 505]
  ------------------
  598|    341|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  599|       |
  600|    341|      std::array<byte, 2> size_buff2;
  601|       |      // 4 meaningful bytes + 2 padding bytes
  602|    341|      auto exifLongHeader = std::array<byte, 6>{0xFF, 0x01, 0xFF, 0xE1, 0x00, 0x00};
  603|    341|      auto exifShortHeader = std::array<byte, 6>{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  604|    341|      const byte exifTiffLEHeader[] = {0x49, 0x49, 0x2A};        // "MM*"
  605|    341|      const byte exifTiffBEHeader[] = {0x4D, 0x4D, 0x00, 0x2A};  // "II\0*"
  606|    341|      size_t offset = 0;
  607|    341|      bool s_header = false;
  608|    341|      bool le_header = false;
  609|    341|      bool be_header = false;
  610|    341|      size_t pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 4);
  611|       |
  612|    341|      if (pos == std::string::npos) {
  ------------------
  |  Branch (612:11): [True: 321, False: 20]
  ------------------
  613|    321|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 6);
  614|    321|        if (pos != std::string::npos) {
  ------------------
  |  Branch (614:13): [True: 0, False: 321]
  ------------------
  615|      0|          s_header = true;
  616|      0|        }
  617|    321|      }
  618|    341|      if (pos == std::string::npos) {
  ------------------
  |  Branch (618:11): [True: 321, False: 20]
  ------------------
  619|    321|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffLEHeader, 3);
  620|    321|        if (pos != std::string::npos) {
  ------------------
  |  Branch (620:13): [True: 87, False: 234]
  ------------------
  621|     87|          le_header = true;
  622|     87|        }
  623|    321|      }
  624|    341|      if (pos == std::string::npos) {
  ------------------
  |  Branch (624:11): [True: 234, False: 107]
  ------------------
  625|    234|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffBEHeader, 4);
  626|    234|        if (pos != std::string::npos) {
  ------------------
  |  Branch (626:13): [True: 81, False: 153]
  ------------------
  627|     81|          be_header = true;
  628|     81|        }
  629|    234|      }
  630|       |
  631|    341|      if (s_header) {
  ------------------
  |  Branch (631:11): [True: 0, False: 341]
  ------------------
  632|      0|        offset += 6;
  633|      0|      }
  634|    341|      if (be_header || le_header) {
  ------------------
  |  Branch (634:11): [True: 81, False: 260]
  |  Branch (634:24): [True: 87, False: 173]
  ------------------
  635|    168|        offset += 12;
  636|    168|      }
  637|       |
  638|    341|      const size_t sizePayload = Safe::add(payload.size(), offset);
  639|    341|      DataBuf rawExifData(sizePayload);
  640|       |
  641|    341|      if (s_header) {
  ------------------
  |  Branch (641:11): [True: 0, False: 341]
  ------------------
  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|    341|      if (be_header || le_header) {
  ------------------
  |  Branch (647:11): [True: 81, False: 260]
  |  Branch (647:24): [True: 87, False: 173]
  ------------------
  648|    168|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  649|    168|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  650|    168|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  651|    168|        std::copy(exifShortHeader.begin(), exifShortHeader.end(), rawExifData.begin() + 6);
  652|    168|      }
  653|       |
  654|    341|      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|    341|      if (pos != std::string::npos) {
  ------------------
  |  Branch (661:11): [True: 188, False: 153]
  ------------------
  662|    188|        XmpData xmpData;
  663|    188|        ByteOrder bo = ExifParser::decode(exifData_, payload.c_data(pos), payload.size() - pos);
  664|    188|        setByteOrder(bo);
  665|    188|      } else {
  666|    153|#ifndef SUPPRESS_WARNINGS
  667|    153|        EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    153|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 153]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    153|  LogMsg(LogMsg::warn).os()
  ------------------
  668|    153|#endif
  669|    153|        exifData_.clear();
  670|    153|      }
  671|    505|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (671:16): [True: 17, False: 488]
  ------------------
  672|     17|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  673|     17|      xmpPacket_.assign(payload.c_str(), payload.size());
  674|     17|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (674:11): [True: 17, False: 0]
  |  Branch (674:34): [True: 17, False: 0]
  ------------------
  675|     17|#ifndef SUPPRESS_WARNINGS
  676|     17|        EXV_WARNING << "Failed to decode XMP metadata." << '\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()
  ------------------
  677|     17|#endif
  678|     17|      } else {
  679|       |#ifdef EXIV2_DEBUG_MESSAGES
  680|       |        std::cout << "Display Hex Dump [size:" << payload.size() << "]" << '\n';
  681|       |        std::cout << binaryToHex(payload.c_data(), payload.size());
  682|       |#endif
  683|      0|      }
  684|    488|    } else {
  685|    488|      io_->seek(size, BasicIo::cur);
  686|    488|    }
  687|       |
  688|  2.16k|    if (io_->tell() % 2)
  ------------------
  |  Branch (688:9): [True: 235, False: 1.92k]
  ------------------
  689|    235|      io_->seek(+1, BasicIo::cur);
  690|  2.16k|  }
  691|    396|}
_ZN5Exiv215newWebPInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  695|    426|Image::UniquePtr newWebPInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  696|    426|  auto image = std::make_unique<WebPImage>(std::move(io), params);
  697|    426|  if (!image->good()) {
  ------------------
  |  Branch (697:7): [True: 0, False: 426]
  ------------------
  698|      0|    return nullptr;
  699|      0|  }
  700|    426|  return image;
  701|    426|}
_ZN5Exiv210isWebPTypeERNS_7BasicIoEb:
  703|  24.3k|bool isWebPType(BasicIo& iIo, bool /*advance*/) {
  704|  24.3k|  if (iIo.size() < 12) {
  ------------------
  |  Branch (704:7): [True: 137, False: 24.1k]
  ------------------
  705|    137|    return false;
  706|    137|  }
  707|  24.1k|  const int32_t len = 4;
  708|  24.1k|  constexpr std::array<byte, len> RiffImageId{'R', 'I', 'F', 'F'};
  709|  24.1k|  constexpr std::array<byte, len> WebPImageId{'W', 'E', 'B', 'P'};
  710|  24.1k|  std::array<byte, len> webp;
  711|  24.1k|  std::array<byte, len> data;
  712|  24.1k|  std::array<byte, len> riff;
  713|  24.1k|  iIo.readOrThrow(riff.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  714|  24.1k|  iIo.readOrThrow(data.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  715|  24.1k|  iIo.readOrThrow(webp.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  716|  24.1k|  bool matched_riff = riff == RiffImageId;
  717|  24.1k|  bool matched_webp = webp == WebPImageId;
  718|  24.1k|  iIo.seek(-12, BasicIo::cur);
  719|  24.1k|  return matched_riff && matched_webp;
  ------------------
  |  Branch (719:10): [True: 2.13k, False: 22.0k]
  |  Branch (719:26): [True: 1.27k, False: 852]
  ------------------
  720|  24.3k|}
_ZN5Exiv29WebPImage13equalsWebPTagERKNS_7DataBufEPKc:
  729|  4.30k|bool WebPImage::equalsWebPTag(const Exiv2::DataBuf& buf, const char* str) {
  730|  7.16k|  for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (730:19): [True: 6.67k, False: 496]
  ------------------
  731|  6.67k|    if (toupper(buf.read_uint8(i)) != str[i])
  ------------------
  |  Branch (731:9): [True: 3.80k, False: 2.86k]
  ------------------
  732|  3.80k|      return false;
  733|    496|  return true;
  734|  4.30k|}
_ZN5Exiv29WebPImage15getHeaderOffsetEPKhmS2_m:
  797|  1.21k|size_t WebPImage::getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size) {
  798|  1.21k|  size_t pos = std::string::npos;  // error value
  799|  1.21k|  if (data_size < header_size) {
  ------------------
  |  Branch (799:7): [True: 195, False: 1.02k]
  ------------------
  800|    195|    return pos;
  801|    195|  }
  802|   866k|  for (size_t i = 0; i < data_size - header_size; i++) {
  ------------------
  |  Branch (802:22): [True: 865k, False: 834]
  ------------------
  803|   865k|    if (memcmp(header, &data[i], header_size) == 0) {
  ------------------
  |  Branch (803:9): [True: 188, False: 865k]
  ------------------
  804|    188|      pos = i;
  805|    188|      break;
  806|    188|    }
  807|   865k|  }
  808|  1.02k|  return pos;
  809|  1.21k|}

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   169k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   169k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 124k, False: 44.3k]
  ------------------
  253|   124k|    value_ = pValue->clone();
  254|   169k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   221k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   221k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 221k, False: 0]
  ------------------
  258|   221k|    key_ = rhs.key_->clone();  // deep copy
  259|   221k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 221k, False: 0]
  ------------------
  260|   221k|    value_ = rhs.value_->clone();  // deep copy
  261|   221k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   169k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   169k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   221k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   221k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   391k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  16.1M|std::string Xmpdatum::key() const {
  291|  16.1M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 16.1M, False: 0]
  ------------------
  292|  16.1M|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|  1.71k|TypeId Xmpdatum::typeId() const {
  319|  1.71k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 1.71k, False: 0]
  ------------------
  320|  1.71k|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|    378|size_t Xmpdatum::count() const {
  331|    378|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 378, False: 0]
  ------------------
  332|    378|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  338|  1.70k|std::string Xmpdatum::toString() const {
  339|  1.70k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (339:10): [True: 1.70k, False: 0]
  ------------------
  340|  1.70k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  342|  2.39k|std::string Xmpdatum::toString(size_t n) const {
  343|  2.39k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 2.39k, False: 0]
  ------------------
  344|  2.39k|}
_ZNK5Exiv28Xmpdatum7toInt64Em:
  346|    144|int64_t Xmpdatum::toInt64(size_t n) const {
  347|    144|  return p_->value_ ? p_->value_->toInt64(n) : -1;
  ------------------
  |  Branch (347:10): [True: 144, False: 0]
  ------------------
  348|    144|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|  9.60k|const Value& Xmpdatum::value() const {
  363|  9.60k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 9.60k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|  9.60k|  return *p_->value_;
  366|  9.60k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   629k|int Xmpdatum::setValue(const std::string& value) {
  383|   629k|  XmpProperties::XmpLock lock;
  384|   629k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 44.3k, False: 585k]
  ------------------
  385|  44.3k|    TypeId type = xmpText;
  386|  44.3k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 44.3k, False: 0]
  ------------------
  387|  44.3k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  44.3k|    }
  389|  44.3k|    p_->value_ = Value::create(type);
  390|  44.3k|  }
  391|   629k|  return p_->value_->read(value);
  392|   629k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   631k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   631k|  XmpProperties::XmpLock lock;
  396|   631k|  XmpKey xmpKey(key, lock);
  397|   631k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   631k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 44.3k, False: 586k]
  ------------------
  399|  44.3k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  44.3k|  }
  401|   586k|  return *pos;
  402|   631k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  8.22k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  8.22k|  XmpProperties::XmpLock lock;
  406|  8.22k|  return addUnlocked(key, value, lock);
  407|  8.22k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   124k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   124k|  xmpMetadata_.emplace_back(key, value);
  411|   124k|  return 0;
  412|   124k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  33.4k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  33.4k|  XmpProperties::XmpLock lock;
  426|  33.4k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  33.4k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   221k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   221k|  XmpProperties::XmpLock lock;
  431|   221k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   221k|}
_ZN5Exiv27XmpData5clearEv:
  434|  37.1k|void XmpData::clear() {
  435|  37.1k|  XmpProperties::XmpLock lock;
  436|  37.1k|  clearUnlocked(lock);
  437|  37.1k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  51.0k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  51.0k|  xmpMetadata_.clear();
  441|  51.0k|  nsBindings_.clear();
  442|  51.0k|}
_ZNK5Exiv27XmpData3endEv:
  457|  33.4k|XmpData::const_iterator XmpData::end() const {
  458|  33.4k|  return xmpMetadata_.end();
  459|  33.4k|}
_ZNK5Exiv27XmpData5emptyEv:
  461|  6.08k|bool XmpData::empty() const {
  462|  6.08k|  XmpProperties::XmpLock lock;
  463|  6.08k|  return emptyUnlocked(lock);
  464|  6.08k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  466|  10.4k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  467|  10.4k|  return xmpMetadata_.empty();
  468|  10.4k|}
_ZN5Exiv27XmpData5beginEv:
  479|  1.76k|XmpData::iterator XmpData::begin() {
  480|  1.76k|  return xmpMetadata_.begin();
  481|  1.76k|}
_ZN5Exiv27XmpData3endEv:
  483|   223k|XmpData::iterator XmpData::end() {
  484|   223k|  return xmpMetadata_.end();
  485|   223k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  536|  18.3k|void xmpToolkitEnsureInitialized() {
  537|  18.3k|  static XmpToolkitLifetimeManager instance;
  538|  18.3k|  (void)instance;
  539|  18.3k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  661|  15.1k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  662|  15.1k|  try {
  663|  15.1k|    xmpData.setPacket(xmpPacket);
  664|  15.1k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (664:9): [True: 1.20k, False: 13.9k]
  ------------------
  665|  1.20k|      xmpData.clear();
  666|  1.20k|      return 0;
  667|  1.20k|    }
  668|       |
  669|       |    // Acquire Giant Lock
  670|  13.9k|    XmpProperties::XmpLock lock;
  671|  13.9k|    try {
  672|  13.9k|      xmpToolkitEnsureInitialized();
  673|  13.9k|    } catch (const Error&) {
  674|      0|#ifndef SUPPRESS_WARNINGS
  675|      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()
  ------------------
  676|      0|#endif
  677|      0|      return 2;
  678|      0|    }
  679|       |
  680|  13.9k|    xmpData.clearUnlocked(lock);
  681|       |
  682|       |    // Make sure the unterminated substring is used
  683|  13.9k|    size_t len = xmpPacket.size();
  684|   190k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (684:12): [True: 190k, False: 49]
  |  Branch (684:23): [True: 176k, False: 13.9k]
  ------------------
  685|   176k|      --len;
  686|       |
  687|  13.9k|    XMLValidator::check(xmpPacket.data(), len);
  688|  13.9k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  689|  13.9k|    SXMPIterator iter(meta);
  690|  13.9k|    std::string schemaNs;
  691|  13.9k|    std::string propPath;
  692|  13.9k|    std::string propValue;
  693|  13.9k|    XMP_OptionBits opt = 0;
  694|   142k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (694:12): [True: 128k, False: 13.9k]
  ------------------
  695|   128k|      printNode(schemaNs, propPath, propValue, opt);
  696|   128k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (696:11): [True: 0, False: 128k]
  ------------------
  697|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  698|      0|      }
  699|   128k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (699:11): [True: 12.1k, False: 116k]
  ------------------
  700|       |        // Register unknown namespaces with Exiv2
  701|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  702|  12.1k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  703|  12.1k|        if (prefix.empty()) {
  ------------------
  |  Branch (703:13): [True: 8.21k, False: 3.89k]
  ------------------
  704|  8.21k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (704:15): [True: 0, False: 8.21k]
  ------------------
  705|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  706|  8.21k|          prefix.pop_back();
  707|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  708|       |          // already globally bound -- a built-in standard prefix, or one a prior
  709|       |          // explicit registerNs() established -- to a different URI.  Letting it
  710|       |          // would poison every later write and lookup in this process (the
  711|       |          // namespace-leak bug).  The packet's own binding is still captured
  712|       |          // per-instance below, so this object round-trips faithfully; we just
  713|       |          // don't pollute the global registry on a read.
  714|  8.21k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (714:15): [True: 24, False: 8.19k]
  ------------------
  715|     24|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  716|  8.21k|        }
  717|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  718|       |        // encode() can resolve each property's URI from the data it came from,
  719|       |        // rather than from the process-global registry which another image may
  720|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  721|  12.1k|        xmpData.nsBindings_[prefix] = schemaNs;
  722|  12.1k|        continue;
  723|  12.1k|      }
  724|   116k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  725|   116k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (725:11): [True: 946, False: 115k]
  ------------------
  726|       |        // Read Lang Alt property
  727|    946|        auto val = std::make_unique<LangAltValue>();
  728|    946|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  729|  18.1k|        while (count-- > 0) {
  ------------------
  |  Branch (729:16): [True: 17.2k, False: 935]
  ------------------
  730|       |          // Get the text
  731|  17.2k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  732|  17.2k|          printNode(schemaNs, propPath, propValue, opt);
  733|  17.2k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (733:15): [True: 0, False: 17.2k]
  |  Branch (733:28): [True: 0, False: 17.2k]
  |  Branch (733:54): [True: 11, False: 17.2k]
  ------------------
  734|     11|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  735|     11|          }
  736|  17.2k|          std::string text = propValue;
  737|       |          // Get the language qualifier
  738|  17.2k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  739|  17.2k|          printNode(schemaNs, propPath, propValue, opt);
  740|  17.2k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (740:15): [True: 0, False: 17.2k]
  |  Branch (740:15): [True: 0, False: 17.2k]
  |  Branch (740:28): [True: 0, False: 17.2k]
  |  Branch (740:54): [True: 0, False: 17.2k]
  ------------------
  741|  17.2k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (741:15): [True: 0, False: 17.2k]
  ------------------
  742|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  743|      0|          }
  744|  17.2k|          val->value_[propValue] = std::move(text);
  745|  17.2k|        }
  746|    935|        xmpData.addUnlocked(*key, val.get(), lock);
  747|    935|        continue;
  748|    946|      }
  749|   115k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (749:11): [True: 3.13k, False: 112k]
  |  Branch (749:35): [True: 3.13k, False: 0]
  |  Branch (749:66): [True: 3.13k, False: 0]
  ------------------
  750|       |        // Check if all elements are simple
  751|  3.13k|        bool simpleArray = true;
  752|  3.13k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  753|  3.13k|        std::string aSchemaNs;
  754|  3.13k|        std::string aPropPath;
  755|  3.13k|        std::string aPropValue;
  756|  3.13k|        XMP_OptionBits aOpt = 0;
  757|  14.1k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (757:16): [True: 11.4k, False: 2.71k]
  ------------------
  758|  11.4k|          if (propPath == aPropPath)
  ------------------
  |  Branch (758:15): [True: 3.13k, False: 8.29k]
  ------------------
  759|  3.13k|            continue;
  760|  8.29k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (760:15): [True: 243, False: 8.05k]
  |  Branch (760:42): [True: 178, False: 7.87k]
  |  Branch (760:73): [True: 0, False: 7.87k]
  ------------------
  761|  8.29k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (761:15): [True: 0, False: 7.87k]
  |  Branch (761:41): [True: 0, False: 7.87k]
  ------------------
  762|    421|            simpleArray = false;
  763|    421|            break;
  764|    421|          }
  765|  8.29k|        }
  766|  3.13k|        if (simpleArray) {
  ------------------
  |  Branch (766:13): [True: 2.71k, False: 421]
  ------------------
  767|       |          // Read the array into an XmpArrayValue
  768|  2.71k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  769|  2.71k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  770|  10.5k|          while (count-- > 0) {
  ------------------
  |  Branch (770:18): [True: 7.86k, False: 2.71k]
  ------------------
  771|  7.86k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  772|  7.86k|            printNode(schemaNs, propPath, propValue, opt);
  773|  7.86k|            val->read(propValue);
  774|  7.86k|          }
  775|  2.71k|          xmpData.addUnlocked(*key, val.get(), lock);
  776|  2.71k|          continue;
  777|  2.71k|        }
  778|  3.13k|      }
  779|       |
  780|   113k|      auto val = std::make_unique<XmpTextValue>();
  781|   113k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (781:11): [True: 9.68k, False: 103k]
  |  Branch (781:36): [True: 421, False: 102k]
  ------------------
  782|       |        // Create a metadatum with only XMP options
  783|  10.1k|        val->setXmpArrayType(xmpArrayType(opt));
  784|  10.1k|        val->setXmpStruct(xmpStruct(opt));
  785|  10.1k|        xmpData.addUnlocked(*key, val.get(), lock);
  786|  10.1k|        continue;
  787|  10.1k|      }
  788|   102k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (788:11): [True: 102k, False: 0]
  |  Branch (788:36): [True: 0, False: 0]
  ------------------
  789|   102k|        val->read(propValue);
  790|   102k|        xmpData.addUnlocked(*key, val.get(), lock);
  791|   102k|        continue;
  792|   102k|      }
  793|       |      // Don't let any node go by unnoticed
  794|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  795|   102k|    }  // iterate through all XMP nodes
  796|       |
  797|  13.9k|    return 0;
  798|  13.9k|  }
  799|  15.1k|#ifndef SUPPRESS_WARNINGS
  800|  15.1k|  catch (const Error& e) {
  801|     72|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (801:9): [True: 0, False: 72]
  ------------------
  802|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  803|      0|    }
  804|     72|    throw;
  805|  6.46k|  } catch (const XMP_Error& e) {
  806|  6.46k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  6.46k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 6.46k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  6.46k|  LogMsg(LogMsg::error).os()
  ------------------
  807|  6.46k|    xmpData.clear();
  808|  6.46k|    return 3;
  809|  6.46k|  }
  810|       |#else
  811|       |  catch (const XMP_Error&) {
  812|       |    xmpData.clear();
  813|       |    return 3;
  814|       |  }
  815|       |#endif  // SUPPRESS_WARNINGS
  816|  15.1k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  830|  4.38k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  831|  4.38k|  try {
  832|       |    // Acquire Giant Lock
  833|  4.38k|    XmpProperties::XmpLock lock;
  834|  4.38k|    try {
  835|  4.38k|      xmpToolkitEnsureInitialized();
  836|  4.38k|    } catch (const Error&) {
  837|      0|#ifndef SUPPRESS_WARNINGS
  838|      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()
  ------------------
  839|      0|#endif
  840|      0|      return 2;
  841|      0|    }
  842|       |
  843|  4.38k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (843:9): [True: 4.38k, False: 0]
  ------------------
  844|  4.38k|      xmpPacket.clear();
  845|  4.38k|      return 0;
  846|  4.38k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  847|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  848|      0|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (848:33): [True: 0, False: 0]
  ------------------
  849|       |#ifdef EXIV2_DEBUG_MESSAGES
  850|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  851|       |#endif
  852|       |      // registerNsImpl is safe since we hold the lock
  853|      0|      registerNsImpl(xmp, uri.prefix_);
  854|      0|    }
  855|       |
  856|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  857|       |    // the toolkit here.  Every URI they contain was already registered while its
  858|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  859|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  860|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  861|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  862|       |    // serialization of struct fields that still carry the file's prefix.
  863|      0|    SXMPMeta meta;
  864|      0|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (864:26): [True: 0, False: 0]
  ------------------
  865|      0|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  866|      0|      XMP_OptionBits options = 0;
  867|       |
  868|      0|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (868:11): [True: 0, False: 0]
  ------------------
  869|       |        // Encode Lang Alt property
  870|      0|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  871|      0|        if (!la)
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  873|       |
  874|      0|        int idx = 1;
  875|      0|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (875:40): [True: 0, False: 0]
  ------------------
  876|      0|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (876:15): [True: 0, False: 0]
  ------------------
  877|      0|            printNode(ns, xmp.tagName(), specs, 0);
  878|      0|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  879|      0|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  880|      0|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  881|      0|          }
  882|      0|        }
  883|      0|        continue;
  884|      0|      }
  885|       |
  886|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  887|      0|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  888|      0|      if (!val)
  ------------------
  |  Branch (888:11): [True: 0, False: 0]
  ------------------
  889|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  890|      0|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  891|      0|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (891:11): [True: 0, False: 0]
  |  Branch (891:37): [True: 0, False: 0]
  |  Branch (891:63): [True: 0, False: 0]
  ------------------
  892|      0|        printNode(ns, xmp.tagName(), "", options);
  893|      0|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  894|      0|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (894:30): [True: 0, False: 0]
  ------------------
  895|      0|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  896|      0|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  897|      0|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  898|      0|        }
  899|      0|        continue;
  900|      0|      }
  901|      0|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (901:11): [True: 0, False: 0]
  ------------------
  902|      0|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  903|      0|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (903:13): [True: 0, False: 0]
  |  Branch (903:33): [True: 0, False: 0]
  |  Branch (903:72): [True: 0, False: 0]
  ------------------
  904|      0|          printNode(ns, xmp.tagName(), "", options);
  905|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  906|      0|        } else {
  907|      0|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  908|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  909|      0|        }
  910|      0|        continue;
  911|      0|      }
  912|       |      // Don't let any Xmpdatum go by unnoticed
  913|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  914|      0|    }
  915|      0|    std::string tmpPacket;
  916|      0|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  917|      0|                           padding);  // throws
  918|      0|    xmpPacket = std::move(tmpPacket);
  919|       |
  920|      0|    return 0;
  921|      0|  }
  922|  4.38k|#ifndef SUPPRESS_WARNINGS
  923|  4.38k|  catch (const Error& /* e */) {
  924|      0|    throw;
  925|      0|  } catch (const XMP_Error& e) {
  926|      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()
  ------------------
  927|      0|    return 3;
  928|      0|  }
  929|       |#else
  930|       |  catch (const XMP_Error&) {
  931|       |    return 3;
  932|       |  }
  933|       |#endif  // SUPPRESS_WARNINGS
  934|  4.38k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1096|   116k|                                                      const XmpProperties::XmpLock& lock) {
 1097|   116k|  std::string property;
 1098|   116k|  std::string::size_type idx = propPath.find(':');
 1099|   116k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 116k]
  ------------------
 1100|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1101|      0|  }
 1102|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1103|   116k|  property = propPath.substr(idx + 1);
 1104|   116k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1105|   116k|  if (prefix.empty()) {
  ------------------
  |  Branch (1105:7): [True: 27.8k, False: 88.7k]
  ------------------
 1106|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1107|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1108|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1109|       |    // the property still gets a key; its URI is preserved per-instance.
 1110|  27.8k|    std::string toolkitPrefix;
 1111|  27.8k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1111:9): [True: 27.8k, False: 0]
  ------------------
 1112|  27.8k|      toolkitPrefix.pop_back();
 1113|  27.8k|      prefix = std::move(toolkitPrefix);
 1114|  27.8k|    }
 1115|  27.8k|  }
 1116|   116k|  if (prefix.empty()) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 116k]
  ------------------
 1117|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1118|      0|  }
 1119|   116k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1120|   116k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  16.0M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  16.0M|    return key_ == xmpdatum.key();
  203|  16.0M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|   886k|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|   886k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  13.9k|  static void check(const char* buf, size_t buflen) {
   67|  13.9k|    XMLValidator validator;
   68|  13.9k|    validator.check_internal(buf, buflen);
   69|  13.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  13.9k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  13.9k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 13.9k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  13.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  13.9k|  void check_internal(const char* buf, size_t buflen) {
  103|  13.9k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 13.9k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  13.9k|    XML_SetUserData(parser_, this);
  108|  13.9k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  13.9k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  13.9k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  13.9k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 3.61k, False: 10.3k]
  ------------------
  113|  3.61k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  3.61k|    }
  115|       |
  116|  13.9k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 3.61k, False: 10.3k]
  ------------------
  117|  3.61k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  3.61k|    }
  119|  13.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   127k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   127k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   127k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   127k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   127k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 226, False: 127k]
  ------------------
  123|    226|      setError("Too deeply nested");
  124|    226|    }
  125|   127k|    ++element_depth_;
  126|   127k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   116k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   116k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   116k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   116k|  void endElement(const XML_Char*) noexcept {
  129|   116k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 116k, False: 0]
  ------------------
  130|   116k|      --element_depth_;
  131|   116k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   116k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  44.8k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  44.8k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  44.8k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  44.8k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  44.8k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 609, False: 44.2k]
  ------------------
  138|    609|      setError("Too deeply nested");
  139|    609|    }
  140|  44.8k|    ++namespace_depth_;
  141|  44.8k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  35.4k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  35.4k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  35.4k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  35.4k|  void endNamespace(const XML_Char*) noexcept {
  144|  35.4k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 35.4k, False: 0]
  ------------------
  145|  35.4k|      --namespace_depth_;
  146|  35.4k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  35.4k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  4.44k|  void setError(const char* msg) {
   88|  4.44k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  4.44k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  4.44k|#ifndef SUPPRESS_WARNINGS
   91|  4.44k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  4.44k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.44k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.44k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  4.44k|#endif
   93|       |    // If this is the first error, then save it.
   94|  4.44k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 3.61k, False: 835]
  ------------------
   95|  3.61k|      haserror_ = true;
   96|  3.61k|      errmsg_ = msg;
   97|  3.61k|      errlinenum_ = errlinenum;
   98|  3.61k|      errcolnum_ = errcolnum;
   99|  3.61k|    }
  100|  4.44k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  13.9k|  ~XMLValidator() {
   84|  13.9k|    XML_ParserFree(parser_);
   85|  13.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  953|  10.1k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  954|  10.1k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  955|  10.1k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (955:7): [True: 9.68k, False: 421]
  ------------------
  956|  9.68k|    var = Exiv2::XmpValue::xsStruct;
  957|  9.68k|  }
  958|  10.1k|  return var;
  959|  10.1k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  973|  12.8k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  974|  12.8k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  975|  12.8k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (975:7): [True: 3.13k, False: 9.68k]
  ------------------
  976|  3.13k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (976:9): [True: 314, False: 2.81k]
  ------------------
  977|    314|      typeId = Exiv2::xmpAlt;
  978|  2.81k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (978:14): [True: 2.21k, False: 603]
  ------------------
  979|  2.21k|      typeId = Exiv2::xmpSeq;
  980|    603|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (980:14): [True: 603, False: 0]
  ------------------
  981|    603|      typeId = Exiv2::xmpBag;
  982|  3.13k|  }
  983|  12.8k|  return typeId;
  984|  12.8k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  986|  10.1k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  987|  10.1k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  988|  10.1k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1089|   171k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1090|   171k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   391k|  ~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.81k|    Image(ImageType::xmp, mdXmp, std::move(io), params) {
   31|  1.81k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (31:7): [True: 0, False: 1.81k]
  |  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.81k|}  // XmpSidecar::XmpSidecar
_ZNK5Exiv210XmpSidecar8mimeTypeEv:
   37|  4.77k|std::string XmpSidecar::mimeType() const {
   38|  4.77k|  return "application/rdf+xml";
   39|  4.77k|}
_ZN5Exiv210XmpSidecar12readMetadataEv:
   46|  1.81k|void XmpSidecar::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   49|       |#endif
   50|  1.81k|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 1.81k]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|  1.81k|  IoCloser closer(*io_);
   54|       |  // Ensure that this is the correct image type
   55|  1.81k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1.81k]
  ------------------
   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.81k|  std::string xmpPacket;
   62|  1.81k|  const long len = 64 * 1024;
   63|  1.81k|  auto buf = std::make_unique<byte[]>(len);
   64|  4.49k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (64:15): [True: 2.67k, False: 1.81k]
  ------------------
   65|  2.67k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   66|  2.67k|  }
   67|  1.81k|  if (io_->error())
  ------------------
  |  Branch (67:7): [True: 0, False: 1.81k]
  ------------------
   68|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   69|  1.81k|  clearMetadata();
   70|  1.81k|  xmpPacket_ = std::move(xmpPacket);
   71|  1.81k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (71:7): [True: 1.81k, False: 1]
  |  Branch (71:30): [True: 436, False: 1.37k]
  ------------------
   72|    436|#ifndef SUPPRESS_WARNINGS
   73|    436|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    436|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 436]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    436|  LogMsg(LogMsg::warn).os()
  ------------------
   74|    436|#endif
   75|    436|  }
   76|       |
   77|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   78|  83.7k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (78:24): [True: 83.7k, False: 1.81k]
  ------------------
   79|  83.7k|    std::string key(xmp.key());
   80|  83.7k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (80:9): [True: 6.41k, False: 77.3k]
  ------------------
   81|  6.41k|      dates_[key] = xmp.value().toString();
   82|  6.41k|    }
   83|  83.7k|  }
   84|       |
   85|  1.81k|  copyXmpToIptc(xmpData_, iptcData_);
   86|  1.81k|  copyXmpToExif(xmpData_, exifData_);
   87|  1.81k|}  // XmpSidecar::readMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  153|  1.81k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  154|  1.81k|  auto image = std::make_unique<XmpSidecar>(std::move(io), params);
  155|  1.81k|  if (!image->good()) {
  ------------------
  |  Branch (155:7): [True: 0, False: 1.81k]
  ------------------
  156|      0|    return nullptr;
  157|      0|  }
  158|  1.81k|  return image;
  159|  1.81k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  161|  21.0k|bool isXmpType(BasicIo& iIo, bool advance) {
  162|       |  /*
  163|       |    Check if the file starts with an optional XML declaration followed by
  164|       |    either an XMP header (<?xpacket ... ?>) or an <x:xmpmeta> element.
  165|       |
  166|       |    In addition, in order for empty XmpSidecar objects as created by
  167|       |    Exiv2 to pass the test, just an XML header is also considered ok.
  168|       |   */
  169|  21.0k|  const int32_t len = 80;
  170|  21.0k|  byte buf[len];
  171|  21.0k|  iIo.read(buf, xmlHdrCnt + 1);
  172|  21.0k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (172:7): [True: 292, False: 20.7k]
  |  Branch (172:20): [True: 3, False: 289]
  ------------------
  173|      3|    return true;
  174|      3|  }
  175|  21.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (175:7): [True: 0, False: 21.0k]
  |  Branch (175:22): [True: 289, False: 20.7k]
  ------------------
  176|    289|    return false;
  177|    289|  }
  178|  20.7k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  179|  20.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (179:7): [True: 0, False: 20.7k]
  |  Branch (179:22): [True: 19, False: 20.7k]
  ------------------
  180|     19|    return false;
  181|     19|  }
  182|       |  // Skip leading BOM
  183|  20.7k|  int32_t start = 0;
  184|  20.7k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (184:7): [True: 98, False: 20.6k]
  ------------------
  185|     98|    start = 3;
  186|     98|  }
  187|  20.7k|  bool rc = false;
  188|  20.7k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  189|  20.7k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (189:7): [True: 93, False: 20.6k]
  ------------------
  190|       |    // Forward to the next tag
  191|     93|    auto it = std::find(head.begin() + 5, head.end(), '<');
  192|     93|    if (it != head.end())
  ------------------
  |  Branch (192:9): [True: 83, False: 10]
  ------------------
  193|     83|      head = head.substr(std::distance(head.begin(), it));
  194|     93|  }
  195|  20.7k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (195:7): [True: 3.17k, False: 17.5k]
  |  Branch (195:40): [True: 2.26k, False: 15.2k]
  ------------------
  196|  5.44k|    rc = true;
  197|  5.44k|  }
  198|  20.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (198:7): [True: 20.7k, False: 0]
  |  Branch (198:19): [True: 0, False: 0]
  ------------------
  199|  20.7k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  200|  20.7k|  }
  201|  20.7k|  return rc;
  202|  20.7k|}

XMP_NewExpatAdapter:
   68|  10.3k|{
   69|  10.3k|	return new ExpatAdapter;
   70|  10.3k|}	// XMP_NewExpatAdapter
_ZN12ExpatAdapterC2Ev:
   74|  10.3k|ExpatAdapter::ExpatAdapter() : parser(0)
   75|  10.3k|{
   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|  10.3k|	this->parser = XML_ParserCreateNS ( 0, FullNameSeparator );
  ------------------
  |  |   33|  10.3k|#define FullNameSeparator	'@'
  ------------------
   85|  10.3k|	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: 10.3k]
  ------------------
   86|       |	
   87|  10.3k|	XML_SetUserData ( this->parser, this );
   88|       |	
   89|  10.3k|	XML_SetNamespaceDeclHandler ( this->parser, StartNamespaceDeclHandler, EndNamespaceDeclHandler );
   90|  10.3k|	XML_SetElementHandler ( this->parser, StartElementHandler, EndElementHandler );
   91|       |
   92|  10.3k|	XML_SetCharacterDataHandler ( this->parser, CharacterDataHandler );
   93|  10.3k|	XML_SetCdataSectionHandler ( this->parser, StartCdataSectionHandler, EndCdataSectionHandler );
   94|       |
   95|  10.3k|	XML_SetProcessingInstructionHandler ( this->parser, ProcessingInstructionHandler );
   96|  10.3k|	XML_SetCommentHandler ( this->parser, CommentHandler );
   97|       |
   98|  10.3k|	#if BanAllEntityUsage
   99|  10.3k|		XML_SetStartDoctypeDeclHandler ( this->parser, StartDoctypeDeclHandler );
  100|  10.3k|		isAborted = false;
  101|  10.3k|	#endif
  102|       |
  103|  10.3k|	this->parseStack.push_back ( &this->tree );	// Push the XML root node.
  104|       |
  105|  10.3k|}	// ExpatAdapter::ExpatAdapter
_ZN12ExpatAdapterD2Ev:
  110|  10.3k|{
  111|       |
  112|  10.3k|	if ( this->parser != 0 ) XML_ParserFree ( this->parser );
  ------------------
  |  Branch (112:7): [True: 10.3k, False: 0]
  ------------------
  113|  10.3k|	this->parser = 0;
  114|       |
  115|  10.3k|}	// ExpatAdapter::~ExpatAdapter
_ZN12ExpatAdapter11ParseBufferEPKvmb:
  126|  10.3k|{
  127|  10.3k|	enum XML_Status status;
  128|       |	
  129|  10.3k|	if ( length == 0 ) {	// Expat does not like empty buffers.
  ------------------
  |  Branch (129:7): [True: 0, False: 10.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|  10.3k|	status = XML_Parse ( this->parser, (const char *)buffer, length, last );
  136|       |	
  137|  10.3k|	#if BanAllEntityUsage
  138|  10.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: 10.3k]
  ------------------
  139|  10.3k|	#endif
  140|       |
  141|  10.3k|	if ( status != XML_STATUS_OK ) {
  ------------------
  |  Branch (141:7): [True: 41, False: 10.3k]
  ------------------
  142|       |	
  143|     41|		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|     41|		XMP_Throw ( errMsg, kXMPErr_BadXML );
  ------------------
  |  |  199|     41|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  167|       |
  168|      0|	}
  169|       |	
  170|  10.3k|}	// ExpatAdapter::ParseBuffer
ExpatAdapter.cpp:_ZL25StartNamespaceDeclHandlerPvPKcS1_:
  242|  35.2k|{
  243|  35.2k|	IgnoreParam(userData);
  ------------------
  |  |  117|  35.2k|#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|  35.2k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (252:7): [True: 158, False: 35.0k]
  ------------------
  253|  35.2k|	if ( uri == 0 ) return;	// Ignore, have xmlns:pre="", no URI to register.
  ------------------
  |  Branch (253:7): [True: 73, False: 35.1k]
  ------------------
  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|  35.1k|	if ( XMP_LitMatch ( uri, "http://purl.org/dc/1.1/" ) ) uri = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  |   96|  35.1k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  |  |  ------------------
  |  |  |  Branch (96:28): [True: 1.47k, False: 33.6k]
  |  |  ------------------
  ------------------
  263|  35.1k|	XMPMeta::RegisterNamespace ( uri, prefix );
  264|       |
  265|  35.1k|}	// StartNamespaceDeclHandler
ExpatAdapter.cpp:_ZL23EndNamespaceDeclHandlerPvPKc:
  270|  35.2k|{
  271|  35.2k|	IgnoreParam(userData);
  ------------------
  |  |  117|  35.2k|#define IgnoreParam(p)	(void)p
  ------------------
  272|       |
  273|       |	#if XMP_DebugBuild & DumpXMLParseEvents		// Avoid unused variable warning.
  274|       |		ExpatAdapter * thiz = (ExpatAdapter*)userData;
  275|       |	#endif
  276|       |
  277|  35.2k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (277:7): [True: 158, False: 35.0k]
  ------------------
  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|  35.2k|}	// EndNamespaceDeclHandler
ExpatAdapter.cpp:_ZL19StartElementHandlerPvPKcPS1_:
  293|   116k|{
  294|   116k|	XMP_Assert ( attrs != 0 );
  ------------------
  |  |  142|   116k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  295|   116k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  296|       |	
  297|   116k|	size_t attrCount = 0;
  298|   357k|	for ( XMP_StringPtr* a = attrs; *a != 0; ++a ) ++attrCount;
  ------------------
  |  Branch (298:34): [True: 241k, False: 116k]
  ------------------
  299|   116k|	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: 116k]
  ------------------
  300|   116k|	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|   116k|	XML_Node * parentNode = thiz->parseStack.back();
  316|   116k|	XML_Node * elemNode   = new XML_Node ( parentNode, "", kElemNode );
  317|       |	
  318|   116k|	SetQualName ( name, elemNode );
  319|       |	
  320|   236k|	for ( XMP_StringPtr* attr = attrs; *attr != 0; attr += 2 ) {
  ------------------
  |  Branch (320:37): [True: 120k, False: 116k]
  ------------------
  321|       |
  322|   120k|		XMP_StringPtr attrName = *attr;
  323|   120k|		XMP_StringPtr attrValue = *(attr+1);
  324|   120k|		XML_Node * attrNode = new XML_Node ( elemNode, "", kAttrNode );
  325|       |
  326|   120k|		SetQualName ( attrName, attrNode );
  327|   120k|		attrNode->value = attrValue;
  328|   120k|		if ( attrNode->name == "xml:lang" ) NormalizeLangValue ( &attrNode->value );
  ------------------
  |  Branch (328:8): [True: 50.6k, False: 70.2k]
  ------------------
  329|   120k|		elemNode->attrs.push_back ( attrNode );
  330|       |
  331|   120k|	}
  332|       |	
  333|   116k|	parentNode->content.push_back ( elemNode );
  334|   116k|	thiz->parseStack.push_back ( elemNode );
  335|       |	
  336|   116k|	if ( elemNode->name == "rdf:RDF" ) {
  ------------------
  |  Branch (336:7): [True: 9.95k, False: 106k]
  ------------------
  337|  9.95k|		thiz->rootNode = elemNode;
  338|  9.95k|		++thiz->rootCount;
  339|  9.95k|	}
  340|       |	#if XMP_DebugBuild
  341|       |		++thiz->elemNesting;
  342|       |	#endif
  343|       |
  344|   116k|}	// StartElementHandler
ExpatAdapter.cpp:_ZL11SetQualNamePKcP8XML_Node:
  187|   236k|{
  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|   236k|	size_t sepPos = strlen(fullName);
  199|  10.4M|	for ( --sepPos; sepPos > 0; --sepPos ) {
  ------------------
  |  Branch (199:18): [True: 10.4M, False: 6.43k]
  ------------------
  200|  10.4M|		if ( fullName[sepPos] == FullNameSeparator ) break;
  ------------------
  |  |   33|  10.4M|#define FullNameSeparator	'@'
  ------------------
  |  Branch (200:8): [True: 230k, False: 10.2M]
  ------------------
  201|  10.4M|	}
  202|       |
  203|   236k|	if ( fullName[sepPos] == FullNameSeparator ) {
  ------------------
  |  |   33|   236k|#define FullNameSeparator	'@'
  ------------------
  |  Branch (203:7): [True: 230k, False: 6.43k]
  ------------------
  204|       |
  205|   230k|		XMP_StringPtr prefix;
  206|   230k|		XMP_StringLen prefixLen;
  207|   230k|		XMP_StringPtr localPart = fullName + sepPos + 1;
  208|       |
  209|   230k|		node->ns.assign ( fullName, sepPos );
  210|   230k|		if ( node->ns == "http://purl.org/dc/1.1/" ) node->ns = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  Branch (210:8): [True: 4.10k, False: 226k]
  ------------------
  211|       |
  212|   230k|		bool found = XMPMeta::GetNamespacePrefix ( node->ns.c_str(), &prefix, &prefixLen );
  213|   230k|		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: 230k]
  ------------------
  214|   230k|		node->nsPrefixLen = prefixLen;	// ! Includes the ':'.
  215|       |		
  216|   230k|		node->name = prefix;
  217|   230k|		node->name += localPart;
  218|       |
  219|   230k|	} else {
  220|       |
  221|  6.43k|		node->name = fullName;	// The name is not in a namespace.
  222|       |	
  223|  6.43k|		if ( node->parent->name == "rdf:Description" ) {
  ------------------
  |  Branch (223:8): [True: 2.64k, False: 3.78k]
  ------------------
  224|  2.64k|			if ( node->name == "about" ) {
  ------------------
  |  Branch (224:9): [True: 626, False: 2.01k]
  ------------------
  225|    626|				node->ns   = kXMP_NS_RDF;
  226|    626|				node->name = "rdf:about";
  227|    626|				node->nsPrefixLen = 4;	// ! Include the ':'.
  228|  2.01k|			} else if ( node->name == "ID" ) {
  ------------------
  |  Branch (228:16): [True: 37, False: 1.98k]
  ------------------
  229|     37|				node->ns   = kXMP_NS_RDF;
  230|     37|				node->name = "rdf:ID";
  231|     37|				node->nsPrefixLen = 4;	// ! Include the ':'.
  232|     37|			}
  233|  2.64k|		}
  234|       |		
  235|  6.43k|	}
  236|       |
  237|   236k|}	// SetQualName
ExpatAdapter.cpp:_ZL17EndElementHandlerPvPKc:
  349|   116k|{
  350|   116k|	IgnoreParam(name);
  ------------------
  |  |  117|   116k|#define IgnoreParam(p)	(void)p
  ------------------
  351|       |	
  352|   116k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  353|       |
  354|       |	#if XMP_DebugBuild
  355|       |		--thiz->elemNesting;
  356|       |	#endif
  357|   116k|	(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|   116k|}	// EndElementHandler
ExpatAdapter.cpp:_ZL20CharacterDataHandlerPvPKci:
  371|   313k|{
  372|   313k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  373|       |	
  374|   313k|	if ( (cData == 0) || (len == 0) ) { cData = ""; len = 0; }
  ------------------
  |  Branch (374:7): [True: 0, False: 313k]
  |  Branch (374:23): [True: 0, False: 313k]
  ------------------
  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|   313k|	XML_Node * parentNode = thiz->parseStack.back();
  386|   313k|	XML_Node * cDataNode  = new XML_Node ( parentNode, "", kCDataNode );
  387|       |	
  388|   313k|	cDataNode->value.assign ( cData, len );
  389|   313k|	parentNode->content.push_back ( cDataNode );
  390|       |	
  391|   313k|}	// CharacterDataHandler
ExpatAdapter.cpp:_ZL28ProcessingInstructionHandlerPvPKcS1_:
  436|  6.34k|{
  437|  6.34k|	XMP_Assert ( target != 0 );
  ------------------
  |  |  142|  6.34k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  438|  6.34k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  439|       |
  440|  6.34k|	if ( ! XMP_LitMatch ( target, "xpacket" ) ) return;	// Ignore all PIs except the XMP packet wrapper.
  ------------------
  |  |   96|  6.34k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  |  Branch (440:7): [True: 1.46k, False: 4.88k]
  ------------------
  441|  4.88k|	if ( data == 0 ) data = "";
  ------------------
  |  Branch (441:7): [True: 0, False: 4.88k]
  ------------------
  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.88k|	XML_Node * parentNode = thiz->parseStack.back();
  451|  4.88k|	XML_Node * piNode  = new XML_Node ( parentNode, target, kPINode );
  452|       |	
  453|  4.88k|	piNode->value.assign ( data );
  454|  4.88k|	parentNode->content.push_back ( piNode );
  455|       |	
  456|  4.88k|}	// ProcessingInstructionHandler

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  8.76k|{
  625|  8.76k|	IgnoreParam(options);
  ------------------
  |  |  117|  8.76k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  8.76k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  8.76k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  8.76k|{
  647|       |
  648|  8.76k|	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: 8.69k]
  ------------------
  649|  8.69k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  8.69k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  8.69k|{
  664|  8.69k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  8.69k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  8.69k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  8.69k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  46.4k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 37.7k, False: 8.69k]
  ------------------
  670|  37.7k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 28.6k, False: 9.12k]
  ------------------
  671|  9.12k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  9.12k|	}
  673|       |
  674|  8.69k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  13.4k|{
  695|  13.4k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  13.4k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.95k, False: 8.47k]
  |  Branch (696:45): [True: 11, False: 4.94k]
  ------------------
  697|     11|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     11|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  13.4k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 9.11k, False: 4.29k]
  |  Branch (700:21): [True: 655, False: 8.46k]
  ------------------
  701|    655|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    655|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  12.7k|	} else {
  703|  12.7k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  12.7k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  12.7k|	}
  706|       |
  707|  13.4k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   288k|{
  265|   288k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   288k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 287k, False: 715]
  |  Branch (269:28): [True: 96.9k, False: 190k]
  ------------------
  270|       |
  271|  96.9k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 69.0k, False: 27.8k]
  ------------------
  272|  69.0k|			term = kRDFTerm_li;
  273|  69.0k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 39, False: 27.8k]
  ------------------
  274|     39|			term = kRDFTerm_parseType;
  275|  27.8k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 8.54k, False: 19.3k]
  ------------------
  276|  8.54k|			term = kRDFTerm_Description;
  277|  19.3k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.64k, False: 17.6k]
  ------------------
  278|  1.64k|			term = kRDFTerm_about;
  279|  17.6k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 104, False: 17.5k]
  ------------------
  280|    104|			term = kRDFTerm_resource;
  281|  17.5k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 134, False: 17.4k]
  ------------------
  282|    134|			term = kRDFTerm_RDF;
  283|  17.4k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 979, False: 16.4k]
  ------------------
  284|    979|			term = kRDFTerm_ID;
  285|  16.4k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 3.03k, False: 13.4k]
  ------------------
  286|  3.03k|			term = kRDFTerm_nodeID;
  287|  13.4k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 36, False: 13.3k]
  ------------------
  288|     36|			term = kRDFTerm_datatype;
  289|  13.3k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 70, False: 13.3k]
  ------------------
  290|     70|			term = kRDFTerm_aboutEach;
  291|  13.3k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 3, False: 13.3k]
  ------------------
  292|      3|			term = kRDFTerm_aboutEachPrefix;
  293|  13.3k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 77, False: 13.2k]
  ------------------
  294|     77|			term = kRDFTerm_bagID;
  295|     77|		}
  296|       |
  297|  96.9k|	}
  298|       |
  299|   288k|	return term;
  300|       |
  301|   288k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  12.7k|{
  732|  12.7k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  12.7k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  12.7k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  36.6k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 24.8k, False: 11.8k]
  ------------------
  738|       |
  739|  24.8k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  24.8k|		switch ( attrTerm ) {
  742|       |
  743|     37|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 37, False: 24.7k]
  ------------------
  744|     78|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 41, False: 24.7k]
  ------------------
  745|  1.72k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.64k, False: 23.1k]
  ------------------
  746|       |
  747|  1.72k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 35, False: 1.69k]
  ------------------
  748|  1.69k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.69k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.68k, False: 1]
  |  Branch (750:24): [True: 1.61k, False: 78]
  ------------------
  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.61k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.61k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.61k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.60k, False: 10]
  ------------------
  755|  1.60k|						xmpParent->name = (*currAttr)->value;
  756|  1.60k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 7, False: 3]
  ------------------
  757|      7|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 6, False: 1]
  ------------------
  758|      1|					}
  759|  1.61k|				}
  760|       |
  761|  1.68k|				break;
  762|       |
  763|  22.8k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 22.8k, False: 1.96k]
  ------------------
  764|  22.8k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  22.8k|				break;
  766|       |
  767|    243|			default :
  ------------------
  |  Branch (767:4): [True: 243, False: 24.5k]
  ------------------
  768|    243|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|    243|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  24.8k|		}
  771|       |
  772|  24.8k|	}
  773|       |
  774|  12.7k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   131k|{
  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|   131k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 502, False: 130k]
  ------------------
  371|    502|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    502|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   130k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   130k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   130k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   130k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   130k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 28.1k, False: 102k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  28.1k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  28.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  28.1k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  28.1k|#define kXMP_CreateNodes	true
  ------------------
  384|  28.1k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  28.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  14.9k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 14.9k, False: 13.1k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  28.1k|		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.1k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 28.1k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  28.1k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   130k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 61.4k, False: 69.1k]
  ------------------
  398|  61.4k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  61.4k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 105, False: 61.3k]
  ------------------
  399|    105|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|    105|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  61.4k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   130k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   130k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 130k, False: 143]
  |  Branch (406:26): [True: 70, False: 73]
  ------------------
  407|   130k|		 xmpParent->children.push_back ( newChild );
  408|   130k|	} else {
  409|     75|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     75|	}
  411|   130k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 143, False: 130k]
  ------------------
  412|    143|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    141|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 140, False: 3]
  |  Branch (412:22): [True: 1, False: 2]
  ------------------
  413|      2|		xmpParent->options |= kRDF_HasValueElem;
  414|      2|	}
  415|       |	
  416|   130k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 68.9k, False: 61.3k]
  ------------------
  417|  68.9k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     92|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 92, False: 68.8k]
  ------------------
  418|  68.8k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  68.8k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  68.8k|	}
  423|       |	
  424|   130k|	return newChild;
  425|       |
  426|   130k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  12.0k|{
  787|  12.0k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  12.0k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   260k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 248k, False: 11.6k]
  ------------------
  791|   248k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 172k, False: 76.2k]
  ------------------
  792|  76.2k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 382, False: 75.8k]
  ------------------
  793|    382|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    382|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  75.8k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  75.8k|	}
  797|       |
  798|  12.0k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  75.8k|{
  854|  75.8k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  75.8k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|    204|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 204, False: 75.6k]
  ------------------
  856|       |	
  857|  75.6k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 1.70k, False: 73.9k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  1.70k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  73.9k|	} 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|  73.9k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  73.9k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  73.9k|		XMP_VarString * attrName = 0;
  870|       |
  871|   124k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 61.8k, False: 62.7k]
  ------------------
  872|  61.8k|			attrName = &((*currAttr)->name);
  873|  61.8k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 12.1k, False: 49.7k]
  |  Branch (873:38): [True: 11.1k, False: 970]
  ------------------
  874|  61.8k|		}
  875|       |
  876|  73.9k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 11.1k, False: 62.7k]
  ------------------
  877|       |
  878|  11.1k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  11.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  11.1k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  11.1k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 7, False: 11.1k]
  ------------------
  882|      7|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  11.1k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 10.9k, False: 175]
  ------------------
  884|  10.9k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  10.9k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 0, False: 175]
  ------------------
  886|      0|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    175|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 171, False: 4]
  ------------------
  888|    171|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    171|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 4]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|      4|			} else {
  892|      4|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|      4|			}
  894|       |
  895|  62.7k|		} 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|  62.7k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 45.9k, False: 16.7k]
  ------------------
  901|       |
  902|  45.9k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  45.9k|			} else {
  905|       |			
  906|  16.7k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  16.7k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  56.4k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 44.2k, False: 12.1k]
  ------------------
  910|  44.2k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.56k, False: 39.6k]
  ------------------
  911|  44.2k|				}
  912|       |				
  913|  16.7k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 12.1k, False: 4.56k]
  ------------------
  914|  12.1k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  12.1k|				} else {
  916|  4.56k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.56k|				}
  918|       |			
  919|  16.7k|			}
  920|       |
  921|  62.7k|		}
  922|       |		
  923|  73.9k|	}
  924|       |
  925|  75.6k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  75.8k|{
  350|       |
  351|  75.8k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 71, False: 75.7k]
  |  Branch (351:42): [True: 0, False: 75.7k]
  ------------------
  352|  75.7k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  75.8k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  75.7k|{
  334|       |
  335|  75.7k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 75.7k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  75.7k|	return false;
  337|       |
  338|  75.7k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  75.7k|{
  317|       |
  318|  75.7k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 69.1k, False: 6.56k]
  |  Branch (318:40): [True: 133, False: 69.0k]
  ------------------
  319|  75.6k|	return false;
  320|       |
  321|  75.7k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  58.6k|{
 1190|  58.6k|	bool hasPropertyAttrs = false;
 1191|  58.6k|	bool hasResourceAttr  = false;
 1192|  58.6k|	bool hasNodeIDAttr    = false;
 1193|  58.6k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  58.6k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  58.6k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     78|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 78, 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|   146k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 87.3k, False: 58.6k]
  ------------------
 1205|       |
 1206|  87.3k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  87.3k|		switch ( attrTerm ) {
 1209|       |
 1210|    471|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 471, False: 86.9k]
  ------------------
 1211|       |				// Nothing to do.
 1212|    471|				break;
 1213|       |
 1214|     85|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 85, False: 87.3k]
  ------------------
 1215|     85|				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: 85]
  ------------------
 1216|     85|				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: 85]
  ------------------
 1217|     85|				hasResourceAttr = true;
 1218|     85|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 85, False: 0]
  ------------------
 1219|     85|				break;
 1220|       |
 1221|  1.49k|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 1.49k, False: 85.8k]
  ------------------
 1222|  1.49k|				if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1222:10): [True: 1, False: 1.49k]
  ------------------
 1223|  1.49k|				hasNodeIDAttr = true;
 1224|  1.49k|				break;
 1225|       |
 1226|  85.3k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 85.3k, False: 2.05k]
  ------------------
 1227|  85.3k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 444, False: 84.8k]
  ------------------
 1228|    444|					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: 444]
  ------------------
 1229|    444|					hasValueAttr = true;
 1230|    444|					valueNode = *currAttr;
 1231|  84.8k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 36.7k, False: 48.1k]
  ------------------
 1232|  36.7k|					hasPropertyAttrs = true;
 1233|  36.7k|				}
 1234|  85.3k|				break;
 1235|       |
 1236|  85.3k|			default :
  ------------------
  |  Branch (1236:4): [True: 1, False: 87.3k]
  ------------------
 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|  87.3k|		}
 1241|       |
 1242|  87.3k|	}
 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: 528, False: 58.0k]
  ------------------
 1252|    528|		childNode->value = valueNode->value;
 1253|    528|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 84, False: 444]
  ------------------
 1254|  58.0k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 10.6k, False: 47.4k]
  ------------------
 1255|  10.6k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  10.6k|		childIsStruct = true;
 1257|  10.6k|	}
 1258|       |		
 1259|  58.6k|	currAttr = xmlNode.attrs.begin();
 1260|  58.6k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   145k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 87.2k, False: 58.6k]
  ------------------
 1263|       |
 1264|  87.2k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 527, False: 86.7k]
  ------------------
 1265|  86.7k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  86.7k|		switch ( attrTerm ) {
 1268|       |
 1269|    471|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 471, False: 86.2k]
  ------------------
 1270|  1.96k|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 1.49k, False: 85.2k]
  ------------------
 1271|  1.96k|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 86.7k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  84.7k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 84.7k, False: 1.96k]
  ------------------
 1278|  84.7k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 51.2k, False: 33.5k]
  |  Branch (1278:31): [True: 845, False: 32.6k]
  ------------------
 1279|  52.0k|					AddQualifierNode ( childNode, **currAttr );
 1280|  52.0k|				} else {
 1281|  32.6k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  32.6k|				}
 1283|  84.7k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 86.7k]
  ------------------
 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|  86.7k|		}
 1290|       |
 1291|  86.7k|	}
 1292|       |
 1293|  58.6k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  53.9k|{
  484|  53.9k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 1, False: 53.9k]
  ------------------
  485|      1|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  53.9k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  53.9k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  54.2k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  54.2k|	const bool isLang = (name == "xml:lang");
  443|  54.2k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  54.2k|	XMP_Node * newQual = 0;
  446|       |
  447|  54.2k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  54.2k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 3.98k, False: 50.2k]
  ------------------
  450|  3.98k|			xmpParent->qualifiers.push_back ( newQual );
  451|  50.2k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 49.9k, False: 350]
  ------------------
  452|  49.9k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 49.9k, False: 5]
  ------------------
  453|  49.9k|				xmpParent->qualifiers.push_back ( newQual );
  454|  49.9k|			} else {
  455|      5|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|      5|			}
  457|  49.9k|			xmpParent->options |= kXMP_PropHasLang;
  458|  49.9k|		} else {
  459|    350|			XMP_Assert ( isType );
  ------------------
  |  |  142|    350|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    350|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 346, False: 4]
  ------------------
  461|    346|				xmpParent->qualifiers.push_back ( newQual );
  462|    346|			} else {
  463|      4|				size_t offset = 0;
  464|      4|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 3, False: 1]
  ------------------
  465|      4|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|      4|			}
  467|    350|			xmpParent->options |= kXMP_PropHasType;
  468|    350|		}
  469|       |
  470|  54.2k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  54.2k|	return newQual;
  473|       |
  474|  54.2k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  12.1k|{
 1015|  12.1k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  12.1k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  12.1k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  14.5k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 2.35k, False: 12.1k]
  ------------------
 1021|  2.35k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  2.35k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 1.82k, False: 530]
  ------------------
 1023|  1.82k|			AddQualifierNode ( newChild, **currAttr );
 1024|  1.82k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 519, False: 11]
  |  Branch (1024:41): [True: 7, False: 4]
  ------------------
 1025|    526|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|    526|		} else {
 1027|      4|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      4|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  2.35k|	}
 1030|       |	
 1031|  12.1k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  12.1k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  12.1k|	size_t      textSize  = 0;
 1034|       |
 1035|  42.2k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 30.0k, False: 12.1k]
  ------------------
 1036|  30.0k|		if ( (*currChild)->kind != kCDataNode ) XMP_Throw ( "Invalid child of literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1036:8): [True: 0, False: 30.0k]
  ------------------
 1037|  30.0k|		textSize += (*currChild)->value.size();
 1038|  30.0k|	}
 1039|       |	
 1040|  12.1k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  42.2k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 30.0k, False: 12.1k]
  ------------------
 1043|  30.0k|		newChild->value += (*currChild)->value;
 1044|  30.0k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  12.1k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    171|{
 1087|       |
 1088|    171|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    171|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    171|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    171|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    342|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 171, False: 171]
  ------------------
 1095|    171|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    171|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 171, False: 0]
  ------------------
 1097|    171|			continue;	// ! The caller ensured the value is "Resource".
 1098|    171|		} 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|    171|	}
 1106|       |
 1107|    171|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    171|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 171]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    171|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|      4|{
 1147|      4|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      4|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      4|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      4|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|      4|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      4|#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.56k|{
  943|  4.56k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.54k, False: 11]
  |  Branch (943:21): [True: 0, False: 4.54k]
  ------------------
  944|       |	
  945|  4.56k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.56k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.56k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.56k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 5, False: 4.56k]
  ------------------
  951|      5|		XMP_VarString & attrName = (*currAttr)->name;
  952|      5|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 4, False: 1]
  ------------------
  953|      4|			AddQualifierNode ( newCompound, **currAttr );
  954|      4|		} 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|      5|	}
  960|       |	
  961|  4.56k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.56k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  13.7k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 13.6k, False: 105]
  ------------------
  965|  13.6k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.45k, False: 9.22k]
  ------------------
  966|  13.6k|	}
  967|  4.56k|	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.56k]
  ------------------
  968|  4.56k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|    119|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 119, False: 4.44k]
  ------------------
  969|       |
  970|  4.44k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 224, False: 4.21k]
  ------------------
  971|    224|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.21k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.30k, False: 1.91k]
  ------------------
  973|  2.30k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.30k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.41k, False: 500]
  ------------------
  975|  1.41k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.41k|	} else {
  977|    500|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    500|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 384, False: 116]
  ------------------
  979|    384|			XMP_VarString typeName ( (*currChild)->ns );
  980|    384|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    384|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     37|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 37, False: 347]
  ------------------
  982|    347|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    347|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    347|		}
  985|    500|	}
  986|       |
  987|  4.40k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.40k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 4.40k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  4.40k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.31k, False: 3.08k]
  ------------------
  991|  1.31k|		DetectAltText ( newCompound );
  992|  1.31k|	}
  993|       |
  994|  11.9k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 7.64k, False: 4.29k]
  ------------------
  995|  7.64k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    108|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 108, False: 7.53k]
  ------------------
  996|  7.53k|	}
  997|       |
  998|  4.40k|}	// 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|  8.44k|{
  568|  8.44k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  8.44k|	size_t unitCount = 0;
  570|       |
  571|  8.44k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  8.44k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 8.44k]
  ------------------
  573|  8.44k|	inUnit = *utf8In;
  574|  8.44k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 8.44k, 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|  8.44k|MultiByte:
  584|  8.44k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  8.44k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  8.44k|{
  517|  8.44k|	UTF8Unit  inUnit = *utf8In;
  518|  8.44k|	size_t    unitCount = 0;
  519|  8.44k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  8.44k|	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|  8.44k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  28.6k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 20.2k, False: 8.44k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  8.44k|	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: 8.44k]
  |  Branch (538:28): [True: 0, False: 8.44k]
  ------------------
  539|  8.44k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 8.44k]
  ------------------
  540|  8.44k|	unitCount = bytesNeeded;
  541|       |	
  542|  8.44k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  8.44k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  20.2k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 11.8k, False: 8.44k]
  ------------------
  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|  8.44k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 0, False: 8.44k]
  ------------------
  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|  8.44k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  8.44k|Done:	
  559|  8.44k|	*utf8Read = unitCount;
  560|  8.44k|	return;
  561|       |	
  562|  8.44k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   493k|{
   88|       |
   89|   493k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   493k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   493k|	const XMP_Uns8 * namePos   = nameStart;
   92|   493k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   493k|	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: 493k]
  ------------------
   97|       |
   98|   493k|	cp = *namePos;
   99|   493k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 493k, False: 318]
  ------------------
  100|   493k|		++namePos;
  101|   493k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 493k]
  ------------------
  102|   493k|	} else {
  103|    318|		cp = GetCodePoint ( &namePos );
  104|    318|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 318]
  ------------------
  105|    318|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  19.8M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 19.3M, False: 493k]
  ------------------
  110|  19.3M|		cp = *namePos;
  111|  19.3M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 19.3M, False: 5.38k]
  ------------------
  112|  19.3M|			++namePos;
  113|  19.3M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 115k, False: 19.2M]
  |  Branch (113:38): [True: 0, False: 115k]
  ------------------
  114|  19.3M|		} else {
  115|  5.38k|			cp = GetCodePoint ( &namePos );
  116|  5.38k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 556, False: 4.82k]
  |  Branch (116:41): [True: 0, False: 556]
  ------------------
  117|  5.38k|		}
  118|  19.3M|	}
  119|       |
  120|   493k|	return;
  121|       |
  122|   493k|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|  19.8M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  19.8M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 19.5M, False: 326k]
  |  Branch (33:23): [True: 19.5M, False: 0]
  |  Branch (33:40): [True: 211k, False: 115k]
  |  Branch (33:55): [True: 208k, False: 2.96k]
  |  Branch (33:71): [True: 2.96k, False: 115k]
  ------------------
   34|   115k|	return false;
   35|  19.8M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  5.70k|{
   20|  5.70k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  5.70k|	XMP_Uns32 cp;
   22|  5.70k|	size_t u8Len;
   23|  5.70k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  5.70k|	*utf8Str_io = u8Ptr + u8Len;
   25|  5.70k|	return cp;
   26|  5.70k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  5.70k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  5.70k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 5.48k, False: 215]
  |  Branch (43:24): [True: 180, False: 5.30k]
  |  Branch (43:43): [True: 5.30k, False: 215]
  |  Branch (43:59): [True: 821, False: 4.48k]
  ------------------
   44|  4.70k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 4.48k, False: 215]
  |  Branch (44:24): [True: 1.91k, False: 2.56k]
  |  Branch (44:43): [True: 2.22k, False: 556]
  |  Branch (44:60): [True: 0, False: 2.22k]
  ------------------
   45|       |
   46|  2.78k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 2.22k, False: 556]
  |  Branch (46:25): [True: 1.58k, False: 646]
  |  Branch (46:46): [True: 646, False: 556]
  |  Branch (46:64): [True: 0, False: 646]
  ------------------
   47|  1.20k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 646, False: 556]
  |  Branch (47:26): [True: 0, False: 646]
  |  Branch (47:46): [True: 646, False: 556]
  |  Branch (47:64): [True: 0, False: 646]
  ------------------
   48|  1.20k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 646, False: 556]
  |  Branch (48:26): [True: 646, False: 0]
  |  Branch (48:46): [True: 0, False: 556]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    556|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 556]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 556]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    556|	return false;
   52|       |
   53|    556|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   115k|{
   59|       |	// ASCII following characters for an XML name.
   60|   115k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 49.5k, False: 65.4k]
  |  Branch (60:23): [True: 49.5k, False: 0]
  |  Branch (60:39): [True: 47.9k, False: 17.5k]
  |  Branch (60:54): [True: 17.5k, False: 0]
  ------------------
   61|      0|	return false;
   62|   115k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    556|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    556|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 215, False: 341]
  |  Branch (69:24): [True: 341, False: 0]
  |  Branch (69:41): [True: 341, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    556|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  35.2k|{
   88|       |
   89|  35.2k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  35.2k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  35.2k|	const XMP_Uns8 * namePos   = nameStart;
   92|  35.2k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  35.2k|	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: 35.2k]
  ------------------
   97|       |
   98|  35.2k|	cp = *namePos;
   99|  35.2k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 35.0k, False: 219]
  ------------------
  100|  35.0k|		++namePos;
  101|  35.0k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 35.0k]
  ------------------
  102|  35.0k|	} else {
  103|    219|		cp = GetCodePoint ( &namePos );
  104|    219|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 219]
  ------------------
  105|    219|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  9.72M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 9.68M, False: 35.2k]
  ------------------
  110|  9.68M|		cp = *namePos;
  111|  9.68M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 9.68M, False: 2.52k]
  ------------------
  112|  9.68M|			++namePos;
  113|  9.68M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 9.56k, False: 9.67M]
  |  Branch (113:38): [True: 0, False: 9.56k]
  ------------------
  114|  9.68M|		} else {
  115|  2.52k|			cp = GetCodePoint ( &namePos );
  116|  2.52k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 492, False: 2.03k]
  |  Branch (116:41): [True: 0, False: 492]
  ------------------
  117|  2.52k|		}
  118|  9.68M|	}
  119|       |
  120|  35.2k|	return;
  121|       |
  122|  35.2k|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.72M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  9.72M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 9.67M, False: 47.2k]
  |  Branch (33:23): [True: 9.67M, False: 0]
  |  Branch (33:40): [True: 37.7k, False: 9.56k]
  |  Branch (33:55): [True: 36.9k, False: 758]
  |  Branch (33:71): [True: 758, False: 9.56k]
  ------------------
   34|  9.56k|	return false;
   35|  9.72M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  2.74k|{
   20|  2.74k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  2.74k|	XMP_Uns32 cp;
   22|  2.74k|	size_t u8Len;
   23|  2.74k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  2.74k|	*utf8Str_io = u8Ptr + u8Len;
   25|  2.74k|	return cp;
   26|  2.74k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  2.74k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  2.74k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 2.33k, False: 413]
  |  Branch (43:24): [True: 118, False: 2.21k]
  |  Branch (43:43): [True: 2.21k, False: 413]
  |  Branch (43:59): [True: 166, False: 2.04k]
  ------------------
   44|  2.46k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 2.04k, False: 413]
  |  Branch (44:24): [True: 406, False: 1.64k]
  |  Branch (44:43): [True: 1.56k, False: 492]
  |  Branch (44:60): [True: 0, False: 1.56k]
  ------------------
   45|       |
   46|  2.05k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.56k, False: 492]
  |  Branch (46:25): [True: 976, False: 587]
  |  Branch (46:46): [True: 587, False: 492]
  |  Branch (46:64): [True: 0, False: 587]
  ------------------
   47|  1.07k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 587, False: 492]
  |  Branch (47:26): [True: 0, False: 587]
  |  Branch (47:46): [True: 587, False: 492]
  |  Branch (47:64): [True: 0, False: 587]
  ------------------
   48|  1.07k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 587, False: 492]
  |  Branch (48:26): [True: 587, False: 0]
  |  Branch (48:46): [True: 0, False: 492]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    492|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 492]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 492]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    492|	return false;
   52|       |
   53|    492|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  9.56k|{
   59|       |	// ASCII following characters for an XML name.
   60|  9.56k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 3.82k, False: 5.74k]
  |  Branch (60:23): [True: 3.82k, False: 0]
  |  Branch (60:39): [True: 2.84k, False: 2.90k]
  |  Branch (60:54): [True: 2.90k, False: 0]
  ------------------
   61|      0|	return false;
   62|  9.56k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    492|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    492|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 413, False: 79]
  |  Branch (69:24): [True: 79, False: 0]
  |  Branch (69:41): [True: 79, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    492|}

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

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|  10.3k|{
   78|  10.3k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CTor_1" )
  ------------------
  |  |  241|  10.3k|	AnnounceEntry ( proc );									\
  |  |  242|  10.3k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  10.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  10.3k|	try {													\
  |  |  245|  10.3k|		XMP_AutoMutex mutex;								\
  |  |  246|  10.3k|		wResult->errMessage = 0;
  ------------------
   79|       |
   80|  10.3k|		XMPMeta * xmpObj = new XMPMeta();
   81|  10.3k|		++xmpObj->clientRefs;
   82|  10.3k|		XMP_Assert ( xmpObj->clientRefs == 1 );
  ------------------
  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   83|  10.3k|		wResult->ptrResult = XMPMetaRef ( xmpObj );
   84|       |
   85|  10.3k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  10.3k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  10.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|	}
  |  |  ------------------
  |  |  250|  10.3k|	AnnounceExit();
  ------------------
   86|  10.3k|}
WXMPMeta_DecrementRefCount_1:
  108|  10.3k|{
  109|  10.3k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  110|  10.3k|	XMP_ENTER_WRAPPER ( "WXMPMeta_DecrementRefCount_1" )
  ------------------
  |  |  241|  10.3k|	AnnounceEntry ( proc );									\
  |  |  242|  10.3k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  10.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  10.3k|	try {													\
  |  |  245|  10.3k|		XMP_AutoMutex mutex;								\
  |  |  246|  10.3k|		wResult->errMessage = 0;
  ------------------
  111|       |
  112|  10.3k|		XMPMeta * thiz = (XMPMeta*)xmpRef;
  113|       |		
  114|  10.3k|		XMP_Assert ( thiz->clientRefs > 0 );
  ------------------
  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  115|  10.3k|		--thiz->clientRefs;
  116|  10.3k|		if ( thiz->clientRefs <= 0 ) delete ( thiz );
  ------------------
  |  Branch (116:8): [True: 10.3k, False: 0]
  ------------------
  117|       |
  118|  10.3k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  10.3k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  10.3k|	AnnounceExit();
  ------------------
  119|  10.3k|}
WXMPMeta_Unlock_1:
  207|  36.0k|{
  208|  36.0k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  209|  36.0k|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Unlock_1" )
  ------------------
  |  |  235|  36.0k|	AnnounceNoLock ( proc );								\
  |  |  236|  36.0k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  36.0k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|  36.0k|	try {													\
  |  |  238|  36.0k|		wResult->errMessage = 0;
  ------------------
  210|       |
  211|  36.0k|		XMPMeta::Unlock ( options );
  212|       |
  213|  36.0k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  36.0k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  36.0k|	AnnounceExit();
  ------------------
  214|  36.0k|}
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|  36.0k|{
  241|  36.0k|	XMP_ENTER_WRAPPER ( "WXMPMeta_GetNamespacePrefix_1" )
  ------------------
  |  |  241|  36.0k|	AnnounceEntry ( proc );									\
  |  |  242|  36.0k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  36.0k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  36.0k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  36.0k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  36.0k|	try {													\
  |  |  245|  36.0k|		XMP_AutoMutex mutex;								\
  |  |  246|  36.0k|		wResult->errMessage = 0;
  ------------------
  242|       |
  243|  36.0k|		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: 36.0k]
  |  Branch (243:31): [True: 0, False: 36.0k]
  ------------------
  244|       |
  245|  36.0k|		if ( namespacePrefix == 0 ) namespacePrefix = &voidStringPtr;
  ------------------
  |  Branch (245:8): [True: 0, False: 36.0k]
  ------------------
  246|  36.0k|		if ( prefixSize == 0 ) prefixSize = &voidStringLen;
  ------------------
  |  Branch (246:8): [True: 0, False: 36.0k]
  ------------------
  247|       |
  248|  36.0k|		bool found = XMPMeta::GetNamespacePrefix ( namespaceURI, namespacePrefix, prefixSize );
  249|  36.0k|		wResult->int32Result = found;
  250|       |		
  251|  36.0k|	XMP_EXIT_WRAPPER_KEEP_LOCK ( found )
  ------------------
  |  |  253|  36.0k|		if ( keep ) mutex.KeepLock();		\
  |  |  ------------------
  |  |  |  Branch (253:8): [True: 36.0k, False: 0]
  |  |  ------------------
  |  |  254|  36.0k|	XMP_CATCH_EXCEPTIONS					\
  |  |  ------------------
  |  |  |  |  265|  36.0k|	} 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|  36.0k|	AnnounceExit();
  ------------------
  252|  36.0k|}
WXMPMeta_CountArrayItems_1:
 1168|  3.65k|{
 1169|  3.65k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CountArrayItems_1" )
  ------------------
  |  |  241|  3.65k|	AnnounceEntry ( proc );									\
  |  |  242|  3.65k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.65k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.65k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.65k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.65k|	try {													\
  |  |  245|  3.65k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.65k|		wResult->errMessage = 0;
  ------------------
 1170|       |		
 1171|  3.65k|		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.65k]
  |  Branch (1171:27): [True: 0, False: 3.65k]
  ------------------
 1172|  3.65k|		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.65k]
  |  Branch (1172:28): [True: 0, False: 3.65k]
  ------------------
 1173|       |
 1174|  3.65k|		const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  3.65k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
 1175|  3.65k|		XMP_Index count = meta.CountArrayItems ( schemaNS, arrayName );
 1176|  3.65k|		wResult->int32Result = count;
 1177|       |		
 1178|  3.65k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  3.65k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  3.65k|	} 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.65k|	AnnounceExit();
  ------------------
 1179|  3.65k|}
WXMPMeta_ParseFromBuffer_1:
 1270|  10.3k|{
 1271|  10.3k|	XMP_ENTER_WRAPPER ( "WXMPMeta_ParseFromBuffer_1" )
  ------------------
  |  |  241|  10.3k|	AnnounceEntry ( proc );									\
  |  |  242|  10.3k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  10.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  10.3k|	try {													\
  |  |  245|  10.3k|		XMP_AutoMutex mutex;								\
  |  |  246|  10.3k|		wResult->errMessage = 0;
  ------------------
 1272|       |
 1273|  10.3k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|  10.3k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 10.3k]
  |  |  ------------------
  ------------------
 1274|  10.3k|		meta->ParseFromBuffer ( buffer, bufferSize, options );
 1275|       |		
 1276|  10.3k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  10.3k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  10.3k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|  2.84k|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|  2.84k|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|  2.84k|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|  2.84k|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 2.84k]
  |  |  |  |  ------------------
  |  |  |  |  270|  2.84k|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|  2.84k|	} 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|  10.3k|	AnnounceExit();
  ------------------
 1277|  10.3k|}

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   307k|{
   40|   307k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 88.6k, False: 218k]
  ------------------
   41|       |
   42|   835k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 618k, False: 217k]
  ------------------
   43|   618k|		unsigned char ch = this->value[i];
   44|   618k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   618k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 506k, False: 111k]
  |  |  |  Branch (45:49): [True: 513, False: 110k]
  |  |  |  Branch (45:67): [True: 109k, False: 1.26k]
  |  |  |  Branch (45:85): [True: 0, False: 1.26k]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|  1.26k|		return false;	// All the checks failed, this isn't whitespace.
   47|   618k|	}
   48|       |
   49|   217k|	return true;
   50|       |
   51|   218k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   565k|{
  428|       |
  429|   686k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 120k, False: 565k]
  ------------------
  430|   565k|	this->attrs.clear();
  431|       |
  432|   565k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   565k|{
  440|       |
  441|   999k|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 434k, False: 565k]
  ------------------
  442|   565k|	this->content.clear();
  443|       |
  444|   565k|}	// 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|   284k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   284k|		int err = pthread_mutex_lock ( &mutex );
  125|   284k|		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: 284k]
  ------------------
  126|   284k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   284k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   284k|		int err = pthread_mutex_unlock ( &mutex );
  130|   284k|		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: 284k]
  ------------------
  131|   284k|	}
_Z16VerifySetOptionsjPKc:
  563|    794|{
  564|       |
  565|    794|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 156, False: 638]
  ------------------
  566|    794|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 156, False: 638]
  ------------------
  567|    794|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 362, False: 432]
  ------------------
  568|       |	
  569|    794|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 794]
  ------------------
  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|    794|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 0, False: 794]
  |  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|    794|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 794]
  |  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|    794|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 0, False: 794]
  |  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|    794|	return options;
  586|       |
  587|    794|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   177k|{
  663|   177k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   177k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   177k|	XMP_StringPtr	qualName, nameEnd;
  667|   177k|	XMP_VarString	currStep;
  668|       |		
  669|   177k|	qualName = nameEnd = NULL;
  670|   177k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  21.0M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 20.9M, False: 177k]
  ------------------
  672|  20.9M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 69.5k, False: 20.8M]
  |  Branch (672:29): [True: 143k, False: 20.7M]
  ------------------
  673|  20.9M|	}
  674|       |	
  675|   177k|	expandedXPath->clear();
  676|   177k|	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|   177k|	stepBegin = propPath;
  683|   177k|	stepEnd = stepBegin;
  684|  14.5M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 14.5M, False: 33.0k]
  |  Branch (684:29): [True: 14.5M, False: 752]
  |  Branch (684:50): [True: 14.3M, False: 143k]
  |  Branch (684:71): [True: 14.3M, False: 0]
  ------------------
  685|   177k|	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: 177k]
  ------------------
  686|   177k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   177k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   177k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   177k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 177k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   177k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   390k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 213k, False: 177k]
  ------------------
  700|       |
  701|   213k|		stepBegin = stepEnd;
  702|   213k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 69.5k, False: 143k]
  ------------------
  703|   213k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 213k]
  ------------------
  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|   213k|		stepEnd = stepBegin;
  708|       |
  709|   213k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 69.5k, False: 143k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|  69.5k|			qualName = stepBegin;
  713|  5.85M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 5.78M, False: 69.5k]
  |  Branch (713:31): [True: 5.78M, False: 0]
  |  Branch (713:52): [True: 5.78M, False: 0]
  |  Branch (713:73): [True: 5.78M, False: 0]
  ------------------
  714|  69.5k|			nameEnd = stepEnd;
  715|  69.5k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   143k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   143k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   143k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 143k, False: 0]
  |  Branch (723:30): [True: 143k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|   539k|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 539k, False: 0]
  |  Branch (726:32): [True: 539k, False: 0]
  |  Branch (726:53): [True: 395k, False: 143k]
  ------------------
  727|   143k|				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: 143k]
  ------------------
  728|   143k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   143k|			} 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|   143k|			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: 143k]
  ------------------
  774|   143k|			++stepEnd;
  775|       |			
  776|   143k|		}
  777|       |
  778|   213k|		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: 213k]
  ------------------
  779|   213k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   213k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   213k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 69.5k, False: 143k]
  ------------------
  782|       |
  783|  69.5k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 69.5k]
  ------------------
  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|  69.5k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 53.1k, False: 16.3k]
  ------------------
  788|  53.1k|				++qualName;
  789|  53.1k|				stepFlags = kXMP_QualifierStep;
  790|  53.1k|			}
  791|  69.5k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   143k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   143k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 143k]
  ------------------
  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|   213k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   213k|	}
  812|       |
  813|   177k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   271k|{
  829|   271k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   271k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   271k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|   641k|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 579k, False: 61.3k]
  ------------------
  834|   579k|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|   579k|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|   579k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|   579k|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 209k, False: 369k]
  ------------------
  837|   209k|			schemaNode = currSchema;
  838|   209k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 177k, False: 32.6k]
  ------------------
  839|   209k|			break;
  840|   209k|		}
  841|   579k|	}
  842|       |	
  843|   271k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 61.3k, False: 209k]
  |  Branch (843:28): [True: 15.0k, False: 46.2k]
  ------------------
  844|       |
  845|  15.0k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  15.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  15.0k|		XMP_StringPtr prefixPtr;
  847|  15.0k|		XMP_StringLen prefixLen;
  848|  15.0k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  15.0k|		XMP_Assert ( found );
  ------------------
  |  |  142|  15.0k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  15.0k|		UNUSED(found);
  851|       |
  852|  15.0k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  15.0k|		xmpTree->children.push_back ( schemaNode );
  854|  15.0k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 165, False: 14.9k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  15.0k|	}
  861|       |	
  862|   271k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   271k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   271k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   271k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   271k|	return schemaNode;
  865|       |	
  866|   271k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   261k|{
  882|   261k|	XMP_Node * childNode = 0;
  883|       |
  884|   261k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 2, False: 261k]
  ------------------
  885|      2|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|      2|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 2, False: 0]
  ------------------
  886|      2|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|      2|#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.18M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 1.12M, False: 66.9k]
  ------------------
  898|  1.12M|		XMP_Node * currChild = parent->children[childNum];
  899|  1.12M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  1.12M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  1.12M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 194k, False: 928k]
  ------------------
  901|   194k|			childNode = currChild;
  902|   194k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 193k, False: 643]
  ------------------
  903|   194k|			break;
  904|   194k|		}
  905|  1.12M|	}
  906|       |	
  907|   261k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 66.9k, False: 194k]
  |  Branch (907:27): [True: 168, False: 66.7k]
  ------------------
  908|    168|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|    168|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|    168|		parent->children.push_back ( childNode );
  910|    168|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 168, False: 0]
  ------------------
  911|    168|	}
  912|       |	
  913|   261k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   261k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   261k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   261k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   261k|	return childNode;
  916|       |	
  917|   261k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|  53.1k|{
  935|  53.1k|	XMP_Node * qualNode = 0;
  936|       |	
  937|  53.1k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|  53.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  77.3k|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 77.3k, False: 0]
  ------------------
  940|  77.3k|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  77.3k|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  77.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  77.3k|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 53.1k, False: 24.2k]
  ------------------
  943|  53.1k|			qualNode = currQual;
  944|  53.1k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 53.1k, False: 0]
  ------------------
  945|  53.1k|			break;
  946|  53.1k|		}
  947|  77.3k|	}
  948|       |	
  949|  53.1k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 0, False: 53.1k]
  |  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|  53.1k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|  53.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|  53.1k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  53.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|  53.1k|	return qualNode;
  979|       |	
  980|  53.1k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   177k|{
 1063|   177k|	XMP_Node *     currNode = 0;
 1064|   177k|	XMP_NodePtrPos currPos;
 1065|   177k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   177k|	bool           leafIsNew = false;
 1067|       |	
 1068|   177k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   177k|	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: 177k]
  ------------------
 1071|       |	
 1072|   177k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   177k|	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|   177k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 177k, False: 0]
  ------------------
 1082|       |		
 1083|   177k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   177k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 0, False: 177k]
  ------------------
 1085|       |
 1086|   177k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   177k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 165, False: 177k]
  ------------------
 1087|    165|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    165|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|    165|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 165, False: 0]
  ------------------
 1089|    165|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|    165|		}
 1091|       |
 1092|   177k|	} 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|   177k|	try {
 1138|   567k|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 390k, False: 177k]
  ------------------
 1139|   390k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   390k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 0, False: 390k]
  ------------------
 1141|   390k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   390k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 168, False: 390k]
  ------------------
 1142|    168|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    168|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|    168|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|    168|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 3, False: 165]
  ------------------
 1145|    168|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|    168|			}
 1147|   390k|		}
 1148|   177k|	} 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|   177k|EXIT:
 1156|       |
 1157|   177k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   177k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   177k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 168, False: 177k]
  ------------------
 1161|    168|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 168, False: 0]
  ------------------
 1162|    168|			currNode->options |= leafOptions;
 1163|    168|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|    168|	}
 1167|       |
 1168|   177k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 177k, False: 0]
  |  Branch (1168:26): [True: 0, False: 177k]
  ------------------
 1169|   177k|	return currNode;
 1170|       |	
 1171|   177k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  50.6k|{
 1344|  50.6k|	char * tagStart;
 1345|  50.6k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  50.6k|	tagStart = (char*) value->c_str();
 1350|   937k|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 930k, False: 6.80k]
  |  Branch (1350:45): [True: 887k, False: 43.8k]
  ------------------
 1351|   887k|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 791k, False: 95.1k]
  |  Branch (1351:28): [True: 23.0k, False: 768k]
  ------------------
 1352|   887k|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  50.6k|	tagStart = tagEnd;
 1357|  50.6k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 43.8k, False: 6.80k]
  ------------------
 1358|  5.93M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 5.88M, False: 49.4k]
  |  Branch (1358:45): [True: 5.88M, False: 1.22k]
  ------------------
 1359|  5.88M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 5.82M, False: 55.5k]
  |  Branch (1359:28): [True: 14.0k, False: 5.81M]
  ------------------
 1360|  5.88M|	}
 1361|  50.6k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 359, False: 50.2k]
  ------------------
 1362|    359|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 170, False: 189]
  |  Branch (1362:30): [True: 150, False: 20]
  ------------------
 1363|    359|		++tagStart;
 1364|    359|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 332, False: 27]
  |  Branch (1364:30): [True: 253, False: 79]
  ------------------
 1365|    359|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  58.7k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 58.7k, Folded]
  ------------------
 1370|  58.7k|		tagStart = tagEnd;
 1371|  58.7k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 8.10k, False: 50.6k]
  ------------------
 1372|  58.7k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 50.6k, False: 8.10k]
  ------------------
 1373|  14.7M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 14.7M, False: 1.22k]
  |  Branch (1373:46): [True: 14.6M, False: 6.88k]
  ------------------
 1374|  14.6M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 14.6M, False: 86.4k]
  |  Branch (1374:29): [True: 53.5k, False: 14.5M]
  ------------------
 1375|  14.6M|		}
 1376|  8.10k|	}
 1377|       |	
 1378|  50.6k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    901|{
 1391|    901|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    901|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    901|	size_t itemNum;
 1394|    901|	size_t itemLim = array->children.size();
 1395|    901|	bool   hasDefault = false;
 1396|       |	
 1397|  14.6k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 14.1k, False: 482]
  ------------------
 1398|       |	
 1399|  14.1k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 14.1k]
  ------------------
 1400|  14.1k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 14.1k]
  ------------------
 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|  14.1k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 419, False: 13.7k]
  ------------------
 1405|    419|			hasDefault = true;
 1406|    419|			break;
 1407|    419|		}
 1408|       |
 1409|  14.1k|	}
 1410|       |
 1411|    901|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 419, False: 482]
  ------------------
 1412|       |
 1413|    419|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 2, False: 417]
  ------------------
 1414|      2|			XMP_Node * temp = array->children[0];
 1415|      2|			array->children[0] = array->children[itemNum];
 1416|      2|			array->children[itemNum] = temp;
 1417|      2|		}
 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|    419|	}
 1423|       |	
 1424|    901|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.31k|{
 1435|  1.31k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.31k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.31k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  17.6k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 16.6k, False: 938]
  ------------------
 1440|  16.6k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  16.6k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 272, False: 16.4k]
  |  Branch (1441:50): [True: 106, False: 16.3k]
  ------------------
 1442|  16.6k|	}
 1443|       |	
 1444|  1.31k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.27k, False: 37]
  |  Branch (1444:25): [True: 901, False: 378]
  ------------------
 1445|    901|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    901|		NormalizeLangArray ( xmpParent );
 1447|    901|	}
 1448|       |
 1449|  1.31k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   177k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   177k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   177k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   177k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   177k|	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: 177k]
  ------------------
  161|       |
  162|   177k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 177k]
  |  Branch (162:29): [True: 0, False: 177k]
  ------------------
  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.5M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 14.3M, False: 177k]
  ------------------
  166|  14.3M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 14.3M]
  |  Branch (166:24): [True: 0, False: 14.3M]
  ------------------
  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.3M|	}
  170|       |
  171|   177k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   177k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 177k]
  ------------------
  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|   177k|	XMP_StringPtr colonPos = propName;
  177|  9.34M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 9.34M, False: 170]
  |  Branch (177:30): [True: 9.17M, False: 177k]
  ------------------
  178|   177k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   177k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 170, False: 177k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|    170|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|    170|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|    170|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   177k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   177k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   177k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   177k|		XMP_VarString prefix ( propName, prefixLen );
  198|   177k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   177k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 177k]
  ------------------
  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|   177k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 15, False: 177k]
  ------------------
  203|     15|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   177k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   177k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   177k|	}
  210|       |
  211|   177k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|  69.5k|{
  220|  69.5k|	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: 69.5k]
  ------------------
  221|       |
  222|  69.5k|	XMP_StringPtr colonPos = qualName;
  223|   304k|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 304k, False: 0]
  |  Branch (223:34): [True: 235k, False: 69.5k]
  ------------------
  224|  69.5k|	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: 69.5k]
  |  Branch (224:33): [True: 0, False: 69.5k]
  ------------------
  225|       |
  226|  69.5k|	VerifySimpleXMLName ( qualName, colonPos );
  227|  69.5k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|  69.5k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|  69.5k|	XMP_VarString prefix ( qualName, prefixLen );
  231|  69.5k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|  69.5k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 0, False: 69.5k]
  ------------------
  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|  69.5k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   390k|{
  395|   390k|	XMP_Node * nextNode = 0;
  396|   390k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   390k|	XMP_Index      index    = 0;
  398|   390k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   390k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   390k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   390k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 193k, False: 196k]
  ------------------
  403|       |
  404|   193k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   196k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 53.1k, False: 143k]
  ------------------
  407|       |	
  408|  53.1k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|  53.1k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|  53.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|  53.1k|		++qualStep;
  411|  53.1k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   143k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   143k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 0, False: 143k]
  ------------------
  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|   143k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 143k, False: 0]
  ------------------
  422|   143k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   143k|		} 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|   143k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 143k, False: 0]
  |  Branch (437:24): [True: 143k, False: 0]
  ------------------
  438|       |
  439|   143k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 143k]
  |  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|   143k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 143k, False: 0]
  |  Branch (464:27): [True: 143k, False: 0]
  ------------------
  465|       |	
  466|   143k|	}
  467|       |
  468|   390k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   390k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 390k, False: 0]
  |  Branch (468:26): [True: 168, False: 390k]
  ------------------
  469|    168|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|    168|	}
  471|       |	
  472|   390k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   390k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   390k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   390k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   390k|	return nextNode;
  475|       |	
  476|   390k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   143k|{
  249|   143k|	XMP_Index index = 0;
  250|   143k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   143k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   143k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|   539k|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 395k, False: 143k]
  ------------------
  255|   395k|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|   395k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|   395k|		index = (index * 10) + (indexStep[chNum] - '0');
  257|   395k|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 395k]
  ------------------
  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|   395k|	}
  261|       |
  262|   143k|	--index;	// Change to a C-style, zero based index.
  263|   143k|	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: 143k]
  ------------------
  264|       |
  265|   143k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 0, False: 143k]
  |  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|   143k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 143k]
  ------------------
  272|   143k|	return index;
  273|       |	
  274|   143k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|    168|{
  488|       |
  489|    168|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 0, False: 168]
  ------------------
  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|    168|}	// CheckImplicitStruct

_ZN13XMP_AutoMutexC2Ev:
  222|   284k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   284k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   284k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|  66.1k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 66.1k, False: 218k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   218k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   354k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   213k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|  26.3k|		: options(_options), name(_name), parent(_parent)
  435|  26.3k|	{
  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|  26.3k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   131k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   131k|	{
  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|   131k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  54.2k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  54.2k|	{
  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|  54.2k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   225k|	{
  479|   370k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 145k, False: 225k]
  ------------------
  480|   145k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 145k, False: 0]
  ------------------
  481|   145k|		}
  482|   225k|		children.clear();
  483|   225k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   225k|	{
  487|   280k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 55.1k, False: 225k]
  ------------------
  488|  55.1k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 55.1k, False: 0]
  ------------------
  489|  55.1k|		}
  490|   225k|		qualifiers.clear();
  491|   225k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  13.1k|	{
  495|  13.1k|		options = 0;
  496|  13.1k|		name.erase();
  497|  13.1k|		value.erase();
  498|  13.1k|		this->RemoveChildren();
  499|  13.1k|		this->RemoveQualifiers();
  500|  13.1k|	}
_ZN8XMP_NodeD2Ev:
  502|   211k|	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|  10.6k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  10.6k|{
  429|  10.6k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 10.6k]
  ------------------
  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|  10.6k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 3.13k, False: 7.50k]
  ------------------
  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.13k|		XMP_ExpandedXPath propPath;
  445|  3.13k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  3.13k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  3.13k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.13k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  3.13k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 3.13k, False: 0]
  ------------------
  449|       |
  450|  3.13k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  3.13k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 0, False: 3.13k]
  ------------------
  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.13k|			propName = rootName.c_str();
  458|  3.13k|			size_t leafOffset = rootName.size();
  459|  54.1k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 51.0k, False: 3.13k]
  |  Branch (459:32): [True: 51.0k, False: 0]
  |  Branch (459:65): [True: 51.0k, False: 0]
  ------------------
  460|  3.13k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 0, False: 3.13k]
  ------------------
  461|       |
  462|  3.13k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  3.13k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  3.13k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 3.13k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  3.13k|		}
  469|       |	
  470|  7.50k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 7.50k]
  ------------------
  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|  7.50k|	} 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|  19.6k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 12.1k, False: 7.50k]
  ------------------
  507|       |
  508|  12.1k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  12.1k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  12.1k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  12.1k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 12.1k, False: 0]
  ------------------
  513|  12.1k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  12.1k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 12.1k]
  ------------------
  515|  12.1k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 12.1k]
  ------------------
  516|  12.1k|			}
  517|       |
  518|  12.1k|		}
  519|       |		
  520|  7.50k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 7.50k]
  ------------------
  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|  7.50k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  10.6k|	info.currPos = info.tree.children.begin();
  554|  10.6k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  10.6k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 10.6k]
  |  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|  10.6k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  10.6k|{
  592|  10.6k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  10.6k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  10.6k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   192k|{
  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|   192k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 1.85k, False: 190k]
  ------------------
  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|   190k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   190k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 8.27k, False: 182k]
  ------------------
  632|   182k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   182k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 182k]
  ------------------
  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|   182k|	*schemaNS = info.currSchema.c_str();
  644|   182k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   182k|	*propOptions = info.currPos->options;
  647|       |
  648|   182k|	*propPath  = "";
  649|   182k|	*pathSize  = 0;
  650|   182k|	*propValue = "";
  651|   182k|	*valueSize = 0;
  652|       |	
  653|   182k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 170k, False: 12.1k]
  ------------------
  654|       |
  655|   170k|		*propPath = info.currPos->fullPath.c_str();
  656|   170k|		*pathSize = info.currPos->fullPath.size();
  657|   170k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 170k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   170k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 153k, False: 17.1k]
  ------------------
  663|   153k|			*propValue = xmpNode->value.c_str();
  664|   153k|			*valueSize = xmpNode->value.size();
  665|   153k|		}
  666|       |
  667|   170k|	}
  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|   182k|	return true;
  675|       |
  676|   182k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   182k|{
  730|   182k|	UNUSED(options);
  731|       |
  732|   182k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   182k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  3.13k|{
  182|       |
  183|  3.13k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  3.13k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   170k|{
  115|   170k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   170k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   170k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 50.0k, False: 120k]
  |  Branch (118:44): [True: 50.0k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  50.0k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  50.0k|		leafOffset += 2;
  126|       |		
  127|   103k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 53.5k, False: 50.0k]
  ------------------
  128|  53.5k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  53.5k|			currPath += xmpQual->name;
  130|  53.5k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  53.5k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  53.5k|		}
  136|       |		
  137|  50.0k|		leafOffset -= 2;
  138|  50.0k|		currPath.erase ( leafOffset );
  139|       |
  140|  50.0k|	}
  141|       |
  142|   170k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 17.0k, False: 153k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  17.0k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  17.0k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  17.0k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 9.93k, False: 7.11k]
  ------------------
  151|  9.93k|			currPath += '/';
  152|  9.93k|			leafOffset += 1;
  153|  9.93k|		}
  154|       |		
  155|   150k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 133k, False: 17.0k]
  ------------------
  156|   133k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   133k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 17.1k, False: 115k]
  ------------------
  158|  17.1k|				currPath += xmpChild->name;
  159|   115k|			} else {
  160|   115k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|   115k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|   115k|				currPath += buffer;
  163|   115k|			}
  164|   133k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   133k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   133k|		}
  170|       |	
  171|  17.0k|	}
  172|       |
  173|   170k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  12.1k|{
   49|  12.1k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  35.5k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 23.3k, False: 12.1k]
  ------------------
   55|  23.3k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  23.3k|		iterSchema.children.push_back ( IterNode ( xmpProp->options, xmpProp->name, 0 ) );
   58|       |		#if TraceIterators
   59|       |			printf ( "        %s\n", xmpProp->name.c_str() );
   60|       |		#endif
   61|  23.3k|	}
   62|       |
   63|  12.1k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   190k|{
  309|   190k|	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|   190k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 182k, False: 8.78k]
  ------------------
  323|       |	
  324|   190k|	bool isSchemaNode = false;
  325|   190k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   190k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 182k, False: 8.29k]
  ------------------
  328|       |
  329|   182k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   182k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 12.1k, False: 170k]
  ------------------
  331|  12.1k|			SetCurrSchema ( info, info.currPos->fullPath );
  332|  12.1k|			xmpNode = FindConstSchema ( &info.xmpObj->tree, info.currPos->fullPath.c_str() );
  ------------------
  |  |  298|  12.1k|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  12.1k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  333|  12.1k|			if ( xmpNode == 0 ) xmpNode = sDummySchema;
  ------------------
  |  Branch (333:9): [True: 0, False: 12.1k]
  ------------------
  334|   170k|		} else {
  335|   170k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   170k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   170k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   170k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   170k|		}
  338|   182k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 182k, False: 15]
  ------------------
  339|       |
  340|     15|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|     15|		info.currPos->children.clear();
  342|     15|		info.currPos->qualifiers.clear();
  343|     15|		AdvanceIterPos ( info );
  344|       |
  345|     15|	}
  346|       |
  347|   190k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 8.27k, False: 182k]
  ------------------
  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|   182k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   182k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   182k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 182k, False: 15]
  ------------------
  356|   182k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 170k, False: 12.1k]
  |  Branch (356:28): [True: 170k, False: 0]
  ------------------
  357|   170k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   170k|		}
  359|   182k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   182k|	}
  361|       |	
  362|   182k|	return xmpNode;
  363|       |
  364|   190k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  18.5k|{
  193|       |
  194|  18.5k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  18.5k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   182k|{
  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|   441k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 441k, Folded]
  ------------------
  221|       |	
  222|   441k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 86.5k, False: 355k]
  ------------------
  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|  86.5k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 8.27k, False: 78.2k]
  ------------------
  230|       |
  231|  78.2k|			IterPosPair & parent = info.ancestors.back();
  232|  78.2k|			info.currPos = parent.first;
  233|  78.2k|			info.endPos  = parent.second;
  234|  78.2k|			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|   355k|		} 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|   355k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 95.0k, False: 260k]
  ------------------
  253|  95.0k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 6.45k, False: 88.5k]
  ------------------
  254|  95.0k|				break;
  255|  95.0k|			}
  256|       |
  257|   260k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 182k, False: 78.2k]
  ------------------
  258|   182k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   182k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 49.8k, False: 132k]
  ------------------
  260|  49.8k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  49.8k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  49.8k|					info.currPos = info.currPos->qualifiers.begin();
  263|  49.8k|					break;
  264|  49.8k|				}
  265|   182k|			}
  266|       |
  267|   210k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 182k, False: 28.3k]
  ------------------
  268|   182k|				info.currPos->qualifiers.clear();
  269|   182k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   182k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 28.9k, False: 153k]
  ------------------
  271|  28.9k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  28.9k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  28.9k|					info.currPos = info.currPos->children.begin();
  274|  28.9k|					break;
  275|  28.9k|				}
  276|   182k|			}
  277|       |
  278|   181k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 181k, False: 0]
  ------------------
  279|   181k|				info.currPos->children.clear();
  280|   181k|				++info.currPos;											// Move to the next sibling.
  281|   181k|				continue;
  282|   181k|			}
  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|   181k|		}
  292|       |
  293|   441k|	}	// Loop to find the next node.
  294|       |	
  295|   182k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   182k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   182k|}	// AdvanceIterPos

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  10.3k|{
 1097|  10.3k|	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: 10.3k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  10.3k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 10.3k]
  ------------------
 1099|       |	
 1100|  10.3k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  10.3k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  10.3k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 10.3k, False: 0]
  ------------------
 1105|  10.3k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 10.3k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  10.3k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  10.3k|	}
 1108|       |	
 1109|  10.3k|	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|  10.3k|	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|  10.3k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 10.3k, False: 0]
  ------------------
 1127|       |
 1128|  10.3k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 10.3k, False: 0]
  |  Branch (1128:39): [True: 10.3k, False: 41]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  10.3k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  10.3k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     41|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     41|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 41, False: 0]
  ------------------
 1139|       |
 1140|     41|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     41|				buffer += pendingOverlap;
 1142|     41|				xmpSize -= pendingOverlap;
 1143|     41|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     41|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 41]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     41|				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|     41|			}
 1153|       |
 1154|  10.3k|		}
 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|  10.3k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  10.3k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 10.3k]
  ------------------
 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|  10.3k|		} 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|  10.3k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 41, False: 10.3k]
  ------------------
 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|     41|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     41|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 41, False: 0]
  ------------------
 1190|       |				
 1191|     41|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     41|				parser.pendingCount += pendingOverlap;
 1193|     41|				buffer += pendingOverlap;
 1194|     41|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     41|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 41]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     41|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     41|				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|     41|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 41, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     41|					parser.pendingCount = 0;
 1208|       |
 1209|     41|				} 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|     41|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  10.3k|			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|  10.3k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 10.3k]
  ------------------
 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|  10.3k|		}
 1258|       |		
 1259|  10.3k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 10.3k, False: 41]
  ------------------
 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|  10.3k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  10.3k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 8.76k, False: 1.54k]
  ------------------
 1269|       |
 1270|  8.76k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  8.76k|				NormalizeDCArrays ( &this->tree );
 1272|  8.76k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 8.76k]
  ------------------
 1273|  8.76k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  8.76k|				size_t schemaNum = 0;
 1277|  20.9k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 12.1k, False: 8.76k]
  ------------------
 1278|  12.1k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  12.1k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 12.1k, False: 0]
  ------------------
 1280|  12.1k|						++schemaNum;
 1281|  12.1k|					} 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|  12.1k|				}
 1286|       |				
 1287|  8.76k|			}
 1288|       |
 1289|  10.3k|			delete this->xmlParser;
 1290|  10.3k|			this->xmlParser = 0;
 1291|       |
 1292|  10.3k|		}
 1293|       |		
 1294|  10.3k|	} catch ( ... ) {
 1295|       |
 1296|  2.84k|		delete this->xmlParser;
 1297|  2.84k|		this->xmlParser = 0;
 1298|  2.84k|		prevTkVer = 0;
 1299|  2.84k|		this->tree.ClearNode();
 1300|  2.84k|		throw;
 1301|       |
 1302|  2.84k|	}
 1303|       |	
 1304|  10.3k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  10.3k|{
  811|  10.3k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 10.3k]
  ------------------
  812|       |	
  813|  10.3k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  10.3k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 10.3k]
  ------------------
  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|  10.3k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 10.3k, 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|  10.3k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 10.3k, 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|  10.3k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  10.3k|{
  977|  10.3k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  10.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|  10.3k|	std::string copy;
  992|       |		
  993|  70.2M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 70.2M, False: 10.3k]
  ------------------
  994|       |
  995|  70.2M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 69.9M, False: 267k]
  |  Branch (995:30): [True: 69.7M, False: 235k]
  |  Branch (995:52): [True: 68.6M, False: 1.11M]
  ------------------
  996|  68.6M|			copy.push_back(*spanEnd);
  997|  68.6M|			continue;	// A regular ASCII character.
  998|  68.6M|		}
  999|       |
 1000|  1.61M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 11.5k, False: 1.60M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  11.5k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  11.5k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 11.5k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  11.5k|				copy.append((const char*)spanEnd, uniLen);
 1010|  11.5k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  11.5k|			} 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.60M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 267k, False: 1.33M]
  |  Branch (1026:36): [True: 224k, False: 1.11M]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   491k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   491k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   488k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   244k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 3.62k, False: 488k]
  |  Branch (1030:31): [True: 243k, False: 244k]
  |  Branch (1030:52): [True: 20.5k, False: 224k]
  ------------------
 1031|   267k|				copy.push_back(*spanEnd);
 1032|   267k|				continue;
 1033|   267k|			}
 1034|       |
 1035|   224k|			copy.push_back(' ');
 1036|       |		
 1037|  1.11M|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|  1.11M|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|  1.11M|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|  1.11M|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|  1.11M|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 153, False: 1.11M]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|    153|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 153, False: 0]
  ------------------
 1048|    153|					copy.push_back('&');
 1049|    153|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|    153|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|  1.11M|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 47.1k, False: 1.06M]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  47.1k|				copy.push_back(' ');
 1058|  47.1k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|  1.06M|			} else {
 1061|  1.06M|				copy.push_back('&');
 1062|  1.06M|			}
 1063|       |
 1064|  1.11M|		}
 1065|       |		
 1066|  1.61M|	}
 1067|       |	
 1068|  10.3k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  10.3k|	copy.push_back(' ');
 1070|  10.3k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  10.3k|	return length;
 1072|       |
 1073|  10.3k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  11.5k|{
  868|  11.5k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  11.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  11.5k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 11.5k]
  ------------------
  870|  11.5k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 11.5k]
  ------------------
  871|       |	
  872|  11.5k|	int byteCount = 2;
  873|  11.5k|	XMP_Uns8 firstByte = *charStart;
  874|  16.6k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 5.11k, False: 11.5k]
  ------------------
  875|       |	
  876|  11.5k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 11.5k]
  ------------------
  877|       |
  878|  28.2k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 16.6k, False: 11.5k]
  ------------------
  879|  16.6k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 16.6k]
  ------------------
  880|  16.6k|	}
  881|       |	
  882|  11.5k|	return byteCount;
  883|       |	
  884|  11.5k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|  1.11M|{
  898|  1.11M|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|  1.11M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|  1.11M|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 1.11M]
  ------------------
  900|  1.11M|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|  1.11M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|  1.11M|	size_t tailLen = bufEnd - escStart;
  903|  1.11M|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 153, False: 1.11M]
  ------------------
  904|       |	
  905|  1.11M|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 822k, False: 289k]
  ------------------
  906|       |	
  907|   289k|	XMP_Uns8 escValue = 0;
  908|   289k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   289k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 271k, False: 18.1k]
  |  Branch (910:27): [True: 1.75k, False: 269k]
  ------------------
  911|  1.75k|		escValue = *escPos - '0';
  912|  1.75k|		++escPos;
  913|   287k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 262k, False: 24.4k]
  |  Branch (913:34): [True: 7.45k, False: 255k]
  ------------------
  914|  7.45k|		escValue = *escPos - 'A' + 10;
  915|  7.45k|		++escPos;
  916|   279k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 248k, False: 31.5k]
  |  Branch (916:34): [True: 167k, False: 80.9k]
  ------------------
  917|   167k|		escValue = *escPos - 'a' + 10;
  918|   167k|		++escPos;
  919|   167k|	}
  920|       |	
  921|   289k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 231k, False: 57.7k]
  |  Branch (921:27): [True: 751, False: 230k]
  ------------------
  922|    751|		escValue = (escValue << 4) + (*escPos - '0');
  923|    751|		++escPos;
  924|   288k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 213k, False: 75.0k]
  |  Branch (924:34): [True: 959, False: 212k]
  ------------------
  925|    959|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|    959|		++escPos;
  927|   287k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 205k, False: 82.2k]
  |  Branch (927:34): [True: 103k, False: 102k]
  ------------------
  928|   103k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|   103k|		++escPos;
  930|   103k|	}
  931|       |	
  932|   289k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 289k]
  ------------------
  933|   289k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 228k, False: 60.7k]
  ------------------
  934|       |	
  935|  60.7k|	size_t escLen = escPos - escStart + 1;
  936|  60.7k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 5.79k, False: 54.9k]
  ------------------
  937|       |	
  938|  54.9k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  54.9k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  54.7k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  47.6k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 282, False: 54.7k]
  |  Branch (938:29): [True: 7.05k, False: 47.6k]
  |  Branch (938:50): [True: 514, False: 47.1k]
  ------------------
  939|       |	
  940|  47.1k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  54.9k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  10.3k|{
  152|  10.3k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  10.3k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 1.12k, False: 9.18k]
  ------------------
  155|  10.3k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 1.54k, False: 8.76k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  8.76k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  8.76k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  8.76k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  8.76k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 8.76k]
  ------------------
  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|  9.65k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.89k, False: 7.75k]
  ------------------
  168|  1.89k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.89k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 892, False: 1.00k]
  |  Branch (169:42): [True: 109, False: 892]
  ------------------
  170|  1.00k|				verStr = currAttr->value.c_str();
  171|  1.00k|				break;
  172|  1.00k|			}
  173|  1.89k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  8.76k|	unsigned long part;
  178|  26.9k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 19.0k, False: 7.86k]
  |  Branch (178:29): [True: 4.04k, False: 15.0k]
  |  Branch (178:48): [True: 14.1k, False: 897]
  ------------------
  179|       |	
  180|  8.76k|	part = 0;
  181|  12.5k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 4.64k, False: 7.86k]
  |  Branch (181:28): [True: 3.91k, False: 734]
  |  Branch (181:48): [True: 3.74k, False: 161]
  ------------------
  182|  3.74k|		part = (part * 10) + (*verStr - '0');
  183|  3.74k|		++verStr;
  184|  3.74k|	}
  185|  8.76k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 153, False: 8.60k]
  ------------------
  186|  8.76k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  8.76k|	part = 0;
  189|  8.76k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 513, False: 8.24k]
  ------------------
  190|  10.6k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 2.75k, False: 7.86k]
  |  Branch (190:28): [True: 2.07k, False: 683]
  |  Branch (190:48): [True: 1.85k, False: 212]
  ------------------
  191|  1.85k|		part = (part * 10) + (*verStr - '0');
  192|  1.85k|		++verStr;
  193|  1.85k|	}
  194|  8.76k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 59, False: 8.70k]
  ------------------
  195|  8.76k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  8.76k|	part = 0;
  198|  8.76k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 268, False: 8.49k]
  ------------------
  199|  9.95k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 2.08k, False: 7.86k]
  |  Branch (199:28): [True: 1.42k, False: 666]
  |  Branch (199:48): [True: 1.19k, False: 229]
  ------------------
  200|  1.19k|		part = (part * 10) + (*verStr - '0');
  201|  1.19k|		++verStr;
  202|  1.19k|	}
  203|  8.76k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 105, False: 8.65k]
  ------------------
  204|  8.76k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  8.76k|	part = 0;
  207|  8.76k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 489, False: 8.27k]
  ------------------
  208|  11.5k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 3.62k, False: 7.95k]
  |  Branch (208:28): [True: 3.39k, False: 229]
  |  Branch (208:48): [True: 2.82k, False: 575]
  ------------------
  209|  2.82k|		part = (part * 10) + (*verStr - '0');
  210|  2.82k|		++verStr;
  211|  2.82k|	}
  212|  8.76k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 134, False: 8.62k]
  ------------------
  213|  8.76k|	thiz->prevTkVer += part;
  214|       |	
  215|  8.76k|	return rootNode;
  216|       |	
  217|  8.76k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  5.30k|{
  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|  16.0k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 12.3k, False: 3.65k]
  ------------------
  116|  12.3k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  12.3k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 7.95k, False: 4.39k]
  ------------------
  118|  4.39k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 1.65k, False: 2.73k]
  |  Branch (118:44): [True: 2, False: 2.73k]
  ------------------
  119|  4.39k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  3.65k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 3.65k, False: 0]
  ------------------
  122|  10.7k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 8.11k, False: 2.59k]
  ------------------
  123|  8.11k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  8.11k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 5.40k, False: 2.70k]
  ------------------
  125|  2.70k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 1.06k, False: 1.64k]
  ------------------
  126|  2.70k|		}
  127|  3.65k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  5.04k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 2.53k, False: 2.50k]
  ------------------
  131|  2.53k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  2.53k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 81, False: 2.45k]
  ------------------
  133|  2.53k|	}
  134|       |	
  135|  2.50k|	return 0;
  136|       |
  137|  2.59k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  5.96k|{
  232|  5.96k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.96k|#define kXMP_ExistingOnly	false
  ------------------
  233|  5.96k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 4.54k, False: 1.42k]
  ------------------
  234|       |	
  235|  5.34k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 3.92k, False: 1.42k]
  ------------------
  236|  3.92k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  3.92k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  3.92k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 370, False: 3.55k]
  ------------------
  240|       |		
  241|  3.55k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 126, False: 3.43k]
  ------------------
  242|  3.43k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 80, False: 3.35k]
  ------------------
  243|    206|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  3.35k|		} else if (
  245|  3.35k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 92, False: 3.26k]
  ------------------
  246|  3.26k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 58, False: 3.20k]
  ------------------
  247|  3.20k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 6, False: 3.19k]
  ------------------
  248|    156|			arrayForm = kXMP_PropArrayIsAltText;
  249|  3.19k|		} else if (
  250|  3.19k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 18, False: 3.17k]
  ------------------
  251|  3.17k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 184, False: 2.99k]
  ------------------
  252|  2.99k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 88, False: 2.90k]
  ------------------
  253|  2.90k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 35, False: 2.87k]
  ------------------
  254|  2.87k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 94, False: 2.77k]
  ------------------
  255|  2.77k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 13, False: 2.76k]
  ------------------
  256|    432|			arrayForm = kXMP_PropValueIsArray;
  257|    432|		}
  258|  3.55k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 2.76k, False: 794]
  ------------------
  259|       |		
  260|    794|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    794|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    794|		dcSchema->children[propNum] = newArray;
  263|    794|		newArray->children.push_back ( currProp );
  264|    794|		currProp->parent = newArray;
  265|    794|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    794|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    794|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 156, False: 638]
  |  Branch (267:44): [True: 156, False: 0]
  ------------------
  268|    156|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    156|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    156|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 156, False: 0]
  ------------------
  271|    156|				currProp->qualifiers.push_back ( newLang );
  272|    156|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    156|		}
  276|       |
  277|    794|	}
  278|       |	
  279|  1.42k|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  5.96k|{
  666|  5.96k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  5.96k|	XMP_Node * currSchema = 0;
  671|       |
  672|  5.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.96k|#define kXMP_ExistingOnly	false
  ------------------
  673|  5.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 27, False: 5.93k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     27|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     27|#define kXMP_ExistingOnly	false
  ------------------
  677|     27|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 27]
  ------------------
  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|     27|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     27|#define kXMP_ExistingOnly	false
  ------------------
  682|     27|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 27]
  |  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|     27|	}
  697|       |
  698|  5.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.96k|#define kXMP_ExistingOnly	false
  ------------------
  699|  5.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 56, False: 5.90k]
  ------------------
  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|     56|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|     56|#define kXMP_ExistingOnly	false
  ------------------
  703|     56|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 56]
  ------------------
  704|     56|	}
  705|       |
  706|  5.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.96k|#define kXMP_ExistingOnly	false
  ------------------
  707|  5.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 1.42k, False: 4.54k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|  1.42k|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.42k|#define kXMP_ExistingOnly	false
  ------------------
  710|  1.42k|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 153, False: 1.26k]
  ------------------
  711|    153|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|    153|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|    153|		}
  714|  1.42k|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  5.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  5.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  5.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  5.96k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  5.96k|	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|  5.96k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 947, False: 5.01k]
  ------------------
  732|       |
  733|    947|		bool nameIsUUID = false;
  734|    947|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    947|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    947|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 133, False: 814]
  |  |  ------------------
  ------------------
  737|       |
  738|    133|			nameIsUUID = true;
  739|       |
  740|    814|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 394, False: 420]
  ------------------
  741|       |
  742|    394|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  6.10k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 6.06k, False: 37]
  ------------------
  744|  6.06k|				char ch = nameStr[i];
  745|  6.06k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 298, False: 5.76k]
  ------------------
  746|    298|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 34, False: 264]
  |  Branch (746:23): [True: 58, False: 206]
  |  Branch (746:36): [True: 18, False: 188]
  |  Branch (746:49): [True: 60, False: 128]
  ------------------
  747|    128|					nameIsUUID = false;
  748|    128|					break;
  749|  5.76k|				} else {
  750|  5.76k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 5.69k, False: 73]
  |  Branch (750:27): [True: 305, False: 5.38k]
  |  Branch (750:44): [True: 5.29k, False: 167]
  |  Branch (750:59): [True: 5.23k, False: 62]
  ------------------
  751|    229|					nameIsUUID = false;
  752|    229|					break;
  753|  5.76k|				}
  754|  6.06k|			}
  755|       |
  756|    394|		}
  757|       |		
  758|    947|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 170, False: 777]
  ------------------
  759|       |
  760|    170|			XMP_ExpandedXPath expPath;
  761|    170|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|    170|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|    170|#define kXMP_CreateNodes	true
  ------------------
  763|    170|			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: 170]
  ------------------
  764|       |
  765|    170|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|    170|			idNode->value = tree.name;
  767|    170|			idNode->RemoveChildren();
  768|    170|			idNode->RemoveQualifiers();
  769|       |
  770|    170|			tree.name.erase();
  771|       |
  772|    170|		}
  773|       |
  774|    947|	}
  775|       |
  776|  5.96k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  29.8k|{
  610|  29.8k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  29.8k|#define kXMP_ExistingOnly	false
  ------------------
  611|  29.8k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 25.3k, False: 4.46k]
  ------------------
  612|       |	
  613|  4.46k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.46k|#define kXMP_ExistingOnly	false
  ------------------
  614|  4.46k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 4.08k, False: 385]
  |  Branch (614:27): [True: 313, False: 72]
  ------------------
  615|       |	
  616|     72|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 0, False: 72]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     72|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  4.18k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 4.11k, False: 72]
  ------------------
  622|       |
  623|  4.11k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  4.11k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 888, False: 3.22k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|    888|			delete ( currChild );
  629|    888|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  3.22k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 754, False: 2.47k]
  ------------------
  632|       |		
  633|    754|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 41, False: 713]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     41|				delete ( currChild );
  637|     41|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|    713|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|    713|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|    713|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 697, False: 16]
  ------------------
  644|    697|					currChild->qualifiers.push_back ( repairLang );
  645|    697|				} else {
  646|     16|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     16|				}
  648|    713|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|    713|			}
  651|       |
  652|    754|		}
  653|       |
  654|  4.11k|	}
  655|       |
  656|     72|}	// RepairAltText

_ZN7XMPMetaC2Ev:
  588|  10.3k|XMPMeta::XMPMeta() : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
  589|  10.3k|{
  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|  10.3k|}	// XMPMeta
_ZN7XMPMetaD2Ev:
  599|  10.3k|{
  600|       |	#if XMP_TraceCTorDTor
  601|       |		printf ( "Destruct XMPMeta @ %.8X\n", this );
  602|       |	#endif
  603|       |
  604|  10.3k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  10.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  605|  10.3k|	if ( xmlParser != 0 ) delete ( xmlParser );
  ------------------
  |  Branch (605:7): [True: 0, False: 10.3k]
  ------------------
  606|  10.3k|	xmlParser = 0;
  607|       |
  608|  10.3k|}	// ~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|   218k|{
  845|   218k|	UNUSED(options);
  846|       |
  847|       |    #if TraceXMPLocking
  848|       |    	fprintf ( xmpOut, "  Unlocking XMP toolkit, count = %d\n", sLockCount ); fflush ( xmpOut );
  849|       |	#endif
  850|   218k|    --sLockCount;
  851|   218k|    XMP_Assert ( sLockCount == 0 );
  ------------------
  |  |  142|   218k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  852|   218k|	XMP_ExitCriticalRegion ( sXMPCoreLock );
  853|       |
  854|   218k|}	// Unlock
_ZN7XMPMeta17RegisterNamespaceEPKcS1_:
 1041|  35.2k|{
 1042|  35.2k|	if ( (*namespaceURI == 0) || (*prefix == 0) ) {
  ------------------
  |  Branch (1042:7): [True: 0, False: 35.2k]
  |  Branch (1042:31): [True: 0, False: 35.2k]
  ------------------
 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|  35.2k|	XMP_VarString	nsURI ( namespaceURI );
 1047|  35.2k|	XMP_VarString	prfix ( prefix );
 1048|  35.2k|	if ( prfix[prfix.size()-1] != ':' ) prfix += ':';
  ------------------
  |  Branch (1048:7): [True: 35.2k, False: 0]
  ------------------
 1049|  35.2k|	VerifySimpleXMLName ( prefix, prefix+prfix.size()-1 );	// Exclude the colon.
 1050|       |	
 1051|       |        // Set the new namespace in both maps.
 1052|  35.2k|        (*sNamespaceURIToPrefixMap)[nsURI] = prfix;
 1053|  35.2k|        (*sNamespacePrefixToURIMap)[prfix] = nsURI;
 1054|       |	
 1055|  35.2k|}	// RegisterNamespace
_ZN7XMPMeta18GetNamespacePrefixEPKcPS1_Pj:
 1066|   281k|{
 1067|   281k|	bool	found	= false;
 1068|       |	
 1069|   281k|	XMP_Assert ( *namespaceURI != 0 ); 	// ! Enforced by wrapper.
  ------------------
  |  |  142|   281k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1070|   281k|	XMP_Assert ( (namespacePrefix != 0) && (prefixSize != 0) );	// ! Enforced by wrapper.
  ------------------
  |  |  142|   281k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1071|       |
 1072|   281k|	XMP_VarString    nsURI ( namespaceURI );
 1073|   281k|	XMP_StringMapPos uriPos	= sNamespaceURIToPrefixMap->find ( nsURI );
 1074|       |	
 1075|   281k|	if ( uriPos != sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (1075:7): [True: 281k, False: 0]
  ------------------
 1076|   281k|		*namespacePrefix = uriPos->second.c_str();
 1077|   281k|		*prefixSize = uriPos->second.size();
 1078|   281k|		found = true;
 1079|   281k|	}
 1080|       |	
 1081|   281k|	return found;
 1082|       |	
 1083|   281k|}	// GetNamespacePrefix
_ZNK7XMPMeta15CountArrayItemsEPKcS1_:
 1510|  3.65k|{
 1511|  3.65k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.65k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1512|       |
 1513|  3.65k|	XMP_ExpandedXPath	expPath;
 1514|  3.65k|	ExpandXPath ( schemaNS, arrayName, &expPath );
 1515|       |	
 1516|  3.65k|	const XMP_Node * arrayNode = FindConstNode ( &tree, expPath );
  ------------------
  |  |  301|  3.65k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.65k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
 1517|       |
 1518|  3.65k|	if ( arrayNode == 0 ) return 0;
  ------------------
  |  Branch (1518:7): [True: 0, False: 3.65k]
  ------------------
 1519|  3.65k|	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.65k]
  ------------------
 1520|  3.65k|	return arrayNode->children.size();
 1521|       |	
 1522|  3.65k|}	// 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

