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

_ZN5Exiv28AsfVideo7GUIDTagC2EjttNSt3__15arrayIhLm8EEE:
   83|    124|        data1_(data1), data2_(data2), data3_(data3), data4_(data4) {
   84|    124|    }
_ZNK5Exiv28AsfVideo12HeaderReader7getSizeEv:
  106|  2.36k|    [[nodiscard]] uint64_t getSize() const {
  107|  2.36k|      return size_;
  108|  2.36k|    }
_ZNK5Exiv28AsfVideo12HeaderReader16getRemainingSizeEv:
  110|    473|    [[nodiscard]] uint64_t getRemainingSize() const {
  111|    473|      return remaining_size_;
  112|    473|    }
_ZN5Exiv28AsfVideo12HeaderReader5getIdEv:
  114|  2.11k|    [[nodiscard]] DataBuf& getId() {
  115|  2.11k|      return IdBuf_;
  116|  2.11k|    }

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

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

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

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

_ZN5Exiv25Image16setTypeSupportedENS_9ImageTypeEt:
  456|     73|  void setTypeSupported(ImageType imageType, uint16_t supportedMetadata) {
  457|     73|    imageType_ = imageType;
  458|     73|    supportedMetadata_ = supportedMetadata;
  459|     73|  }

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  3.97M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  7.24M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   120k|  Key(const Key&) = default;

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

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

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

_ZNK5Exiv29RiffVideo12HeaderReader7getSizeEv:
   54|  7.54k|    [[nodiscard]] uint64_t getSize() const {
   55|  7.54k|      return size_;
   56|  7.54k|    }
_ZNK5Exiv29RiffVideo12HeaderReader5getIdEv:
   58|  64.9k|    [[nodiscard]] const std::string& getId() const {
   59|  64.9k|      return id_;
   60|  64.9k|    }

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

_ZN5Exiv27DataBuf5beginEv:
  150|  90.4M|  [[nodiscard]] auto begin() noexcept {
  151|  90.4M|    return pData_.begin();
  152|  90.4M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  1.49k|  [[nodiscard]] auto end() noexcept {
  155|  1.49k|    return pData_.end();
  156|  1.49k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  15.3k|  [[nodiscard]] auto begin() const noexcept {
  159|  15.3k|    return pData_.begin();
  160|  15.3k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  15.3k|  [[nodiscard]] auto end() const noexcept {
  163|  15.3k|    return pData_.end();
  164|  15.3k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  4.35M|  [[nodiscard]] size_t size() const {
  167|  4.35M|    return pData_.size();
  168|  4.35M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  19.0k|  [[nodiscard]] bool empty() const {
  195|  19.0k|    return pData_.empty();
  196|  19.0k|  }
_ZN5Exiv27DataBufC2Ev:
  126|   623k|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  36.2k|const T* find(T (&src)[N], const K& key) {
  448|  36.2k|  static_assert(N > 0, "Passed zero length find");
  449|  36.2k|  auto rc = std::find(src, src + N, key);
  450|  36.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 36.2k]
  ------------------
  451|  36.2k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  31.0k|std::string toString(const T& arg) {
  467|  31.0k|  return toStringHelper(arg, std::is_integral<T>());
  468|  31.0k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  31.0k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  31.0k|  return std::to_string(arg);
  457|  31.0k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  5.19M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  5.19M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 2.84M, False: 2.34M]
  ------------------
  229|  2.84M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  2.84M|  }
  231|  2.34M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  5.19M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|  33.7k|const T* find(T (&src)[N], const K& key) {
  448|  33.7k|  static_assert(N > 0, "Passed zero length find");
  449|  33.7k|  auto rc = std::find(src, src + N, key);
  450|  33.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 30.3k, False: 3.38k]
  ------------------
  451|  33.7k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  12.6k|const T* find(T (&src)[N], const K& key) {
  448|  12.6k|  static_assert(N > 0, "Passed zero length find");
  449|  12.6k|  auto rc = std::find(src, src + N, key);
  450|  12.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 11.3k, False: 1.33k]
  ------------------
  451|  12.6k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|  95.1k|const T* find(T (&src)[N], const K& key) {
  448|  95.1k|  static_assert(N > 0, "Passed zero length find");
  449|  95.1k|  auto rc = std::find(src, src + N, key);
  450|  95.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 27.9k, False: 67.1k]
  ------------------
  451|  95.1k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|   861k|const T* find(T (&src)[N], const K& key) {
  448|   861k|  static_assert(N > 0, "Passed zero length find");
  449|   861k|  auto rc = std::find(src, src + N, key);
  450|   861k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 22, False: 861k]
  ------------------
  451|   861k|}
_ZN5Exiv24findIKNS_8mimeTypeEiLm6EEEPKT_RAT1__S3_RKT0_:
  447|    123|const T* find(T (&src)[N], const K& key) {
  448|    123|  static_assert(N > 0, "Passed zero length find");
  449|    123|  auto rc = std::find(src, src + N, key);
  450|    123|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 117, False: 6]
  ------------------
  451|    123|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  3.26M|const T* find(T (&src)[N], const K& key) {
  448|  3.26M|  static_assert(N > 0, "Passed zero length find");
  449|  3.26M|  auto rc = std::find(src, src + N, key);
  450|  3.26M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 806k, False: 2.45M]
  ------------------
  451|  3.26M|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  25.4k|std::string toString(const T& arg) {
  467|  25.4k|  return toStringHelper(arg, std::is_integral<T>());
  468|  25.4k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  25.4k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  25.4k|  return std::to_string(arg);
  457|  25.4k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  5.09k|std::string toString(const T& arg) {
  467|  5.09k|  return toStringHelper(arg, std::is_integral<T>());
  468|  5.09k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  5.09k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  5.09k|  return std::to_string(arg);
  457|  5.09k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   123k|std::string toString(const T& arg) {
  467|   123k|  return toStringHelper(arg, std::is_integral<T>());
  468|   123k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   123k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   123k|  return std::to_string(arg);
  457|   123k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.92k|std::string toString(const T& arg) {
  467|  1.92k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.92k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  1.92k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.92k|  std::ostringstream os;
  462|  1.92k|  os << arg;
  463|  1.92k|  return os.str();
  464|  1.92k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  50.7k|std::string toString(const T& arg) {
  467|  50.7k|  return toStringHelper(arg, std::is_integral<T>());
  468|  50.7k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  50.7k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  50.7k|  std::ostringstream os;
  462|  50.7k|  os << arg;
  463|  50.7k|  return os.str();
  464|  50.7k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  11.9k|std::string toString(const T& arg) {
  467|  11.9k|  return toStringHelper(arg, std::is_integral<T>());
  468|  11.9k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  11.9k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  11.9k|  return std::to_string(arg);
  457|  11.9k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  1.87k|const T* find(T (&src)[N], const K& key) {
  448|  1.87k|  static_assert(N > 0, "Passed zero length find");
  449|  1.87k|  auto rc = std::find(src, src + N, key);
  450|  1.87k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.14k, False: 733]
  ------------------
  451|  1.87k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|    792|const T* find(T (&src)[N], const K& key) {
  448|    792|  static_assert(N > 0, "Passed zero length find");
  449|    792|  auto rc = std::find(src, src + N, key);
  450|    792|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 441, False: 351]
  ------------------
  451|    792|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    733|const T* find(T (&src)[N], const K& key) {
  448|    733|  static_assert(N > 0, "Passed zero length find");
  449|    733|  auto rc = std::find(src, src + N, key);
  450|    733|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 462, False: 271]
  ------------------
  451|    733|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|  73.9k|const T* find(T (&src)[N], const K& key) {
  448|  73.9k|  static_assert(N > 0, "Passed zero length find");
  449|  73.9k|  auto rc = std::find(src, src + N, key);
  450|  73.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.91k, False: 72.0k]
  ------------------
  451|  73.9k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  2.19k|const T* find(T (&src)[N], const K& key) {
  448|  2.19k|  static_assert(N > 0, "Passed zero length find");
  449|  2.19k|  auto rc = std::find(src, src + N, key);
  450|  2.19k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.40k, False: 797]
  ------------------
  451|  2.19k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  16.3k|const T* find(T (&src)[N], const K& key) {
  448|  16.3k|  static_assert(N > 0, "Passed zero length find");
  449|  16.3k|  auto rc = std::find(src, src + N, key);
  450|  16.3k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 12.8k, False: 3.57k]
  ------------------
  451|  16.3k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  5.92k|const T* find(T (&src)[N], const K& key) {
  448|  5.92k|  static_assert(N > 0, "Passed zero length find");
  449|  5.92k|  auto rc = std::find(src, src + N, key);
  450|  5.92k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.63k, False: 2.29k]
  ------------------
  451|  5.92k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  2.48k|std::string toString(const T& arg) {
  467|  2.48k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.48k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  2.48k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  2.48k|  std::ostringstream os;
  462|  2.48k|  os << arg;
  463|  2.48k|  return os.str();
  464|  2.48k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.55k|std::string toString(const T& arg) {
  467|  1.55k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.55k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.55k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.55k|  return std::to_string(arg);
  457|  1.55k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|  2.28M|std::string toString(const T& arg) {
  467|  2.28M|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.28M|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|  2.28M|std::string toStringHelper(const T& arg, std::false_type) {
  461|  2.28M|  std::ostringstream os;
  462|  2.28M|  os << arg;
  463|  2.28M|  return os.str();
  464|  2.28M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|  2.86k|const T* find(T (&src)[N], const K& key) {
  448|  2.86k|  static_assert(N > 0, "Passed zero length find");
  449|  2.86k|  auto rc = std::find(src, src + N, key);
  450|  2.86k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.32k, False: 1.53k]
  ------------------
  451|  2.86k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|   636k|const T* find(T (&src)[N], const K& key) {
  448|   636k|  static_assert(N > 0, "Passed zero length find");
  449|   636k|  auto rc = std::find(src, src + N, key);
  450|   636k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 78.9k, False: 557k]
  ------------------
  451|   636k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|   636k|const T* find(T (&src)[N], const K& key) {
  448|   636k|  static_assert(N > 0, "Passed zero length find");
  449|   636k|  auto rc = std::find(src, src + N, key);
  450|   636k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 632k, False: 3.29k]
  ------------------
  451|   636k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|   823k|const T* find(T (&src)[N], const K& key) {
  448|   823k|  static_assert(N > 0, "Passed zero length find");
  449|   823k|  auto rc = std::find(src, src + N, key);
  450|   823k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 771k, False: 51.8k]
  ------------------
  451|   823k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  99.6k|const T* find(T (&src)[N], const K& key) {
  448|  99.6k|  static_assert(N > 0, "Passed zero length find");
  449|  99.6k|  auto rc = std::find(src, src + N, key);
  450|  99.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 42.2k, False: 57.4k]
  ------------------
  451|  99.6k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  16.1k|const T* find(T (&src)[N], const K& key) {
  448|  16.1k|  static_assert(N > 0, "Passed zero length find");
  449|  16.1k|  auto rc = std::find(src, src + N, key);
  450|  16.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 13.0k, False: 3.13k]
  ------------------
  451|  16.1k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  16.1k|const T* find(T (&src)[N], const K& key) {
  448|  16.1k|  static_assert(N > 0, "Passed zero length find");
  449|  16.1k|  auto rc = std::find(src, src + N, key);
  450|  16.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 11.9k, False: 4.23k]
  ------------------
  451|  16.1k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|  2.36k|const T* find(T (&src)[N], const K& key) {
  448|  2.36k|  static_assert(N > 0, "Passed zero length find");
  449|  2.36k|  auto rc = std::find(src, src + N, key);
  450|  2.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 643, False: 1.72k]
  ------------------
  451|  2.36k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   155k|const T* find(T (&src)[N], const K& key) {
  448|   155k|  static_assert(N > 0, "Passed zero length find");
  449|   155k|  auto rc = std::find(src, src + N, key);
  450|   155k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 131k, False: 23.9k]
  ------------------
  451|   155k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|  33.7k|const T* find(T (&src)[N], const K& key) {
  448|  33.7k|  static_assert(N > 0, "Passed zero length find");
  449|  33.7k|  auto rc = std::find(src, src + N, key);
  450|  33.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 27.2k, False: 6.42k]
  ------------------
  451|  33.7k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  6.18k|const T* find(T (&src)[N], const K& key) {
  448|  6.18k|  static_assert(N > 0, "Passed zero length find");
  449|  6.18k|  auto rc = std::find(src, src + N, key);
  450|  6.18k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 727, False: 5.45k]
  ------------------
  451|  6.18k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  11.8k|const T* find(T (&src)[N], const K& key) {
  448|  11.8k|  static_assert(N > 0, "Passed zero length find");
  449|  11.8k|  auto rc = std::find(src, src + N, key);
  450|  11.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.78k, False: 8.11k]
  ------------------
  451|  11.8k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  5.87M|const T* find(T (&src)[N], const K& key) {
  448|  5.87M|  static_assert(N > 0, "Passed zero length find");
  449|  5.87M|  auto rc = std::find(src, src + N, key);
  450|  5.87M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 5.87M]
  ------------------
  451|  5.87M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  2.59M|const T* find(T (&src)[N], const K& key) {
  448|  2.59M|  static_assert(N > 0, "Passed zero length find");
  449|  2.59M|  auto rc = std::find(src, src + N, key);
  450|  2.59M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 2.59M]
  ------------------
  451|  2.59M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  1.57M|const T* find(T (&src)[N], const K& key) {
  448|  1.57M|  static_assert(N > 0, "Passed zero length find");
  449|  1.57M|  auto rc = std::find(src, src + N, key);
  450|  1.57M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.56M, False: 10.4k]
  ------------------
  451|  1.57M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  12.0k|const T* find(T (&src)[N], const K& key) {
  448|  12.0k|  static_assert(N > 0, "Passed zero length find");
  449|  12.0k|  auto rc = std::find(src, src + N, key);
  450|  12.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.91k, False: 6.12k]
  ------------------
  451|  12.0k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|    414|const T* find(T (&src)[N], const K& key) {
  448|    414|  static_assert(N > 0, "Passed zero length find");
  449|    414|  auto rc = std::find(src, src + N, key);
  450|    414|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 159, False: 255]
  ------------------
  451|    414|}
_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: 15, False: 15]
  ------------------
  489|     15|    ok = false;
  490|     30|  return tmp;
  491|     30|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     18|const T* find(T (&src)[N], const K& key) {
  448|     18|  static_assert(N > 0, "Passed zero length find");
  449|     18|  auto rc = std::find(src, src + N, key);
  450|     18|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 18, False: 0]
  ------------------
  451|     18|}

_ZNK5Exiv25Value6typeIdEv:
   85|  3.27M|  TypeId typeId() const {
   86|  3.27M|    return type_;
   87|  3.27M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  4.06M|  UniquePtr clone() const {
   94|  4.06M|    return UniquePtr(clone_());
   95|  4.06M|  }
_ZNK5Exiv25Value2okEv:
  181|  13.6k|  bool ok() const {
  182|  13.6k|    return ok_;
  183|  13.6k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|   141k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|   141k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 52.6k, False: 88.4k]
  ------------------
  797|  52.6k|      return str1.size() > str2.size();
  798|       |
  799|  88.4k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  88.4k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|   141k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   347k|inline TypeId getType<uint16_t>() {
 1084|   347k|  return unsignedShort;
 1085|   347k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  2.97k|inline TypeId getType<uint32_t>() {
 1089|  2.97k|  return unsignedLong;
 1090|  2.97k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  7.59k|inline TypeId getType<URational>() {
 1094|  7.59k|  return unsignedRational;
 1095|  7.59k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  78.2k|inline TypeId getType<int16_t>() {
 1099|  78.2k|  return signedShort;
 1100|  78.2k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  9.36k|inline TypeId getType<int32_t>() {
 1104|  9.36k|  return signedLong;
 1105|  9.36k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  2.48k|inline TypeId getType<Rational>() {
 1109|  2.48k|  return signedRational;
 1110|  2.48k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  2.15k|inline TypeId getType<float>() {
 1114|  2.15k|  return tiffFloat;
 1115|  2.15k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  5.32k|inline TypeId getType<double>() {
 1119|  5.32k|  return tiffDouble;
 1120|  5.32k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  2.15M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  2.15M|  return getUShort(buf, byteOrder);
 1316|  2.15M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|   580k|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|   580k|  return getULong(buf, byteOrder);
 1321|   580k|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|  1.18M|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|  1.18M|  return getURational(buf, byteOrder);
 1326|  1.18M|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   209k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   209k|  return getShort(buf, byteOrder);
 1331|   209k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   665k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   665k|  return getLong(buf, byteOrder);
 1336|   665k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   185k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   185k|  return getRational(buf, byteOrder);
 1341|   185k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  24.5k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  24.5k|  return getFloat(buf, byteOrder);
 1346|  24.5k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|  92.6k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|  92.6k|  return getDouble(buf, byteOrder);
 1351|  92.6k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   300k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   300k|  return us2Data(buf, t, byteOrder);
 1374|   300k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  67.9k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  67.9k|  return ul2Data(buf, t, byteOrder);
 1382|  67.9k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|  1.18M|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|  1.18M|  return ur2Data(buf, t, byteOrder);
 1390|  1.18M|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  3.93k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  3.93k|  return s2Data(buf, t, byteOrder);
 1398|  3.93k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   243k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   243k|  return l2Data(buf, t, byteOrder);
 1406|   243k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  29.5k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  29.5k|  return r2Data(buf, t, byteOrder);
 1414|  29.5k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  15.6k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  15.6k|  return f2Data(buf, t, byteOrder);
 1422|  15.6k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|  3.85k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|  3.85k|  return d2Data(buf, t, byteOrder);
 1430|  3.85k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.25k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.25k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.25k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  7.59k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  7.59k|  return float_to_integer_helper<uint32_t>(n);
 1555|  7.59k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  2.11k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  2.11k|  return float_to_integer_helper<int64_t>(n);
 1560|  2.11k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  6.72k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  6.72k|  return float_to_integer_helper<uint32_t>(n);
 1564|  6.72k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  1.64k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  1.64k|  return rational_to_integer_helper<int64_t>(n);
 1569|  1.64k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  8.50k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  8.50k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  8.50k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  2.33k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  2.33k|  return rational_to_integer_helper<int64_t>(n);
 1578|  2.33k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  87.6k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  87.6k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  87.6k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.25k|  I float_to_integer_helper(size_t n) const {
 1213|  1.25k|    const auto v = value_.at(n);
 1214|  1.25k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 973, False: 278]
  ------------------
 1215|    973|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 655, False: 318]
  ------------------
 1216|    655|      return static_cast<I>(std::lround(v));
 1217|    655|    }
 1218|    596|    return 0;
 1219|  1.25k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  7.59k|  I float_to_integer_helper(size_t n) const {
 1213|  7.59k|    const auto v = value_.at(n);
 1214|  7.59k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.51k, False: 1.07k]
  ------------------
 1215|  6.51k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 4.63k, False: 1.88k]
  ------------------
 1216|  4.63k|      return static_cast<I>(std::lround(v));
 1217|  4.63k|    }
 1218|  2.95k|    return 0;
 1219|  7.59k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  2.11k|  I float_to_integer_helper(size_t n) const {
 1213|  2.11k|    const auto v = value_.at(n);
 1214|  2.11k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.81k, False: 303]
  ------------------
 1215|  1.81k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 1.39k, False: 424]
  ------------------
 1216|  1.39k|      return static_cast<I>(std::lround(v));
 1217|  1.39k|    }
 1218|    727|    return 0;
 1219|  2.11k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  6.72k|  I float_to_integer_helper(size_t n) const {
 1213|  6.72k|    const auto v = value_.at(n);
 1214|  6.72k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.82k, False: 902]
  ------------------
 1215|  5.82k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 4.83k, False: 995]
  ------------------
 1216|  4.83k|      return static_cast<I>(std::lround(v));
 1217|  4.83k|    }
 1218|  1.89k|    return 0;
 1219|  6.72k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  1.64k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.64k|    auto a = value_.at(n).first;
 1225|  1.64k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.64k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 571, False: 1.07k]
  ------------------
 1229|    571|      return 0;
 1230|    571|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.07k|#ifdef __cpp_if_constexpr
 1234|  1.07k|    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.07k|      const auto imin = std::numeric_limits<I>::min();
 1240|  1.07k|      const auto imax = std::numeric_limits<I>::max();
 1241|  1.07k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 1.07k]
  |  Branch (1241:23): [True: 0, False: 1.07k]
  |  Branch (1241:35): [True: 0, False: 1.07k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  1.07k|#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.07k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.64k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  8.50k|  I rational_to_integer_helper(size_t n) const {
 1224|  8.50k|    auto a = value_.at(n).first;
 1225|  8.50k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  8.50k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.53k, False: 5.97k]
  ------------------
 1229|  2.53k|      return 0;
 1230|  2.53k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.97k|#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.97k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  5.97k|      const auto imax = std::numeric_limits<I>::max();
 1257|  5.97k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 654, False: 5.32k]
  ------------------
 1258|    654|        return 0;
 1259|    654|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  5.32k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  5.32k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  5.32k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 5.32k]
  |  Branch (1263:25): [True: 0, False: 5.32k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  5.32k|    }
 1267|       |
 1268|  5.32k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  8.50k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  2.33k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.33k|    auto a = value_.at(n).first;
 1225|  2.33k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.33k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 547, False: 1.78k]
  ------------------
 1229|    547|      return 0;
 1230|    547|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.78k|#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.78k|    } 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.78k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  1.78k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 1.78k]
  |  Branch (1251:23): [True: 0, False: 1.78k]
  ------------------
 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.78k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.33k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  87.6k|  I rational_to_integer_helper(size_t n) const {
 1224|  87.6k|    auto a = value_.at(n).first;
 1225|  87.6k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  87.6k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 5.00k, False: 82.6k]
  ------------------
 1229|  5.00k|      return 0;
 1230|  5.00k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  82.6k|#ifdef __cpp_if_constexpr
 1234|  82.6k|    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|  82.6k|      const auto imin = std::numeric_limits<I>::min();
 1240|  82.6k|      const auto imax = std::numeric_limits<I>::max();
 1241|  82.6k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 82.6k]
  |  Branch (1241:23): [True: 0, False: 82.6k]
  |  Branch (1241:35): [True: 0, False: 82.6k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  82.6k|#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|  82.6k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  87.6k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   347k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   347k|}
_ZN5Exiv25ValueD2Ev:
   43|  5.81M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   345k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   345k|  value_.clear();
 1469|   345k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   345k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 345k, False: 0]
  |  Branch (1470:17): [True: 525, False: 344k]
  ------------------
 1471|    525|    len = (len / ts) * ts;
 1472|  2.50M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 2.15M, False: 345k]
  ------------------
 1473|  2.15M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  2.15M|  }
 1475|   345k|  return 0;
 1476|   345k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  2.11k|int ValueType<T>::read(const std::string& buf) {
 1480|  2.11k|  std::istringstream is(buf);
 1481|  2.11k|  T tmp;
 1482|  2.11k|  ValueList val;
 1483|  3.77k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 1.65k, False: 2.11k]
  ------------------
 1484|  1.65k|    val.push_back(tmp);
 1485|  2.11k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 2.11k]
  ------------------
 1486|      0|    return 1;
 1487|  2.11k|  value_ = std::move(val);
 1488|  2.11k|  return 0;
 1489|  2.11k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.75k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.75k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.26k, False: 498]
  ------------------
 1651|  1.26k|    pDataArea_ = Blob(buf, buf + len);
 1652|    498|  else
 1653|    498|    pDataArea_.clear();
 1654|  1.75k|  return 0;
 1655|  1.75k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  5.53k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.53k|  size_t offset = 0;
 1494|   300k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 300k, False: 5.53k]
  ------------------
 1495|   300k|    offset += toData(buf + offset, val, byteOrder);
 1496|   300k|  }
 1497|  5.53k|  return offset;
 1498|  5.53k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   737k|size_t ValueType<T>::count() const {
 1502|   737k|  return value_.size();
 1503|   737k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  11.7k|size_t ValueType<T>::size() const {
 1507|  11.7k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  11.7k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    499|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    499|  auto end = value_.end();
 1518|    499|  auto i = value_.begin();
 1519|  5.55k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.05k, False: 499]
  ------------------
 1520|  5.05k|    os << std::setprecision(15) << *i;
 1521|  5.05k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.76k, False: 297]
  ------------------
 1522|  4.76k|      os << " ";
 1523|  5.05k|  }
 1524|    499|  return os;
 1525|    499|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   359k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   359k|  ok_ = true;
 1537|   359k|  return static_cast<int64_t>(value_.at(n));
 1538|   359k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   369k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   369k|  ok_ = true;
 1542|   369k|  return static_cast<uint32_t>(value_.at(n));
 1543|   369k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  5.79k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.79k|  return pDataArea_.size();
 1641|  5.79k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    618|DataBuf ValueType<T>::dataArea() const {
 1645|    618|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    618|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   710k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   710k|  return new ValueType<T>(*this);
 1513|   710k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   710k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   710k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 4.49k, False: 706k]
  ------------------
 1449|  4.49k|    pDataArea_ = rhs.pDataArea_;
 1450|   710k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  2.95M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  60.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  60.3k|  value_.clear();
 1469|  60.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  60.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 60.3k, False: 0]
  |  Branch (1470:17): [True: 59, False: 60.2k]
  ------------------
 1471|     59|    len = (len / ts) * ts;
 1472|   640k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 580k, False: 60.3k]
  ------------------
 1473|   580k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   580k|  }
 1475|  60.3k|  return 0;
 1476|  60.3k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    580|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    580|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 399, False: 181]
  ------------------
 1651|    399|    pDataArea_ = Blob(buf, buf + len);
 1652|    181|  else
 1653|    181|    pDataArea_.clear();
 1654|    580|  return 0;
 1655|    580|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  17.7k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  17.7k|  size_t offset = 0;
 1494|  67.9k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 67.9k, False: 17.7k]
  ------------------
 1495|  67.9k|    offset += toData(buf + offset, val, byteOrder);
 1496|  67.9k|  }
 1497|  17.7k|  return offset;
 1498|  17.7k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   103k|size_t ValueType<T>::count() const {
 1502|   103k|  return value_.size();
 1503|   103k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  36.6k|size_t ValueType<T>::size() const {
 1507|  36.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  36.6k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  4.36k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  4.36k|  auto end = value_.end();
 1518|  4.36k|  auto i = value_.begin();
 1519|  83.9k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 79.5k, False: 4.36k]
  ------------------
 1520|  79.5k|    os << std::setprecision(15) << *i;
 1521|  79.5k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 75.4k, False: 4.10k]
  ------------------
 1522|  75.4k|      os << " ";
 1523|  79.5k|  }
 1524|  4.36k|  return os;
 1525|  4.36k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  8.81k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  8.81k|  ok_ = true;
 1537|  8.81k|  return static_cast<int64_t>(value_.at(n));
 1538|  8.81k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  23.1k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  23.1k|  ok_ = true;
 1542|  23.1k|  return static_cast<uint32_t>(value_.at(n));
 1543|  23.1k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  5.65k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.65k|  return pDataArea_.size();
 1641|  5.65k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    306|DataBuf ValueType<T>::dataArea() const {
 1645|    306|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    306|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   162k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   162k|  return new ValueType<T>(*this);
 1513|   162k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   162k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   162k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.01k, False: 161k]
  ------------------
 1449|  1.01k|    pDataArea_ = rhs.pDataArea_;
 1450|   162k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  7.59k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.59k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  7.52k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  7.52k|  value_.clear();
 1469|  7.52k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  7.52k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 7.52k, False: 0]
  |  Branch (1470:17): [True: 0, False: 7.52k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  1.19M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.18M, False: 7.52k]
  ------------------
 1473|  1.18M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.18M|  }
 1475|  7.52k|  return 0;
 1476|  7.52k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    588|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    588|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 277, False: 311]
  ------------------
 1651|    277|    pDataArea_ = Blob(buf, buf + len);
 1652|    311|  else
 1653|    311|    pDataArea_.clear();
 1654|    588|  return 0;
 1655|    588|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  2.35k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.35k|  size_t offset = 0;
 1494|  1.18M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.18M, False: 2.35k]
  ------------------
 1495|  1.18M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.18M|  }
 1497|  2.35k|  return offset;
 1498|  2.35k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  18.1k|size_t ValueType<T>::count() const {
 1502|  18.1k|  return value_.size();
 1503|  18.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  6.24k|size_t ValueType<T>::size() const {
 1507|  6.24k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  6.24k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    741|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    741|  auto end = value_.end();
 1518|    741|  auto i = value_.begin();
 1519|  10.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 9.84k, False: 741]
  ------------------
 1520|  9.84k|    os << std::setprecision(15) << *i;
 1521|  9.84k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 9.46k, False: 382]
  ------------------
 1522|  9.46k|      os << " ";
 1523|  9.84k|  }
 1524|    741|  return os;
 1525|    741|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  2.95k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.95k|  return pDataArea_.size();
 1641|  2.95k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|      6|DataBuf ValueType<T>::dataArea() const {
 1645|      6|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      6|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  26.0k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  26.0k|  return new ValueType<T>(*this);
 1513|  26.0k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  26.0k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  26.0k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.18k, False: 24.9k]
  ------------------
 1449|  1.18k|    pDataArea_ = rhs.pDataArea_;
 1450|  26.0k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  78.2k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  78.2k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  69.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  69.7k|  value_.clear();
 1469|  69.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  69.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 69.7k, False: 0]
  |  Branch (1470:17): [True: 74, False: 69.7k]
  ------------------
 1471|     74|    len = (len / ts) * ts;
 1472|   279k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 209k, False: 69.7k]
  ------------------
 1473|   209k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   209k|  }
 1475|  69.7k|  return 0;
 1476|  69.7k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  8.47k|int ValueType<T>::read(const std::string& buf) {
 1480|  8.47k|  std::istringstream is(buf);
 1481|  8.47k|  T tmp;
 1482|  8.47k|  ValueList val;
 1483|   173k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 164k, False: 8.47k]
  ------------------
 1484|   164k|    val.push_back(tmp);
 1485|  8.47k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 8.47k]
  ------------------
 1486|      0|    return 1;
 1487|  8.47k|  value_ = std::move(val);
 1488|  8.47k|  return 0;
 1489|  8.47k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    722|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    722|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 430, False: 292]
  ------------------
 1651|    430|    pDataArea_ = Blob(buf, buf + len);
 1652|    292|  else
 1653|    292|    pDataArea_.clear();
 1654|    722|  return 0;
 1655|    722|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  1.55k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.55k|  size_t offset = 0;
 1494|  3.93k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 3.93k, False: 1.55k]
  ------------------
 1495|  3.93k|    offset += toData(buf + offset, val, byteOrder);
 1496|  3.93k|  }
 1497|  1.55k|  return offset;
 1498|  1.55k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  77.7k|size_t ValueType<T>::count() const {
 1502|  77.7k|  return value_.size();
 1503|  77.7k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  3.37k|size_t ValueType<T>::size() const {
 1507|  3.37k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  3.37k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    661|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    661|  auto end = value_.end();
 1518|    661|  auto i = value_.begin();
 1519|  67.2k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 66.6k, False: 661]
  ------------------
 1520|  66.6k|    os << std::setprecision(15) << *i;
 1521|  66.6k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 66.2k, False: 413]
  ------------------
 1522|  66.2k|      os << " ";
 1523|  66.6k|  }
 1524|    661|  return os;
 1525|    661|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|    981|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|    981|  ok_ = true;
 1537|    981|  return static_cast<int64_t>(value_.at(n));
 1538|    981|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  3.58k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  3.58k|  ok_ = true;
 1542|  3.58k|  return static_cast<uint32_t>(value_.at(n));
 1543|  3.58k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.47k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.47k|  return pDataArea_.size();
 1641|  1.47k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    340|DataBuf ValueType<T>::dataArea() const {
 1645|    340|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    340|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|   152k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   152k|  return new ValueType<T>(*this);
 1513|   152k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|   152k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   152k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.33k, False: 151k]
  ------------------
 1449|  1.33k|    pDataArea_ = rhs.pDataArea_;
 1450|   152k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  9.36k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  9.36k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  9.36k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  9.36k|  value_.clear();
 1469|  9.36k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  9.36k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 9.36k, False: 0]
  |  Branch (1470:17): [True: 76, False: 9.28k]
  ------------------
 1471|     76|    len = (len / ts) * ts;
 1472|   674k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 665k, False: 9.36k]
  ------------------
 1473|   665k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   665k|  }
 1475|  9.36k|  return 0;
 1476|  9.36k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    724|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    724|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 350, False: 374]
  ------------------
 1651|    350|    pDataArea_ = Blob(buf, buf + len);
 1652|    374|  else
 1653|    374|    pDataArea_.clear();
 1654|    724|  return 0;
 1655|    724|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  5.89k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.89k|  size_t offset = 0;
 1494|   243k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 243k, False: 5.89k]
  ------------------
 1495|   243k|    offset += toData(buf + offset, val, byteOrder);
 1496|   243k|  }
 1497|  5.89k|  return offset;
 1498|  5.89k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  22.6k|size_t ValueType<T>::count() const {
 1502|  22.6k|  return value_.size();
 1503|  22.6k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|  12.8k|size_t ValueType<T>::size() const {
 1507|  12.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  12.8k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    771|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    771|  auto end = value_.end();
 1518|    771|  auto i = value_.begin();
 1519|  3.19M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 3.19M, False: 771]
  ------------------
 1520|  3.19M|    os << std::setprecision(15) << *i;
 1521|  3.19M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.19M, False: 570]
  ------------------
 1522|  3.19M|      os << " ";
 1523|  3.19M|  }
 1524|    771|  return os;
 1525|    771|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  2.33k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  2.33k|  ok_ = true;
 1537|  2.33k|  return static_cast<int64_t>(value_.at(n));
 1538|  2.33k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  6.05k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  6.05k|  ok_ = true;
 1542|  6.05k|  return static_cast<uint32_t>(value_.at(n));
 1543|  6.05k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  1.64k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.64k|  return pDataArea_.size();
 1641|  1.64k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    226|DataBuf ValueType<T>::dataArea() const {
 1645|    226|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    226|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  34.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  34.1k|  return new ValueType<T>(*this);
 1513|  34.1k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  34.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  34.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 967, False: 33.1k]
  ------------------
 1449|    967|    pDataArea_ = rhs.pDataArea_;
 1450|  34.1k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  2.48k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.48k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  2.48k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  2.48k|  value_.clear();
 1469|  2.48k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  2.48k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 2.48k, False: 0]
  |  Branch (1470:17): [True: 0, False: 2.48k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   188k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 185k, False: 2.48k]
  ------------------
 1473|   185k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   185k|  }
 1475|  2.48k|  return 0;
 1476|  2.48k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    483|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    483|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 215, False: 268]
  ------------------
 1651|    215|    pDataArea_ = Blob(buf, buf + len);
 1652|    268|  else
 1653|    268|    pDataArea_.clear();
 1654|    483|  return 0;
 1655|    483|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|    849|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    849|  size_t offset = 0;
 1494|  29.5k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 29.5k, False: 849]
  ------------------
 1495|  29.5k|    offset += toData(buf + offset, val, byteOrder);
 1496|  29.5k|  }
 1497|    849|  return offset;
 1498|    849|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  10.0k|size_t ValueType<T>::count() const {
 1502|  10.0k|  return value_.size();
 1503|  10.0k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  1.88k|size_t ValueType<T>::size() const {
 1507|  1.88k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.88k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    552|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    552|  auto end = value_.end();
 1518|    552|  auto i = value_.begin();
 1519|  5.92k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.37k, False: 552]
  ------------------
 1520|  5.37k|    os << std::setprecision(15) << *i;
 1521|  5.37k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.02k, False: 349]
  ------------------
 1522|  5.02k|      os << " ";
 1523|  5.37k|  }
 1524|    552|  return os;
 1525|    552|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|    403|size_t ValueType<T>::sizeDataArea() const {
 1640|    403|  return pDataArea_.size();
 1641|    403|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     10|DataBuf ValueType<T>::dataArea() const {
 1645|     10|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     10|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  7.47k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  7.47k|  return new ValueType<T>(*this);
 1513|  7.47k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  7.47k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  7.47k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 284, False: 7.19k]
  ------------------
 1449|    284|    pDataArea_ = rhs.pDataArea_;
 1450|  7.47k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  2.15k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.15k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  2.15k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  2.15k|  value_.clear();
 1469|  2.15k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  2.15k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 2.15k, False: 0]
  |  Branch (1470:17): [True: 0, False: 2.15k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  26.6k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 24.5k, False: 2.15k]
  ------------------
 1473|  24.5k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  24.5k|  }
 1475|  2.15k|  return 0;
 1476|  2.15k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    616|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    616|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 183, False: 433]
  ------------------
 1651|    183|    pDataArea_ = Blob(buf, buf + len);
 1652|    433|  else
 1653|    433|    pDataArea_.clear();
 1654|    616|  return 0;
 1655|    616|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|    854|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    854|  size_t offset = 0;
 1494|  15.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 15.6k, False: 854]
  ------------------
 1495|  15.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  15.6k|  }
 1497|    854|  return offset;
 1498|    854|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  10.1k|size_t ValueType<T>::count() const {
 1502|  10.1k|  return value_.size();
 1503|  10.1k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  1.99k|size_t ValueType<T>::size() const {
 1507|  1.99k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.99k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    549|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    549|  auto end = value_.end();
 1518|    549|  auto i = value_.begin();
 1519|  5.91k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.36k, False: 549]
  ------------------
 1520|  5.36k|    os << std::setprecision(15) << *i;
 1521|  5.36k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.01k, False: 349]
  ------------------
 1522|  5.01k|      os << " ";
 1523|  5.36k|  }
 1524|    549|  return os;
 1525|    549|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|    160|size_t ValueType<T>::sizeDataArea() const {
 1640|    160|  return pDataArea_.size();
 1641|    160|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|     15|DataBuf ValueType<T>::dataArea() const {
 1645|     15|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     15|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  6.73k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  6.73k|  return new ValueType<T>(*this);
 1513|  6.73k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  6.73k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  6.73k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 143, False: 6.59k]
  ------------------
 1449|    143|    pDataArea_ = rhs.pDataArea_;
 1450|  6.73k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  5.32k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.32k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  5.32k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.32k|  value_.clear();
 1469|  5.32k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.32k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.32k, False: 0]
  |  Branch (1470:17): [True: 0, False: 5.32k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  97.9k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 92.6k, False: 5.32k]
  ------------------
 1473|  92.6k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  92.6k|  }
 1475|  5.32k|  return 0;
 1476|  5.32k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    701|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    701|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 240, False: 461]
  ------------------
 1651|    240|    pDataArea_ = Blob(buf, buf + len);
 1652|    461|  else
 1653|    461|    pDataArea_.clear();
 1654|    701|  return 0;
 1655|    701|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|    447|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    447|  size_t offset = 0;
 1494|  3.85k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 3.85k, False: 447]
  ------------------
 1495|  3.85k|    offset += toData(buf + offset, val, byteOrder);
 1496|  3.85k|  }
 1497|    447|  return offset;
 1498|    447|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  13.1k|size_t ValueType<T>::count() const {
 1502|  13.1k|  return value_.size();
 1503|  13.1k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  1.13k|size_t ValueType<T>::size() const {
 1507|  1.13k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.13k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    698|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    698|  auto end = value_.end();
 1518|    698|  auto i = value_.begin();
 1519|  2.05k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.35k, False: 698]
  ------------------
 1520|  1.35k|    os << std::setprecision(15) << *i;
 1521|  1.35k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 858, False: 501]
  ------------------
 1522|    858|      os << " ";
 1523|  1.35k|  }
 1524|    698|  return os;
 1525|    698|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|    700|size_t ValueType<T>::sizeDataArea() const {
 1640|    700|  return pDataArea_.size();
 1641|    700|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|     16|DataBuf ValueType<T>::dataArea() const {
 1645|     16|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     16|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  12.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  12.7k|  return new ValueType<T>(*this);
 1513|  12.7k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  12.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  12.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 257, False: 12.4k]
  ------------------
 1449|    257|    pDataArea_ = rhs.pDataArea_;
 1450|  12.7k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|  6.19M|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  2.97k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.97k|}

_ZNK5Exiv27XmpData9usePacketEv:
  216|  4.73k|  [[nodiscard]] bool usePacket() const {
  217|  4.73k|    return usePacket_;
  218|  4.73k|  }
_ZN5Exiv27XmpData9usePacketEb:
  221|  45.5k|  bool usePacket(bool b) {
  222|  45.5k|    bool r = usePacket_;
  223|  45.5k|    usePacket_ = b;
  224|  45.5k|    return r;
  225|  45.5k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  227|  45.5k|  void setPacket(std::string xmpPacket) {
  228|  45.5k|    xmpPacket_ = std::move(xmpPacket);
  229|  45.5k|    usePacket(false);
  230|  45.5k|  }
_ZN5Exiv27XmpDataC2Ev:
  140|  41.7k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  395|  34.2k|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|  34.2k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  34.2k|  return *this;
  405|  34.2k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  395|  50.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|  50.7k|    setValue(Exiv2::toString(value));
  404|  50.7k|  return *this;
  405|  50.7k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  395|  11.9k|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.9k|    setValue(Exiv2::toString(value));
  404|  11.9k|  return *this;
  405|  11.9k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  395|  25.4k|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|  25.4k|    setValue(Exiv2::toString(value));
  404|  25.4k|  return *this;
  405|  25.4k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  395|  2.48k|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|  2.48k|    setValue(Exiv2::toString(value));
  404|  2.48k|  return *this;
  405|  2.48k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  395|  3.55k|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|  3.55k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  3.55k|  return *this;
  405|  3.55k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  395|  1.55k|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.55k|    setValue(Exiv2::toString(value));
  404|  1.55k|  return *this;
  405|  1.55k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  395|  1.92k|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.92k|    setValue(Exiv2::toString(value));
  404|  1.92k|  return *this;
  405|  1.92k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  395|    984|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|    984|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    984|  return *this;
  405|    984|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  395|  31.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|  31.0k|    setValue(Exiv2::toString(value));
  404|  31.0k|  return *this;
  405|  31.0k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  395|  5.09k|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|  5.09k|    setValue(Exiv2::toString(value));
  404|  5.09k|  return *this;
  405|  5.09k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  395|  88.2k|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|  88.2k|    setValue(Exiv2::toString(value));
  404|  88.2k|  return *this;
  405|  88.2k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  395|  84.5k|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|  84.5k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  84.5k|  return *this;
  405|  84.5k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  395|   123k|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|   123k|    setValue(Exiv2::toString(value));
  404|   123k|  return *this;
  405|   123k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  395|    272|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|    272|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    272|  return *this;
  405|    272|}

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

_ZN5Exiv27BasicIoD2Ev:
   54|  46.8k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   56|  6.37M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   57|  6.37M|  const size_t nread = read(buf, rcount);
   58|  6.37M|  Internal::enforce(nread == rcount, err);
   59|  6.37M|  Internal::enforce(!error(), err);
   60|  6.37M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   62|  13.8k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   63|  13.8k|  const int r = seek(offset, pos);
   64|  13.8k|  Internal::enforce(r == 0, err);
   65|  13.8k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  618|  37.3k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  619|  37.3k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  672|   356k|void MemIo::Impl::reserve(size_t wcount) {
  673|   356k|  const size_t need = wcount + idx_;
  674|   356k|  size_t blockSize = 32 * 1024;  // 32768
  675|   356k|  const size_t maxBlockSize = 4 * 1024 * 1024;
  676|       |
  677|   356k|  if (!isMalloced_) {
  ------------------
  |  Branch (677:7): [True: 4.73k, False: 351k]
  ------------------
  678|       |    // Minimum size for 1st block
  679|  4.73k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  680|  4.73k|    auto data = static_cast<byte*>(std::malloc(size));
  681|  4.73k|    if (!data) {
  ------------------
  |  Branch (681:9): [True: 0, False: 4.73k]
  ------------------
  682|      0|      throw Error(ErrorCode::kerMallocFailed);
  683|      0|    }
  684|  4.73k|    if (data_) {
  ------------------
  |  Branch (684:9): [True: 0, False: 4.73k]
  ------------------
  685|      0|      std::memcpy(data, data_, size_);
  686|      0|    }
  687|  4.73k|    data_ = data;
  688|  4.73k|    sizeAlloced_ = size;
  689|  4.73k|    isMalloced_ = true;
  690|  4.73k|  }
  691|       |
  692|   356k|  if (need > size_) {
  ------------------
  |  Branch (692:7): [True: 338k, False: 17.2k]
  ------------------
  693|   338k|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (693:9): [True: 194, False: 338k]
  ------------------
  694|    194|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  695|       |      // Allocate in blocks
  696|    194|      size_t want = blockSize * (1 + need / blockSize);
  697|    194|      data_ = static_cast<byte*>(std::realloc(data_, want));
  698|    194|      if (!data_) {
  ------------------
  |  Branch (698:11): [True: 0, False: 194]
  ------------------
  699|      0|        throw Error(ErrorCode::kerMallocFailed);
  700|      0|      }
  701|    194|      sizeAlloced_ = want;
  702|    194|    }
  703|   338k|    size_ = need;
  704|   338k|  }
  705|   356k|}
_ZN5Exiv25MemIoC2Ev:
  707|  9.47k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  708|  9.47k|}
_ZN5Exiv25MemIoC2EPKhm:
  710|  37.3k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  711|  37.3k|}
_ZN5Exiv25MemIoD2Ev:
  713|  46.8k|MemIo::~MemIo() {
  714|  46.8k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (714:7): [True: 4.73k, False: 42.1k]
  ------------------
  715|  4.73k|    std::free(p_->data_);
  716|  4.73k|  }
  717|  46.8k|}
_ZN5Exiv25MemIo5writeEPKhm:
  719|   351k|size_t MemIo::write(const byte* data, size_t wcount) {
  720|   351k|  p_->reserve(wcount);
  721|   351k|  if (data) {
  ------------------
  |  Branch (721:7): [True: 334k, False: 17.2k]
  ------------------
  722|   334k|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  723|   334k|  }
  724|   351k|  p_->idx_ += wcount;
  725|   351k|  return wcount;
  726|   351k|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  728|  4.61k|void MemIo::transfer(BasicIo& src) {
  729|  4.61k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (729:12): [True: 4.61k, False: 0]
  ------------------
  730|       |    // Optimization if src is another instance of MemIo
  731|  4.61k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (731:9): [True: 0, False: 4.61k]
  ------------------
  732|      0|      std::free(p_->data_);
  733|      0|    }
  734|  4.61k|    p_->idx_ = 0;
  735|  4.61k|    p_->data_ = memIo->p_->data_;
  736|  4.61k|    p_->size_ = memIo->p_->size_;
  737|  4.61k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  738|  4.61k|    memIo->p_->idx_ = 0;
  739|  4.61k|    memIo->p_->data_ = nullptr;
  740|  4.61k|    memIo->p_->size_ = 0;
  741|  4.61k|    memIo->p_->isMalloced_ = false;
  742|  4.61k|  } else {
  743|       |    // Generic reopen to reset position to start
  744|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (744:9): [True: 0, False: 0]
  ------------------
  745|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  746|      0|    }
  747|      0|    p_->idx_ = 0;
  748|      0|    write(src);
  749|      0|    src.close();
  750|      0|  }
  751|  4.61k|  if (error() || src.error())
  ------------------
  |  Branch (751:7): [True: 0, False: 4.61k]
  |  Branch (751:18): [True: 0, False: 4.61k]
  ------------------
  752|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  753|  4.61k|}
_ZN5Exiv25MemIo4putbEh:
  773|  4.79k|int MemIo::putb(byte data) {
  774|  4.79k|  p_->reserve(1);
  775|  4.79k|  p_->data_[p_->idx_++] = data;
  776|  4.79k|  return data;
  777|  4.79k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  779|  1.53M|int MemIo::seek(int64_t offset, Position pos) {
  780|  1.53M|  int64_t newIdx = 0;
  781|       |
  782|  1.53M|  switch (pos) {
  ------------------
  |  Branch (782:11): [True: 1.53M, False: 0]
  ------------------
  783|   696k|    case BasicIo::cur:
  ------------------
  |  Branch (783:5): [True: 696k, False: 843k]
  ------------------
  784|   696k|      newIdx = p_->idx_ + offset;
  785|   696k|      break;
  786|   843k|    case BasicIo::beg:
  ------------------
  |  Branch (786:5): [True: 843k, False: 696k]
  ------------------
  787|   843k|      newIdx = offset;
  788|   843k|      break;
  789|    150|    case BasicIo::end:
  ------------------
  |  Branch (789:5): [True: 150, False: 1.53M]
  ------------------
  790|    150|      newIdx = p_->size_ + offset;
  791|    150|      break;
  792|  1.53M|  }
  793|       |
  794|  1.53M|  if (newIdx < 0)
  ------------------
  |  Branch (794:7): [True: 0, False: 1.53M]
  ------------------
  795|      0|    return 1;
  796|       |
  797|  1.53M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (797:7): [True: 15.0k, False: 1.52M]
  ------------------
  798|  15.0k|    p_->eof_ = true;
  799|  15.0k|    return 1;
  800|  15.0k|  }
  801|       |
  802|  1.52M|  p_->idx_ = static_cast<size_t>(newIdx);
  803|  1.52M|  p_->eof_ = false;
  804|  1.52M|  return 0;
  805|  1.53M|}
_ZN5Exiv25MemIo4mmapEb:
  807|  37.5k|byte* MemIo::mmap(bool /*isWriteable*/) {
  808|  37.5k|  return p_->data_;
  809|  37.5k|}
_ZNK5Exiv25MemIo4tellEv:
  815|  1.68M|size_t MemIo::tell() const {
  816|  1.68M|  return p_->idx_;
  817|  1.68M|}
_ZNK5Exiv25MemIo4sizeEv:
  819|   830k|size_t MemIo::size() const {
  820|   830k|  return p_->size_;
  821|   830k|}
_ZN5Exiv25MemIo4openEv:
  823|   128k|int MemIo::open() {
  824|   128k|  p_->idx_ = 0;
  825|   128k|  p_->eof_ = false;
  826|   128k|  return 0;
  827|   128k|}
_ZNK5Exiv25MemIo6isopenEv:
  829|  91.1k|bool MemIo::isopen() const {
  830|  91.1k|  return true;
  831|  91.1k|}
_ZN5Exiv25MemIo5closeEv:
  833|  91.1k|int MemIo::close() {
  834|  91.1k|  return 0;
  835|  91.1k|}
_ZN5Exiv25MemIo4readEm:
  837|  62.6k|DataBuf MemIo::read(size_t rcount) {
  838|  62.6k|  DataBuf buf(rcount);
  839|  62.6k|  size_t readCount = read(buf.data(), buf.size());
  840|  62.6k|  buf.resize(readCount);
  841|  62.6k|  return buf;
  842|  62.6k|}
_ZN5Exiv25MemIo4readEPhm:
  844|  8.04M|size_t MemIo::read(byte* buf, size_t rcount) {
  845|  8.04M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  846|  8.04M|  const auto allow = std::min<size_t>(rcount, avail);
  847|  8.04M|  if (allow > 0) {
  ------------------
  |  Branch (847:7): [True: 7.88M, False: 155k]
  ------------------
  848|  7.88M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  849|  7.88M|  }
  850|  8.04M|  p_->idx_ += allow;
  851|  8.04M|  if (rcount > avail) {
  ------------------
  |  Branch (851:7): [True: 13.2k, False: 8.03M]
  ------------------
  852|  13.2k|    p_->eof_ = true;
  853|  13.2k|  }
  854|  8.04M|  return allow;
  855|  8.04M|}
_ZN5Exiv25MemIo4getbEv:
  857|  2.23M|int MemIo::getb() {
  858|  2.23M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (858:7): [True: 779, False: 2.23M]
  ------------------
  859|    779|    p_->eof_ = true;
  860|    779|    return EOF;
  861|    779|  }
  862|  2.23M|  return p_->data_[p_->idx_++];
  863|  2.23M|}
_ZNK5Exiv25MemIo5errorEv:
  865|  7.21M|int MemIo::error() const {
  866|  7.21M|  return 0;
  867|  7.21M|}
_ZNK5Exiv25MemIo3eofEv:
  869|  1.57M|bool MemIo::eof() const {
  870|  1.57M|  return p_->eof_;
  871|  1.57M|}
_ZNK5Exiv25MemIo4pathEv:
  873|  16.3k|const std::string& MemIo::path() const noexcept {
  874|  16.3k|  static std::string _path{"MemIo"};
  875|  16.3k|  return _path;
  876|  16.3k|}
_ZN5Exiv25MemIo4ImplC2Ev:
  598|  9.47k|  Impl() = default;                     //!< Default constructor

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

_ZN5Exiv28BmpImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   26|    640|BmpImage::BmpImage(BasicIo::UniquePtr io) : Image(ImageType::bmp, mdNone, std::move(io)) {
   27|    640|}
_ZNK5Exiv28BmpImage8mimeTypeEv:
   29|      3|std::string BmpImage::mimeType() const {
   30|       |  // "image/bmp" is a Generic Bitmap
   31|      3|  return "image/x-ms-bmp";  // Microsoft Bitmap
   32|      3|}
_ZN5Exiv28BmpImage12readMetadataEv:
   46|    630|void BmpImage::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Exiv2::BmpImage::readMetadata: Reading Windows bitmap file " << io_->path() << "\n";
   49|       |#endif
   50|    630|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 630]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|    630|  IoCloser closer(*io_);
   54|       |
   55|       |  // Ensure that this is the correct image type
   56|    630|  if (!isBmpType(*io_, false)) {
  ------------------
  |  Branch (56:7): [True: 0, False: 630]
  ------------------
   57|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (57:9): [True: 0, False: 0]
  |  Branch (57:25): [True: 0, False: 0]
  ------------------
   58|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   59|      0|    throw Error(ErrorCode::kerNotAnImage, "BMP");
   60|      0|  }
   61|    630|  clearMetadata();
   62|       |
   63|       |  /*
   64|       |    The Windows bitmap header goes as follows -- all numbers are in little-endian byte order:
   65|       |
   66|       |    offset  length   name                   description
   67|       |    ======  =======  =====================  =======
   68|       |     0      2 bytes  signature              always 'BM'
   69|       |     2      4 bytes  bitmap size
   70|       |     6      4 bytes  reserved
   71|       |    10      4 bytes  bitmap offset
   72|       |    14      4 bytes  header size
   73|       |    18      4 bytes  bitmap width
   74|       |    22      4 bytes  bitmap height
   75|       |    26      2 bytes  plane count
   76|       |    28      2 bytes  depth
   77|       |    30      4 bytes  compression            0 = none; 1 = RLE, 8 bits/pixel; 2 = RLE, 4 bits/pixel; 3 = bitfield;
   78|       |    4 = JPEG; 5 = PNG 34      4 bytes  image size             size of the raw bitmap data, in bytes 38      4
   79|       |    bytes  horizontal resolution  (in pixels per meter) 42      4 bytes  vertical resolution    (in pixels per
   80|       |    meter) 46      4 bytes  color count 50      4 bytes  important colors       number of "important" colors
   81|       |  */
   82|    630|  byte buf[26];
   83|    630|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (83:7): [True: 630, False: 0]
  ------------------
   84|    630|    pixelWidth_ = getULong(buf + 18, littleEndian);
   85|    630|    pixelHeight_ = getULong(buf + 22, littleEndian);
   86|    630|  }
   87|    630|}
_ZN5Exiv214newBmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
   96|    640|Image::UniquePtr newBmpInstance(BasicIo::UniquePtr io, bool /*create*/) {
   97|    640|  auto image = std::make_unique<BmpImage>(std::move(io));
   98|    640|  if (!image->good()) {
  ------------------
  |  Branch (98:7): [True: 10, False: 630]
  ------------------
   99|     10|    return nullptr;
  100|     10|  }
  101|    630|  return image;
  102|    640|}
_ZN5Exiv29isBmpTypeERNS_7BasicIoEb:
  104|  17.5k|bool isBmpType(BasicIo& iIo, bool advance) {
  105|  17.5k|  const int32_t len = 2;
  106|  17.5k|  const std::array<byte, len> BmpImageId{'B', 'M'};
  107|  17.5k|  std::array<byte, len> buf;
  108|  17.5k|  iIo.read(buf.data(), len);
  109|  17.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (109:7): [True: 0, False: 17.5k]
  |  Branch (109:22): [True: 353, False: 17.2k]
  ------------------
  110|    353|    return false;
  111|    353|  }
  112|  17.2k|  bool matched = buf == BmpImageId;
  113|  17.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (113:7): [True: 17.2k, False: 0]
  |  Branch (113:19): [True: 0, False: 0]
  ------------------
  114|  17.2k|    iIo.seek(-len, BasicIo::cur);
  115|  17.2k|  }
  116|  17.2k|  return matched;
  117|  17.5k|}

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|  43.2k|  static constexpr auto tagList() {
   39|  43.2k|    return tagInfo_;
   40|  43.2k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|   314k|  static constexpr auto tagListCs() {
   43|   314k|    return tagInfoCs_;
   44|   314k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  12.9k|  static constexpr auto tagListSi() {
   47|  12.9k|    return tagInfoSi_;
   48|  12.9k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  1.70k|  static constexpr auto tagListCf() {
   55|  1.70k|    return tagInfoCf_;
   56|  1.70k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.72k|  static constexpr auto tagListPi() {
   59|  1.72k|    return tagInfoPi_;
   60|  1.72k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    233|  static constexpr auto tagListTi() {
   63|    233|    return tagInfoTi_;
   64|    233|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|  66.5k|  static constexpr auto tagListFi() {
   67|  66.5k|    return tagInfoFi_;
   68|  66.5k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    847|  static constexpr auto tagListPa() {
   51|    847|    return tagInfoPa_;
   52|    847|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    838|  static constexpr auto tagListPr() {
   71|    838|    return tagInfoPr_;
   72|    838|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    233|  static constexpr auto tagListVigCor2() {
  135|    233|    return tagInfoVigCor2_;
  136|    233|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    317|  static constexpr auto tagListLiOp() {
  139|    317|    return tagInfoLiOp_;
  140|    317|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    247|  static constexpr auto tagListAfMiAdj() {
  127|    247|    return tagInfoAfMiAdj_;
  128|    247|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|   426k|  static constexpr auto tagListLe() {
  143|   426k|    return tagInfoLe_;
  144|   426k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    482|  static constexpr auto tagListAm() {
  147|    482|    return tagInfoAm_;
  148|    482|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    276|  static constexpr auto tagListFil() {
  155|    276|    return tagInfoFil_;
  156|    276|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    317|  static constexpr auto tagListMe() {
  151|    317|    return tagInfoMe_;
  152|    317|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    313|  static constexpr auto tagListHdr() {
  159|    313|    return tagInfoHdr_;
  160|    313|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    216|  static constexpr auto tagListAfC() {
  163|    216|    return tagInfoAfC_;
  164|    216|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    217|  static constexpr auto tagListRawB() {
  167|    217|    return tagInfoRawB_;
  168|    217|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  1.74k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  1.74k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  1.74k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  1.74k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.49k|void Converter::cnvFromXmp() {
  511|   439k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 439k, False: 3.49k]
  ------------------
  512|   439k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 362k, False: 76.7k]
  |  Branch (512:37): [True: 181k, False: 181k]
  |  Branch (512:52): [True: 76.7k, False: 181k]
  |  Branch (512:79): [True: 38.3k, False: 38.3k]
  ------------------
  513|   219k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   219k|    }
  515|   439k|  }
  516|  3.49k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  3.70k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  3.70k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  3.70k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 3.70k, False: 0]
  ------------------
  524|  3.70k|    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|    317|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    317|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    317|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 317, False: 0]
  ------------------
  534|    317|    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|   157k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   157k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   157k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 156k, False: 219]
  ------------------
  847|   156k|    return;
  848|    219|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 219]
  ------------------
  849|      0|    return;
  850|    219|  std::string value;
  851|    219|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 0, False: 219]
  ------------------
  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|    219|  ExifKey key(to);
  859|    219|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 219, False: 0]
  ------------------
  860|    219|    exifData_->add(ed);
  861|    219|  }
  862|    219|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 219]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    219|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.74k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.74k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.74k]
  ------------------
  868|      0|    return;
  869|  1.74k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.74k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.74k, False: 0]
  ------------------
  871|  1.74k|    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.74k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.74k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.74k]
  ------------------
  887|      0|    return;
  888|  1.74k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.74k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.74k, False: 0]
  ------------------
  890|  1.74k|    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|  6.98k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  6.98k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  6.98k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 6.98k, False: 0]
  ------------------
  912|  6.98k|    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.49k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.49k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.49k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.49k, False: 0]
  ------------------
  995|  3.49k|    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.74k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.74k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.74k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.74k, False: 0]
  ------------------
 1015|  1.74k|    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.74k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.74k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.74k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.74k, False: 0]
  ------------------
 1035|  1.74k|    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|  6.98k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  6.98k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  6.98k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 6.98k, False: 0]
  ------------------
 1105|  6.98k|    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.3k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  38.3k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  38.3k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 38.0k, False: 317]
  ------------------
 1196|  38.0k|    return;
 1197|    317|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 317]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    317|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 92, False: 225]
  |  Branch (1200:35): [True: 98, False: 127]
  ------------------
 1201|    190|    std::string value;
 1202|    190|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 49, False: 141]
  ------------------
 1203|     49|#ifndef SUPPRESS_WARNINGS
 1204|     49|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|     49|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 49]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     49|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|     49|#endif
 1206|     49|      return;
 1207|     49|    }
 1208|    141|    (*iptcData_)[to] = value;
 1209|    141|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    141|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 141]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    141|    return;
 1213|    190|  }
 1214|       |
 1215|    127|  size_t count = pos->count();
 1216|    127|  bool added = false;
 1217|  13.2k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 13.1k, False: 127]
  ------------------
 1218|  13.1k|    std::string value = pos->toString(i);
 1219|  13.1k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 13.1k]
  ------------------
 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|  13.1k|    IptcKey key(to);
 1226|  13.1k|    Iptcdatum id(key);
 1227|  13.1k|    id.setValue(value);
 1228|  13.1k|    iptcData_->add(id);
 1229|  13.1k|    added = true;
 1230|  13.1k|  }
 1231|    127|  if (added)
  ------------------
  |  Branch (1231:7): [True: 120, False: 7]
  ------------------
 1232|    120|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    127|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 127]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    127|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.74k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.74k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.74k|  converter.cnvFromXmp();
 1333|  1.74k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.74k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.74k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.74k|  converter.cnvFromXmp();
 1371|  1.74k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  1.57k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  1.57k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 0, False: 1.57k]
  ------------------
 1382|      0|    return true;  // nothing to do
 1383|  1.57k|#ifdef EXV_HAVE_ICONV
 1384|  1.57k|  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.57k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  1.57k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  1.57k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 1.57k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  1.57k|  bool ret = true;
 1407|  1.57k|  auto cd = iconv_open(to.data(), from.data());
 1408|  1.57k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 1.57k]
  ------------------
 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.57k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  1.57k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  1.57k|#endif
 1420|  1.57k|  size_t inbytesleft = str.length();
 1421|  9.47k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 8.88k, False: 597]
  ------------------
 1422|  8.88k|    char outbuf[256];
 1423|  8.88k|    char* outptr = outbuf;
 1424|  8.88k|    size_t outbytesleft = sizeof(outbuf);
 1425|  8.88k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  8.88k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  8.88k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 8.55k, False: 324]
  |  Branch (1427:53): [True: 973, False: 7.58k]
  ------------------
 1428|    973|#ifndef SUPPRESS_WARNINGS
 1429|    973|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|    973|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 973]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    973|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|    973|#endif
 1431|    973|      ret = false;
 1432|    973|      break;
 1433|    973|    }
 1434|  7.90k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  7.90k|  }
 1436|       |
 1437|  1.57k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 1.57k, False: 0]
  ------------------
 1438|  1.57k|    iconv_close(cd);
 1439|       |
 1440|  1.57k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 597, False: 973]
  ------------------
 1441|    597|    str = std::move(outstr);
 1442|  1.57k|  return ret;
 1443|  1.57k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|    409|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|    409|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 121, False: 288]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    121|    value = pos->toString(0);
 1596|    121|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 61, False: 60]
  |  Branch (1596:31): [True: 12, False: 49]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|     12|      value = pos->toString();
 1600|     12|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 12, False: 0]
  |  Branch (1600:32): [True: 12, False: 0]
  ------------------
 1601|     12|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|     12|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 12, False: 0]
  ------------------
 1603|     12|          value = value.substr(first_space_pos + 1);
 1604|     12|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|     12|      }
 1608|     12|    }
 1609|    288|  } else {
 1610|    288|    value = pos->toString();
 1611|    288|  }
 1612|    409|  return pos->value().ok();
 1613|    409|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  36.1k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  36.1k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  36.1k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  36.1k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 36.1k]
  |  Branch (18:17): [True: 0, False: 36.1k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  36.1k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 4.06k, False: 32.1k]
  |  Branch (22:26): [True: 4.03k, False: 29]
  ------------------
   23|  4.03k|    setByteOrder(littleEndian);
   24|  32.1k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 7.11k, False: 25.0k]
  |  Branch (24:33): [True: 7.07k, False: 43]
  ------------------
   25|  7.07k|    setByteOrder(bigEndian);
   26|  25.0k|  } else {
   27|  25.0k|    return false;
   28|  25.0k|  }
   29|  11.1k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 889, False: 10.2k]
  ------------------
   30|    889|    return false;
   31|  10.2k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  10.2k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 9.83k, False: 380]
  ------------------
   33|  9.83k|    return false;
   34|    380|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|    380|  return true;
   37|  10.2k|}

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

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

_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  126|  9.46k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  127|  9.46k|  return doAdd(std::move(component));
  128|  9.46k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  134|  9.46k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  135|  9.46k|  return components_.emplace_back(std::move(component));
  136|  9.46k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  140|    567|void CiffHeader::read(const byte* pData, size_t size) {
  141|    567|  if (size < 14)
  ------------------
  |  Branch (141:7): [True: 0, False: 567]
  ------------------
  142|      0|    throw Error(ErrorCode::kerNotACrwImage);
  143|       |
  144|    567|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (144:7): [True: 383, False: 184]
  |  Branch (144:26): [True: 383, False: 0]
  ------------------
  145|    383|    byteOrder_ = littleEndian;
  146|    383|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (146:14): [True: 184, False: 0]
  |  Branch (146:33): [True: 184, False: 0]
  ------------------
  147|    184|    byteOrder_ = bigEndian;
  148|    184|  } else {
  149|      0|    throw Error(ErrorCode::kerNotACrwImage);
  150|      0|  }
  151|    567|  offset_ = getULong(pData + 2, byteOrder_);
  152|    567|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (152:7): [True: 14, False: 553]
  |  Branch (152:23): [True: 54, False: 499]
  ------------------
  153|     68|    throw Error(ErrorCode::kerNotACrwImage);
  154|    499|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (154:7): [True: 0, False: 499]
  ------------------
  155|      0|    throw Error(ErrorCode::kerNotACrwImage);
  156|      0|  }
  157|       |
  158|    499|  pPadding_.clear();
  159|    499|  if (offset_ > 14) {
  ------------------
  |  Branch (159:7): [True: 387, False: 112]
  ------------------
  160|    387|    pPadding_.resize(offset_ - 14);
  161|    387|    padded_ = offset_ - 14;
  162|    387|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  163|    387|  }
  164|       |
  165|    499|  pRootDir_ = std::make_unique<CiffDirectory>();
  166|    499|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  167|    499|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  169|  9.69k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  170|  9.69k|  doRead(pData, size, start, byteOrder);
  171|  9.69k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  173|  9.69k|void CiffComponent::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  174|       |  // We're going read 10 bytes. Make sure they won't be out-of-bounds.
  175|  9.69k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (175:11): [True: 9.69k, False: 0]
  |  Branch (175:25): [True: 9.69k, False: 0]
  ------------------
  176|  9.69k|  tag_ = getUShort(pData + start, byteOrder);
  177|       |
  178|  9.69k|  DataLocId dl = dataLocation();
  179|       |
  180|  9.69k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (180:7): [True: 5.67k, False: 4.01k]
  ------------------
  181|  5.67k|    size_ = getULong(pData + start + 2, byteOrder);
  182|  5.67k|    offset_ = getULong(pData + start + 6, byteOrder);
  183|       |
  184|       |    // Make sure that the sub-region does not overlap with the 10 bytes
  185|       |    // that we just read. (Otherwise a malicious file could cause an
  186|       |    // infinite recursion.) There are two cases two consider because
  187|       |    // the sub-region is allowed to be either before or after the 10
  188|       |    // bytes in memory.
  189|  5.67k|    if (offset_ < start) {
  ------------------
  |  Branch (189:9): [True: 5.44k, False: 232]
  ------------------
  190|       |      // Sub-region is before in memory.
  191|  5.44k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  192|  5.44k|    } else {
  193|       |      // Sub-region is after in memory.
  194|    232|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  195|    232|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  196|    232|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  197|    232|    }
  198|  5.67k|  }
  199|  9.69k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (199:7): [True: 3.99k, False: 5.69k]
  ------------------
  200|  3.99k|    size_ = 8;
  201|  3.99k|    offset_ = start + 2;
  202|  3.99k|  }
  203|  9.69k|  pData_ = pData + offset_;
  204|       |#ifdef EXIV2_DEBUG_MESSAGES
  205|       |  std::cout << "  Entry for tag 0x" << std::hex << tagId() << " (0x" << tag() << "), " << std::dec << size_
  206|       |            << " Bytes, Offset is " << offset_ << "\n";
  207|       |#endif
  208|       |
  209|  9.69k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  211|  1.72k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  212|  1.72k|  CiffComponent::doRead(pData, size, start, byteOrder);
  213|       |#ifdef EXIV2_DEBUG_MESSAGES
  214|       |  std::cout << "Reading directory 0x" << std::hex << tag() << "\n";
  215|       |#endif
  216|  1.72k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (216:7): [True: 0, False: 1.72k]
  ------------------
  217|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  218|       |
  219|  1.72k|  readDirectory(pData + offset(), this->size(), byteOrder);
  220|       |#ifdef EXIV2_DEBUG_MESSAGES
  221|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  222|       |#endif
  223|  1.72k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  225|  2.20k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  226|  2.20k|  if (size < 4)
  ------------------
  |  Branch (226:7): [True: 15, False: 2.18k]
  ------------------
  227|     15|    throw Error(ErrorCode::kerCorruptedMetadata);
  228|  2.18k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  229|  2.18k|  if (o > size - 2)
  ------------------
  |  Branch (229:7): [True: 31, False: 2.15k]
  ------------------
  230|     31|    throw Error(ErrorCode::kerCorruptedMetadata);
  231|  2.15k|  uint16_t count = getUShort(pData + o, byteOrder);
  232|       |#ifdef EXIV2_DEBUG_MESSAGES
  233|       |  std::cout << "Directory at offset " << std::dec << o << ", " << count << " entries \n";
  234|       |#endif
  235|  2.15k|  o += 2;
  236|  2.15k|  if (count * 10u > size - o)
  ------------------
  |  Branch (236:7): [True: 17, False: 2.13k]
  ------------------
  237|     17|    throw Error(ErrorCode::kerCorruptedMetadata);
  238|       |
  239|  11.8k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (239:24): [True: 9.69k, False: 2.13k]
  ------------------
  240|  9.69k|    uint16_t tag = getUShort(pData + o, byteOrder);
  241|  9.69k|    auto m = [this, tag]() -> UniquePtr {
  242|  9.69k|      if (this->typeId(tag) == TypeId::directory)
  243|  9.69k|        return std::make_unique<CiffDirectory>();
  244|  9.69k|      return std::make_unique<CiffEntry>();
  245|  9.69k|    }();
  246|  9.69k|    m->setDir(this->tag());
  247|  9.69k|    m->read(pData, size, o, byteOrder);
  248|  9.69k|    add(std::move(m));
  249|  9.69k|    o += 10;
  250|  9.69k|  }
  251|  2.13k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  253|    222|void CiffHeader::decode(Image& image) const {
  254|       |  // Nothing to decode from the header itself, just add correct byte order
  255|    222|  if (pRootDir_)
  ------------------
  |  Branch (255:7): [True: 222, False: 0]
  ------------------
  256|    222|    pRootDir_->decode(image, byteOrder_);
  257|    222|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  259|  5.87k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  260|  5.87k|  doDecode(image, byteOrder);
  261|  5.87k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  263|  4.29k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  264|  4.29k|  CrwMap::decode(*this, image, byteOrder);
  265|  4.29k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  267|  1.58k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  268|  5.65k|  for (auto&& component : components_) {
  ------------------
  |  Branch (268:25): [True: 5.65k, False: 1.58k]
  ------------------
  269|  5.65k|    component->decode(image, byteOrder);
  270|  5.65k|  }
  271|  1.58k|}  // CiffDirectory::doDecode
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  435|  11.3k|TypeId CiffComponent::typeId(uint16_t tag) {
  436|  11.3k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (436:11): [True: 11.2k, False: 55]
  ------------------
  437|  4.59k|    case 0x0000:
  ------------------
  |  Branch (437:5): [True: 4.59k, False: 6.70k]
  ------------------
  438|  4.59k|      return unsignedByte;
  439|  1.42k|    case 0x0800:
  ------------------
  |  Branch (439:5): [True: 1.42k, False: 9.87k]
  ------------------
  440|  1.42k|      return asciiString;
  441|    820|    case 0x1000:
  ------------------
  |  Branch (441:5): [True: 820, False: 10.4k]
  ------------------
  442|    820|      return unsignedShort;
  443|    979|    case 0x1800:
  ------------------
  |  Branch (443:5): [True: 979, False: 10.3k]
  ------------------
  444|    979|      return unsignedLong;
  445|  1.69k|    case 0x2000:
  ------------------
  |  Branch (445:5): [True: 1.69k, False: 9.60k]
  ------------------
  446|  1.69k|      return undefined;
  447|    235|    case 0x2800:
  ------------------
  |  Branch (447:5): [True: 235, False: 11.0k]
  ------------------
  448|  1.72k|    case 0x3000:
  ------------------
  |  Branch (448:5): [True: 1.49k, False: 9.81k]
  ------------------
  449|  1.72k|      return directory;
  450|  11.3k|  }
  451|     55|  return invalidTypeId;
  452|  11.3k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  454|  9.69k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  455|  9.69k|  switch (tag & 0xc000) {
  456|  5.67k|    case 0x0000:
  ------------------
  |  Branch (456:5): [True: 5.67k, False: 4.01k]
  ------------------
  457|  5.67k|      return DataLocId::valueData;
  458|  3.99k|    case 0x4000:
  ------------------
  |  Branch (458:5): [True: 3.99k, False: 5.69k]
  ------------------
  459|  3.99k|      return DataLocId::directoryData;
  460|     15|    default:
  ------------------
  |  Branch (460:5): [True: 15, False: 9.67k]
  ------------------
  461|     15|      throw Error(ErrorCode::kerCorruptedMetadata);
  462|  9.69k|  }
  463|  9.69k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  470|    222|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  471|    222|  if (!pRootDir_)
  ------------------
  |  Branch (471:7): [True: 0, False: 222]
  ------------------
  472|      0|    return nullptr;
  473|    222|  return pRootDir_->findComponent(crwTagId, crwDir);
  474|    222|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  476|  5.85k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  477|  5.85k|  return doFindComponent(crwTagId, crwDir);
  478|  5.85k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  480|  4.27k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  481|  4.27k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (481:7): [True: 29, False: 4.25k]
  |  Branch (481:30): [True: 4, False: 25]
  ------------------
  482|      4|    return this;
  483|      4|  }
  484|  4.27k|  return nullptr;
  485|  4.27k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  487|  1.57k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  488|  5.63k|  for (auto&& component : components_) {
  ------------------
  |  Branch (488:25): [True: 5.63k, False: 1.57k]
  ------------------
  489|  5.63k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (489:14): [True: 4, False: 5.63k]
  ------------------
  490|      4|      return cc;
  491|  5.63k|  }
  492|  1.57k|  return nullptr;
  493|  1.57k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  604|  4.29k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  605|  4.29k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  606|  4.29k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (606:7): [True: 638, False: 3.65k]
  |  Branch (606:14): [True: 638, False: 0]
  ------------------
  607|    638|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  608|    638|  }
  609|  4.29k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  611|  4.29k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  612|  86.5k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (612:19): [True: 86.5k, False: 3.65k]
  ------------------
  613|  86.5k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (613:9): [True: 9.47k, False: 77.0k]
  |  Branch (613:34): [True: 638, False: 8.83k]
  ------------------
  614|    638|      return &crw;
  615|    638|    }
  616|  86.5k|  }
  617|  3.65k|  return nullptr;
  618|  4.29k|}  // CrwMap::crwMapping
_ZN5Exiv28Internal6CrwMap12decode0x0805ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  621|     10|                          ByteOrder /*byteOrder*/) {
  622|     10|  auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
  623|     10|  image.setComment(s);
  624|     10|}  // CrwMap::decode0x0805
_ZN5Exiv28Internal6CrwMap12decode0x080aERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  627|     73|                          ByteOrder byteOrder) {
  628|     73|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (628:7): [True: 0, False: 73]
  ------------------
  629|      0|    return;
  630|       |
  631|       |  // Make
  632|     73|  ExifKey key1("Exif.Image.Make");
  633|     73|  auto value1 = Value::create(ciffComponent.typeId());
  634|     73|  uint32_t i = 0;
  635|    414|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (635:10): [True: 388, False: 26]
  ------------------
  636|    388|    ++i;
  637|    388|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (637:9): [True: 47, False: 341]
  ------------------
  638|     47|      break;
  639|     47|    }
  640|    388|  }
  641|     73|  value1->read(ciffComponent.pData(), i, byteOrder);
  642|     73|  image.exifData().add(key1, value1.get());
  643|       |
  644|       |  // Model
  645|     73|  ExifKey key2("Exif.Image.Model");
  646|     73|  auto value2 = Value::create(ciffComponent.typeId());
  647|     73|  uint32_t j = i;
  648|    178|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (648:10): [True: 137, False: 41]
  ------------------
  649|    137|    ++i;
  650|    137|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (650:9): [True: 32, False: 105]
  ------------------
  651|     32|      break;
  652|     32|    }
  653|    137|  }
  654|     73|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  655|     73|  image.exifData().add(key2, value2.get());
  656|     73|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  659|     73|                         ByteOrder byteOrder) {
  660|     73|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (660:7): [True: 0, False: 73]
  ------------------
  661|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  662|      0|    return;
  663|      0|  }
  664|       |
  665|     73|  int64_t aperture = 0;
  666|     73|  int64_t shutterSpeed = 0;
  667|       |
  668|     73|  auto ifdId = [pCrwMapping] {
  669|     73|    if (pCrwMapping->tag_ == 0x0001)
  670|     73|      return IfdId::canonCsId;
  671|     73|    if (pCrwMapping->tag_ == 0x0004)
  672|     73|      return IfdId::canonSiId;
  673|     73|    if (pCrwMapping->tag_ == 0x000f)
  674|     73|      return IfdId::canonCfId;
  675|     73|    if (pCrwMapping->tag_ == 0x0012)
  676|     73|      return IfdId::canonPiId;
  677|     73|    return IfdId::ifdIdNotSet;
  678|     73|  }();
  679|       |
  680|     73|  std::string groupName(Internal::groupName(ifdId));
  681|     73|  const size_t component_size = ciffComponent.size();
  682|     73|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  683|     73|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  684|     73|          ErrorCode::kerCorruptedMetadata);
  685|     73|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  686|     73|  uint16_t c = 1;
  687|    292|  while (c < num_components) {
  ------------------
  |  Branch (687:10): [True: 219, False: 73]
  ------------------
  688|    219|    uint16_t n = 1;
  689|    219|    ExifKey key(c, groupName);
  690|    219|    UShortValue value;
  691|    219|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (691:9): [True: 30, False: 189]
  |  Branch (691:38): [True: 0, False: 30]
  |  Branch (691:49): [True: 0, False: 0]
  ------------------
  692|      0|      n = 3;
  693|    219|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  694|    219|    image.exifData().add(key, &value);
  695|    219|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (695:9): [True: 105, False: 114]
  |  Branch (695:38): [True: 0, False: 105]
  ------------------
  696|      0|      aperture = value.toInt64();
  697|    219|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (697:9): [True: 105, False: 114]
  |  Branch (697:38): [True: 0, False: 105]
  ------------------
  698|      0|      shutterSpeed = value.toInt64();
  699|    219|    c += n;
  700|    219|  }
  701|       |
  702|     73|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (702:7): [True: 35, False: 38]
  ------------------
  703|       |    // Exif.Photo.FNumber
  704|     35|    float f = fnumber(canonEv(aperture));
  705|     35|    auto [r, s] = floatToRationalCast(f);
  706|     35|    auto ur = URational(r, s);
  707|     35|    URationalValue fn;
  708|     35|    fn.value_.push_back(ur);
  709|     35|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  710|       |
  711|       |    // Exif.Photo.ExposureTime
  712|     35|    ur = exposureTime(canonEv(shutterSpeed));
  713|     35|    URationalValue et;
  714|     35|    et.value_.push_back(ur);
  715|     35|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  716|     35|  }
  717|     73|}  // CrwMap::decodeArray
_ZN5Exiv28Internal6CrwMap12decode0x180eERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  720|     23|                          ByteOrder byteOrder) {
  721|     23|  if (ciffComponent.size() < 8 || ciffComponent.typeId() != unsignedLong) {
  ------------------
  |  Branch (721:7): [True: 0, False: 23]
  |  Branch (721:35): [True: 0, False: 23]
  ------------------
  722|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  723|      0|    return;
  724|      0|  }
  725|     23|  ULongValue v;
  726|     23|  v.read(ciffComponent.pData(), 8, byteOrder);
  727|     23|  time_t t = v.value_.at(0);
  728|     23|  std::tm r;
  729|       |#ifdef _WIN32
  730|       |  auto tm = localtime_s(&r, &t) ? nullptr : &r;
  731|       |#else
  732|     23|  auto tm = localtime_r(&t, &r);
  733|     23|#endif
  734|     23|  if (!tm)
  ------------------
  |  Branch (734:7): [True: 0, False: 23]
  ------------------
  735|      0|    return;
  736|     23|  const size_t m = 20;
  737|     23|  char s[m];
  738|     23|  std::strftime(s, m, "%Y:%m:%d %T", tm);
  739|       |
  740|     23|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  741|     23|  AsciiValue value;
  742|     23|  value.read(s);
  743|     23|  image.exifData().add(key, &value);
  744|     23|}  // CrwMap::decode0x180e
_ZN5Exiv28Internal6CrwMap12decode0x1810ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  747|     23|                          ByteOrder byteOrder) {
  748|     23|  if (ciffComponent.typeId() != unsignedLong || ciffComponent.size() < 28) {
  ------------------
  |  Branch (748:7): [True: 0, False: 23]
  |  Branch (748:49): [True: 23, False: 0]
  ------------------
  749|     23|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  750|     23|    return;
  751|     23|  }
  752|       |
  753|      0|  ExifKey key1("Exif.Photo.PixelXDimension");
  754|      0|  ULongValue value1;
  755|      0|  value1.read(ciffComponent.pData(), 4, byteOrder);
  756|      0|  image.exifData().add(key1, &value1);
  757|       |
  758|      0|  ExifKey key2("Exif.Photo.PixelYDimension");
  759|      0|  ULongValue value2;
  760|      0|  value2.read(ciffComponent.pData() + 4, 4, byteOrder);
  761|      0|  image.exifData().add(key2, &value2);
  762|       |
  763|      0|  int32_t r = getLong(ciffComponent.pData() + 12, byteOrder);
  764|      0|  uint16_t o = RotationMap::orientation(r);
  765|      0|  image.exifData()["Exif.Image.Orientation"] = o;
  766|       |
  767|      0|}  // CrwMap::decode0x1810
_ZN5Exiv28Internal6CrwMap12decode0x2008ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  770|     27|                          ByteOrder /*byteOrder*/) {
  771|     27|  ExifThumb exifThumb(image.exifData());
  772|     27|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  773|     27|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  776|    432|                         ByteOrder byteOrder) {
  777|       |  // create a key and value pair
  778|    432|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  779|    432|  Value::UniquePtr value;
  780|    432|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (780:7): [True: 432, False: 0]
  ------------------
  781|    432|    value = Value::create(ciffComponent.typeId());
  782|    432|    size_t size = 0;
  783|    432|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (783:9): [True: 20, False: 412]
  ------------------
  784|     20|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  785|    412|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (785:16): [True: 209, False: 203]
  ------------------
  786|       |      // determine size from the data, by looking for the first 0
  787|    209|      uint32_t i = 0;
  788|  1.18k|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (788:14): [True: 1.12k, False: 55]
  ------------------
  789|  1.12k|        ++i;
  790|  1.12k|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (790:13): [True: 154, False: 974]
  ------------------
  791|    154|          break;
  792|    154|        }
  793|  1.12k|      }
  794|    209|      size = i;
  795|    209|    } else {
  796|       |      // by default, use the size from the directory entry
  797|    203|      size = ciffComponent.size();
  798|    203|    }
  799|    432|    enforce(size <= ciffComponent.size(), ErrorCode::kerCorruptedMetadata);
  800|    432|    value->read(ciffComponent.pData(), size, byteOrder);
  801|    432|  }
  802|       |  // Add metadatum to exif data
  803|    432|  image.exifData().add(key, value.get());
  804|    432|}  // CrwMap::decodeBasic
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  241|  9.69k|    auto m = [this, tag]() -> UniquePtr {
  242|  9.69k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (242:11): [True: 1.72k, False: 7.96k]
  ------------------
  243|  1.72k|        return std::make_unique<CiffDirectory>();
  244|  7.96k|      return std::make_unique<CiffEntry>();
  245|  9.69k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderEENK3$_0clEv:
  668|     73|  auto ifdId = [pCrwMapping] {
  669|     73|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (669:9): [True: 10, False: 63]
  ------------------
  670|     10|      return IfdId::canonCsId;
  671|     63|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (671:9): [True: 35, False: 28]
  ------------------
  672|     35|      return IfdId::canonSiId;
  673|     28|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (673:9): [True: 10, False: 18]
  ------------------
  674|     10|      return IfdId::canonCfId;
  675|     18|    if (pCrwMapping->tag_ == 0x0012)
  ------------------
  |  Branch (675:9): [True: 18, False: 0]
  ------------------
  676|     18|      return IfdId::canonPiId;
  677|      0|    return IfdId::ifdIdNotSet;
  678|     18|  }();

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

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   164k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   164k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 88.3k, False: 75.9k]
  |  Branch (378:31): [True: 19.2k, False: 69.1k]
  ------------------
  379|  19.2k|    return -1;
  380|   145k|  const DataSet* dataSet = records_[recordId];
  381|   145k|  int idx;
  382|  2.55M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 2.42M, False: 127k]
  ------------------
  383|  2.42M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 17.4k, False: 2.41M]
  ------------------
  384|  17.4k|      return -1;
  385|  2.42M|  }
  386|   127k|  return idx;
  387|   145k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  13.8k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  13.8k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 13.5k, False: 261]
  |  Branch (390:31): [True: 0, False: 13.5k]
  ------------------
  391|      0|    return -1;
  392|  13.8k|  const DataSet* dataSet = records_[recordId];
  393|  13.8k|  int idx;
  394|   409k|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 395k, False: 13.8k]
  ------------------
  395|   395k|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 395k]
  ------------------
  396|      0|      return -1;
  397|   395k|  }
  398|  13.8k|  return idx;
  399|  13.8k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  54.7k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  54.7k|  int idx = dataSetIdx(number, recordId);
  403|  54.7k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 12.2k, False: 42.5k]
  ------------------
  404|  12.2k|    return unknownDataSet.type_;
  405|  42.5k|  return records_[recordId][idx].type_;
  406|  54.7k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|  55.1k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|  55.1k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 42.9k, False: 12.2k]
  ------------------
  410|  42.9k|    return records_[recordId][idx].name_;
  411|       |
  412|  12.2k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  12.2k|#define stringFormat std::format
  ------------------
  413|  55.1k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  54.4k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  54.4k|  int idx = dataSetIdx(number, recordId);
  438|  54.4k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 12.2k, False: 42.1k]
  ------------------
  439|  12.2k|    return unknownDataSet.repeatable_;
  440|  42.1k|  return records_[recordId][idx].repeatable_;
  441|  54.4k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  13.8k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  13.8k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 13.8k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  13.8k|    return records_[recordId][idx].number_;
  447|  13.8k|  }
  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|  55.1k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|  55.1k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 25.4k, False: 29.7k]
  |  Branch (454:31): [True: 23.3k, False: 6.40k]
  ------------------
  455|  48.7k|    return recordInfo_[recordId].name_;
  456|  48.7k|  }
  457|       |
  458|  6.40k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  6.40k|#define stringFormat std::format
  ------------------
  459|  55.1k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  13.8k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  13.8k|  uint16_t i;
  470|  14.1k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 14.1k, False: 0]
  ------------------
  471|  14.1k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 13.8k, False: 261]
  ------------------
  472|  13.8k|      break;
  473|  14.1k|  }
  474|  13.8k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 13.8k]
  ------------------
  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|  13.8k|  return i;
  480|  13.8k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  13.8k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  13.8k|  decomposeKey();
  492|  13.8k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  41.3k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  41.3k|  makeKey();
  496|  41.3k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   361k|uint16_t IptcKey::tag() const {
  523|   361k|  return tag_;
  524|   361k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   130k|uint16_t IptcKey::record() const {
  531|   130k|  return record_;
  532|   130k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   120k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   120k|  return UniquePtr(clone_());
  536|   120k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   120k|IptcKey* IptcKey::clone_() const {
  539|   120k|  return new IptcKey(*this);
  540|   120k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  13.8k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  13.8k|  auto posDot1 = key_.find('.');
  545|  13.8k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  13.8k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 13.8k]
  |  Branch (547:39): [True: 0, False: 13.8k]
  ------------------
  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|  13.8k|  const std::string familyName = key_.substr(0, posDot1);
  553|  13.8k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 13.8k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  13.8k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  13.8k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  13.8k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  13.8k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  13.8k|  recordName = IptcDataSets::recordName(recId);
  565|  13.8k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  13.8k|  tag_ = dataSet;
  568|  13.8k|  record_ = recId;
  569|  13.8k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  13.8k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  41.3k|void IptcKey::makeKey() {
  573|  41.3k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  41.3k|         IptcDataSets::dataSetName(tag_, record_);
  575|  41.3k|}

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

_ZN5Exiv28EpsImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
 1026|  3.60k|EpsImage::EpsImage(BasicIo::UniquePtr io, bool create) : Image(ImageType::eps, mdXmp, std::move(io)) {
 1027|       |  // LogMsg::setLevel(LogMsg::debug);
 1028|  3.60k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (1028:7): [True: 0, False: 3.60k]
  |  Branch (1028:17): [True: 0, False: 0]
  ------------------
 1029|       |#ifdef DEBUG
 1030|       |    EXV_DEBUG << "Exiv2::EpsImage:: Creating blank EPS image\n";
 1031|       |#endif
 1032|      0|    IoCloser closer(*io_);
 1033|      0|    if (io_->write(reinterpret_cast<const byte*>(epsBlank.data()), epsBlank.size()) != epsBlank.size()) {
  ------------------
  |  Branch (1033:9): [True: 0, False: 0]
  ------------------
 1034|      0|#ifndef SUPPRESS_WARNINGS
 1035|      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()
  ------------------
 1036|      0|#endif
 1037|      0|      throw Error(ErrorCode::kerImageWriteFailed);
 1038|      0|    }
 1039|      0|  }
 1040|  3.60k|}
_ZNK5Exiv28EpsImage8mimeTypeEv:
 1042|  5.25k|std::string EpsImage::mimeType() const {
 1043|  5.25k|  return "application/postscript";
 1044|  5.25k|}
_ZN5Exiv28EpsImage12readMetadataEv:
 1050|  3.60k|void EpsImage::readMetadata() {
 1051|       |#ifdef DEBUG
 1052|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Reading EPS file " << io_->path() << "\n";
 1053|       |#endif
 1054|       |
 1055|       |  // read metadata
 1056|  3.60k|  readWriteEpsMetadata(*io_, xmpPacket_, nativePreviews_, /* write = */ false);
 1057|       |
 1058|       |  // decode XMP metadata
 1059|  3.60k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_) > 1) {
  ------------------
  |  Branch (1059:7): [True: 541, False: 3.06k]
  |  Branch (1059:30): [True: 163, False: 378]
  ------------------
 1060|    163|#ifndef SUPPRESS_WARNINGS
 1061|    163|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    163|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 163]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    163|  LogMsg(LogMsg::warn).os()
  ------------------
 1062|    163|#endif
 1063|    163|    throw Error(ErrorCode::kerFailedToReadImageData);
 1064|    163|  }
 1065|       |
 1066|       |#ifdef DEBUG
 1067|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Finished reading EPS file " << io_->path() << "\n";
 1068|       |#endif
 1069|  3.60k|}
_ZN5Exiv214newEpsInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1094|  3.60k|Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, bool create) {
 1095|  3.60k|  auto image = std::make_unique<EpsImage>(std::move(io), create);
 1096|  3.60k|  if (!image->good()) {
  ------------------
  |  Branch (1096:7): [True: 0, False: 3.60k]
  ------------------
 1097|      0|    return nullptr;
 1098|      0|  }
 1099|  3.60k|  return image;
 1100|  3.60k|}
_ZN5Exiv29isEpsTypeERNS_7BasicIoEb:
 1102|  26.2k|bool isEpsType(BasicIo& iIo, bool advance) {
 1103|       |  // read as many bytes as needed for the longest (DOS) EPS signature
 1104|  26.2k|  constexpr auto bufSize = [] {
 1105|  26.2k|    auto f = [](const auto& a, const auto& b) { return a.size() < b.size(); };
 1106|  26.2k|    return std::max_element(epsFirstLine.begin(), epsFirstLine.end(), f)->size();
 1107|  26.2k|  }();
 1108|  26.2k|  const size_t restore = iIo.tell();  // save
 1109|  26.2k|  DataBuf buf = iIo.read(bufSize);
 1110|  26.2k|  if (iIo.error() || buf.size() != bufSize) {
  ------------------
  |  Branch (1110:7): [True: 0, False: 26.2k]
  |  Branch (1110:22): [True: 0, False: 26.2k]
  ------------------
 1111|      0|    iIo.seek(restore, BasicIo::beg);
 1112|      0|    return false;
 1113|      0|  }
 1114|       |  // check for all possible (DOS) EPS signatures
 1115|  26.2k|  bool matched = (buf.cmpBytes(0, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
 1116|  26.2k|  if (!matched) {
  ------------------
  |  Branch (1116:7): [True: 25.1k, False: 1.08k]
  ------------------
 1117|  66.3k|    for (auto&& eps : epsFirstLine) {
  ------------------
  |  Branch (1117:21): [True: 66.3k, False: 19.0k]
  ------------------
 1118|  66.3k|      if (buf.cmpBytes(0, eps.data(), eps.size()) == 0) {
  ------------------
  |  Branch (1118:11): [True: 6.13k, False: 60.2k]
  ------------------
 1119|  6.13k|        matched = true;
 1120|  6.13k|        break;
 1121|  6.13k|      }
 1122|  66.3k|    }
 1123|  25.1k|  }
 1124|       |  // seek back if possible and requested
 1125|  26.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (1125:7): [True: 26.2k, False: 0]
  |  Branch (1125:19): [True: 0, False: 0]
  ------------------
 1126|  26.2k|    iIo.seek(restore, BasicIo::beg);
 1127|  26.2k|  }
 1128|  26.2k|  return matched;
 1129|  26.2k|}
epsimage.cpp:_ZN12_GLOBAL__N_120readWriteEpsMetadataERN5Exiv27BasicIoERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS3_6vectorINS0_13NativePreviewENS7_ISC_EEEEb:
  224|  3.60k|void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList& nativePreviews, bool write) {
  225|       |  // open input file
  226|  3.60k|  if (io.open() != 0) {
  ------------------
  |  Branch (226:7): [True: 0, False: 3.60k]
  ------------------
  227|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  228|      0|  }
  229|  3.60k|  IoCloser closer(io);
  230|       |
  231|       |  // read from input file via memory map
  232|  3.60k|  const byte* data = io.mmap();
  233|       |
  234|       |  // default positions and sizes
  235|  3.60k|  const size_t size = io.size();
  236|  3.60k|  size_t posEps = 0;
  237|  3.60k|  size_t posEndEps = size;
  238|  3.60k|  uint32_t posWmf = 0;
  239|  3.60k|  uint32_t sizeWmf = 0;
  240|  3.60k|  uint32_t posTiff = 0;
  241|  3.60k|  uint32_t sizeTiff = 0;
  242|       |
  243|  3.60k|  ErrorCode errcode = write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData;
  ------------------
  |  Branch (243:23): [True: 0, False: 3.60k]
  ------------------
  244|       |
  245|       |  // check for DOS EPS
  246|  3.60k|  const bool dosEps =
  247|  3.60k|      (size >= dosEpsSignature.size() && memcmp(data, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
  ------------------
  |  Branch (247:8): [True: 3.60k, False: 0]
  |  Branch (247:42): [True: 541, False: 3.06k]
  ------------------
  248|  3.60k|  if (dosEps) {
  ------------------
  |  Branch (248:7): [True: 541, False: 3.06k]
  ------------------
  249|       |#ifdef DEBUG
  250|       |    EXV_DEBUG << "readWriteEpsMetadata: Found DOS EPS signature\n";
  251|       |#endif
  252|       |
  253|    541|    enforce(size >= 30, errcode);
  254|    541|    posEps = getULong(data + 4, littleEndian);
  255|    541|    posEndEps = getULong(data + 8, littleEndian) + posEps;
  256|    541|    posWmf = getULong(data + 12, littleEndian);
  257|    541|    sizeWmf = getULong(data + 16, littleEndian);
  258|    541|    posTiff = getULong(data + 20, littleEndian);
  259|    541|    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|    541|    if (uint16_t checksum = getUShort(data + 28, littleEndian); checksum != 0xFFFF) {
  ------------------
  |  Branch (266:65): [True: 486, False: 55]
  ------------------
  267|       |#ifdef DEBUG
  268|       |      EXV_DEBUG << "readWriteEpsMetadata: DOS EPS checksum is not FFFF\n";
  269|       |#endif
  270|    486|    }
  271|    541|    if ((posWmf != 0 || sizeWmf != 0) && (posTiff != 0 || sizeTiff != 0)) {
  ------------------
  |  Branch (271:10): [True: 381, False: 160]
  |  Branch (271:25): [True: 56, False: 104]
  |  Branch (271:43): [True: 336, False: 86]
  |  Branch (271:59): [True: 64, False: 22]
  ------------------
  272|    400|#ifndef SUPPRESS_WARNINGS
  273|    400|      EXV_WARNING << "DOS EPS file has both WMF and TIFF section. Only one of those is allowed.\n";
  ------------------
  |  |  138|    400|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 400]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    400|  LogMsg(LogMsg::warn).os()
  ------------------
  274|    400|#endif
  275|    400|      if (write)
  ------------------
  |  Branch (275:11): [True: 0, False: 400]
  ------------------
  276|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  277|    400|    }
  278|    541|    if (sizeWmf == 0 && sizeTiff == 0) {
  ------------------
  |  Branch (278:9): [True: 194, False: 347]
  |  Branch (278:25): [True: 63, False: 131]
  ------------------
  279|     63|#ifndef SUPPRESS_WARNINGS
  280|     63|      EXV_WARNING << "DOS EPS file has neither WMF nor TIFF section. Exactly one of those is required.\n";
  ------------------
  |  |  138|     63|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 63]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     63|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     63|#endif
  282|     63|      if (write)
  ------------------
  |  Branch (282:11): [True: 0, False: 63]
  ------------------
  283|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  284|     63|    }
  285|    541|    enforce(30 <= posEps, errcode);
  286|    541|    enforce(sizeWmf == 0 || 30 <= posWmf, errcode);
  ------------------
  |  Branch (286:13): [True: 227, False: 314]
  |  Branch (286:29): [True: 259, False: 55]
  ------------------
  287|    541|    enforce(sizeTiff == 0 || 30 <= posTiff, errcode);
  ------------------
  |  Branch (287:13): [True: 179, False: 362]
  |  Branch (287:30): [True: 303, False: 59]
  ------------------
  288|       |
  289|    541|    enforce(posEps <= posEndEps && posEndEps <= size, errcode);
  ------------------
  |  Branch (289:13): [True: 380, False: 161]
  |  Branch (289:36): [True: 176, False: 204]
  ------------------
  290|    541|    enforce(posWmf <= size && sizeWmf <= size - posWmf, errcode);
  ------------------
  |  Branch (290:13): [True: 151, False: 390]
  |  Branch (290:31): [True: 115, False: 36]
  ------------------
  291|    541|    enforce(posTiff <= size && sizeTiff <= size - posTiff, errcode);
  ------------------
  |  Branch (291:13): [True: 88, False: 453]
  |  Branch (291:32): [True: 68, False: 20]
  ------------------
  292|    541|  }
  293|       |
  294|       |  // check first line
  295|  3.60k|  std::string firstLine;
  296|  3.60k|  const size_t posSecondLine = readLine(firstLine, data, posEps, posEndEps);
  297|       |#ifdef DEBUG
  298|       |  EXV_DEBUG << "readWriteEpsMetadata: First line: " << firstLine << "\n";
  299|       |#endif
  300|  3.60k|  auto it = std::find(epsFirstLine.begin(), epsFirstLine.end(), firstLine);
  301|  3.60k|  if (it == epsFirstLine.end()) {
  ------------------
  |  Branch (301:7): [True: 117, False: 3.49k]
  ------------------
  302|    117|    throw Error(ErrorCode::kerNotAnImage, "EPS");
  303|    117|  }
  304|       |
  305|       |  // determine line ending style of the first line
  306|  3.49k|  if (posSecondLine >= posEndEps) {
  ------------------
  |  Branch (306:7): [True: 13, False: 3.47k]
  ------------------
  307|     13|#ifndef SUPPRESS_WARNINGS
  308|     13|    EXV_WARNING << "Premature end of file after first line.\n";
  ------------------
  |  |  138|     13|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     13|  LogMsg(LogMsg::warn).os()
  ------------------
  309|     13|#endif
  310|     13|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (310:17): [True: 0, False: 13]
  ------------------
  311|     13|  }
  312|  3.47k|  const std::string lineEnding(reinterpret_cast<const char*>(data + posEps + firstLine.size()),
  313|  3.47k|                               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.47k|  size_t posLanguageLevel = posEndEps;
  328|  3.47k|  size_t posContainsXmp = posEndEps;
  329|  3.47k|  size_t posPages = posEndEps;
  330|  3.47k|  size_t posExiv2Version = posEndEps;
  331|  3.47k|  size_t posExiv2Website = posEndEps;
  332|  3.47k|  size_t posEndComments = posEndEps;
  333|  3.47k|  size_t posAi7Thumbnail = posEndEps;
  334|  3.47k|  size_t posAi7ThumbnailEndData = posEndEps;
  335|  3.47k|  size_t posBeginPhotoshop = posEndEps;
  336|  3.47k|  size_t posEndPhotoshop = posEndEps;
  337|  3.47k|  size_t posPage = posEndEps;
  338|  3.47k|  size_t posBeginPageSetup = posEndEps;
  339|  3.47k|  size_t posEndPageSetup = posEndEps;
  340|  3.47k|  size_t posPageTrailer = posEndEps;
  341|  3.47k|  size_t posEof = posEndEps;
  342|  3.47k|  std::vector<std::pair<size_t, size_t>> removableEmbeddings;
  343|  3.47k|  size_t depth = 0;
  344|  3.47k|  const size_t maxDepth = std::numeric_limits<size_t>::max();
  345|  3.47k|  bool illustrator8 = false;
  346|  3.47k|  bool corelDraw = false;
  347|  3.47k|  bool implicitPage = false;
  348|  3.47k|  bool implicitPageSetup = false;
  349|  3.47k|  bool implicitPageTrailer = false;
  350|  3.47k|  bool inDefaultsPreviewPrologSetup = false;
  351|  3.47k|  bool inRemovableEmbedding = false;
  352|  3.47k|  std::string removableEmbeddingEndLine;
  353|  3.47k|  size_t removableEmbeddingsWithUnmarkedTrailer = 0;
  354|   406k|  for (size_t pos = posEps; pos < posEof;) {
  ------------------
  |  Branch (354:29): [True: 403k, False: 3.40k]
  ------------------
  355|   403k|    const size_t startPos = pos;
  356|   403k|    std::string line;
  357|   403k|    pos = readLine(line, data, startPos, posEndEps);
  358|       |#ifdef DEBUG
  359|       |    bool significantLine = true;
  360|       |#endif
  361|       |    // nested documents
  362|   403k|    if (posPage == posEndEps && (line.starts_with("%%IncludeDocument:") || line.starts_with("%%BeginDocument:"))) {
  ------------------
  |  Branch (362:9): [True: 69.9k, False: 333k]
  |  Branch (362:34): [True: 20, False: 69.8k]
  |  Branch (362:76): [True: 14, False: 69.8k]
  ------------------
  363|     34|#ifndef SUPPRESS_WARNINGS
  364|     34|      EXV_WARNING << "Nested document at invalid position: " << startPos << "\n";
  ------------------
  |  |  138|     34|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 34]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     34|  LogMsg(LogMsg::warn).os()
  ------------------
  365|     34|#endif
  366|     34|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (366:19): [True: 0, False: 34]
  ------------------
  367|     34|    }
  368|   403k|    if (line.starts_with("%%BeginDocument:")) {
  ------------------
  |  Branch (368:9): [True: 41.0k, False: 362k]
  ------------------
  369|  41.0k|      if (depth == maxDepth) {
  ------------------
  |  Branch (369:11): [True: 0, False: 41.0k]
  ------------------
  370|      0|#ifndef SUPPRESS_WARNINGS
  371|      0|        EXV_WARNING << "Document too deeply nested at position: " << startPos << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  372|      0|#endif
  373|      0|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (373:21): [True: 0, False: 0]
  ------------------
  374|      0|      }
  375|  41.0k|      depth++;
  376|   362k|    } else if (line.starts_with("%%EndDocument")) {
  ------------------
  |  Branch (376:16): [True: 206, False: 362k]
  ------------------
  377|    206|      if (depth == 0) {
  ------------------
  |  Branch (377:11): [True: 11, False: 195]
  ------------------
  378|     11|#ifndef SUPPRESS_WARNINGS
  379|     11|        EXV_WARNING << "Unmatched EndDocument at position: " << startPos << "\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  380|     11|#endif
  381|     11|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (381:21): [True: 0, False: 11]
  ------------------
  382|     11|      }
  383|    195|      depth--;
  384|   362k|    } else {
  385|       |#ifdef DEBUG
  386|       |      significantLine = false;
  387|       |#endif
  388|   362k|    }
  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|   403k|    if (depth != 0)
  ------------------
  |  Branch (395:9): [True: 89.2k, False: 314k]
  ------------------
  396|  89.2k|      continue;
  397|       |    // explicit "Begin" comments
  398|   314k|    if (line.starts_with("%%BeginPreview:")) {
  ------------------
  |  Branch (398:9): [True: 501, False: 313k]
  ------------------
  399|    501|      inDefaultsPreviewPrologSetup = true;
  400|   313k|    } else if (line == "%%BeginDefaults") {
  ------------------
  |  Branch (400:16): [True: 315, False: 313k]
  ------------------
  401|    315|      inDefaultsPreviewPrologSetup = true;
  402|   313k|    } else if (line == "%%BeginProlog") {
  ------------------
  |  Branch (402:16): [True: 1.21k, False: 312k]
  ------------------
  403|  1.21k|      inDefaultsPreviewPrologSetup = true;
  404|   312k|    } else if (line == "%%BeginSetup") {
  ------------------
  |  Branch (404:16): [True: 204, False: 311k]
  ------------------
  405|    204|      inDefaultsPreviewPrologSetup = true;
  406|   311k|    } else if (posPage == posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (406:16): [True: 68.3k, False: 243k]
  |  Branch (406:40): [True: 116, False: 68.1k]
  ------------------
  407|    116|      posPage = startPos;
  408|   311k|    } else if (posPage != posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (408:16): [True: 243k, False: 68.1k]
  |  Branch (408:40): [True: 31, False: 243k]
  ------------------
  409|     31|      if (implicitPage) {
  ------------------
  |  Branch (409:11): [True: 17, False: 14]
  ------------------
  410|     17|#ifndef SUPPRESS_WARNINGS
  411|     17|        EXV_WARNING << "Page at position " << startPos << " conflicts with implicit page at position: " << posPage
  ------------------
  |  |  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()
  ------------------
  412|      0|                    << "\n";
  413|     17|#endif
  414|     17|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (414:21): [True: 0, False: 17]
  ------------------
  415|     17|      }
  416|     14|#ifndef SUPPRESS_WARNINGS
  417|     14|      EXV_WARNING << "Unable to handle multiple PostScript pages. Found second page at position: " << startPos << "\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()
  ------------------
  418|     14|#endif
  419|     14|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (419:19): [True: 0, False: 14]
  ------------------
  420|   311k|    } else if (line == "%%BeginPageSetup") {
  ------------------
  |  Branch (420:16): [True: 434, False: 311k]
  ------------------
  421|    434|      posBeginPageSetup = startPos;
  422|   311k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: Before %%EndPageSetup") {
  ------------------
  |  Branch (422:16): [True: 229k, False: 81.8k]
  |  Branch (422:41): [True: 631, False: 228k]
  ------------------
  423|    631|      inRemovableEmbedding = true;
  424|    631|      removableEmbeddings.emplace_back(startPos, startPos);
  425|    631|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  426|   310k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: After %%PageTrailer") {
  ------------------
  |  Branch (426:16): [True: 228k, False: 81.8k]
  |  Branch (426:41): [True: 587, False: 228k]
  ------------------
  427|    587|      inRemovableEmbedding = true;
  428|    587|      removableEmbeddings.emplace_back(startPos, startPos);
  429|    587|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  430|   310k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageSetup End \"AI11EPS\"") {
  ------------------
  |  Branch (430:16): [True: 228k, False: 81.8k]
  |  Branch (430:41): [True: 508, False: 227k]
  ------------------
  431|    508|      inRemovableEmbedding = true;
  432|    508|      removableEmbeddings.emplace_back(startPos, startPos);
  433|    508|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageSetup End \"AI11EPS\"";
  434|   309k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageTrailer Start \"AI11EPS\"") {
  ------------------
  |  Branch (434:16): [True: 227k, False: 81.8k]
  |  Branch (434:41): [True: 466, False: 227k]
  ------------------
  435|    466|      inRemovableEmbedding = true;
  436|    466|      removableEmbeddings.emplace_back(startPos, startPos);
  437|    466|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageTrailer Start \"AI11EPS\"";
  438|   309k|    } else if (!inRemovableEmbedding && line == "%begin_xml_code") {
  ------------------
  |  Branch (438:16): [True: 227k, False: 81.8k]
  |  Branch (438:41): [True: 4.89k, False: 222k]
  ------------------
  439|  4.89k|      inRemovableEmbedding = true;
  440|  4.89k|      removableEmbeddings.emplace_back(startPos, startPos);
  441|  4.89k|      removableEmbeddingEndLine = "%end_xml_code";
  442|  4.89k|      removableEmbeddingsWithUnmarkedTrailer++;
  443|   304k|    } else {
  444|       |#ifdef DEBUG
  445|       |      significantLine = false;
  446|       |#endif
  447|   304k|    }
  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|   314k|    if (line == "%%EOF" || line == "%begin_xml_code" || line.size() < 2 || line.front() != '%' || '\x21' > line[1] ||
  ------------------
  |  Branch (455:9): [True: 15, False: 314k]
  |  Branch (455:28): [True: 6.83k, False: 307k]
  |  Branch (455:57): [True: 46.2k, False: 261k]
  |  Branch (455:76): [True: 180k, False: 80.8k]
  |  Branch (455:99): [True: 4.54k, False: 76.2k]
  ------------------
  456|   238k|        line[1] > '\x7e') {
  ------------------
  |  Branch (456:9): [True: 195, False: 76.0k]
  ------------------
  457|   238k|      if (posEndComments == posEndEps) {
  ------------------
  |  Branch (457:11): [True: 2.18k, False: 235k]
  ------------------
  458|  2.18k|        posEndComments = startPos;
  459|       |#ifdef DEBUG
  460|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndComments at position: " << startPos << "\n";
  461|       |#endif
  462|  2.18k|      }
  463|   238k|    }
  464|   314k|    if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding &&
  ------------------
  |  Branch (464:9): [True: 69.7k, False: 244k]
  |  Branch (464:33): [True: 55.3k, False: 14.4k]
  |  Branch (464:64): [True: 16.6k, False: 38.6k]
  |  Branch (464:97): [True: 3.43k, False: 13.1k]
  ------------------
  465|  3.43k|        !onlyWhitespaces(line)) {
  ------------------
  |  Branch (465:9): [True: 1.83k, False: 1.59k]
  ------------------
  466|  1.83k|      posPage = startPos;
  467|  1.83k|      implicitPage = true;
  468|       |#ifdef DEBUG
  469|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page at position: " << startPos << "\n";
  470|       |#endif
  471|  1.83k|    }
  472|   314k|    if (posBeginPageSetup == posEndEps &&
  ------------------
  |  Branch (472:9): [True: 68.2k, False: 245k]
  ------------------
  473|  68.2k|        (implicitPage || (posPage != posEndEps && !inRemovableEmbedding && !line.empty() && line.front() != '%'))) {
  ------------------
  |  Branch (473:10): [True: 1.82k, False: 66.4k]
  |  Branch (473:27): [True: 2.34k, False: 64.0k]
  |  Branch (473:51): [True: 1.99k, False: 351]
  |  Branch (473:76): [True: 1.46k, False: 531]
  |  Branch (473:93): [True: 55, False: 1.40k]
  ------------------
  474|  1.88k|      posBeginPageSetup = startPos;
  475|  1.88k|      implicitPageSetup = true;
  476|       |#ifdef DEBUG
  477|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  478|       |#endif
  479|  1.88k|    }
  480|   314k|    if (posEndPageSetup == posEndEps && implicitPageSetup && !inRemovableEmbedding && !line.empty() &&
  ------------------
  |  Branch (480:9): [True: 82.0k, False: 232k]
  |  Branch (480:41): [True: 12.0k, False: 69.9k]
  |  Branch (480:62): [True: 5.60k, False: 6.47k]
  |  Branch (480:87): [True: 4.51k, False: 1.08k]
  ------------------
  481|  4.51k|        line.front() != '%') {
  ------------------
  |  Branch (481:9): [True: 1.58k, False: 2.92k]
  ------------------
  482|  1.58k|      posEndPageSetup = startPos;
  483|       |#ifdef DEBUG
  484|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  485|       |#endif
  486|  1.58k|    }
  487|   314k|    if (!line.empty() && line.front() != '%')
  ------------------
  |  Branch (487:9): [True: 272k, False: 41.5k]
  |  Branch (487:26): [True: 184k, False: 88.1k]
  ------------------
  488|   184k|      continue;  // performance optimization
  489|   129k|    if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
  ------------------
  |  Branch (489:9): [True: 15, False: 129k]
  |  Branch (489:28): [True: 346, False: 129k]
  |  Branch (489:51): [True: 225, False: 129k]
  ------------------
  490|    586|      if (posBeginPageSetup == posEndEps) {
  ------------------
  |  Branch (490:11): [True: 17, False: 569]
  ------------------
  491|     17|        posBeginPageSetup = startPos;
  492|     17|        implicitPageSetup = true;
  493|       |#ifdef DEBUG
  494|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  495|       |#endif
  496|     17|      }
  497|    586|      if (posEndPageSetup == posEndEps) {
  ------------------
  |  Branch (497:11): [True: 34, False: 552]
  ------------------
  498|     34|        posEndPageSetup = startPos;
  499|     34|        implicitPageSetup = true;
  500|       |#ifdef DEBUG
  501|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  502|       |#endif
  503|     34|      }
  504|    586|    }
  505|   129k|    if ((line == "%%EOF" || line == "%%Trailer") && posPageTrailer == posEndEps) {
  ------------------
  |  Branch (505:10): [True: 15, False: 129k]
  |  Branch (505:29): [True: 346, False: 129k]
  |  Branch (505:53): [True: 66, False: 295]
  ------------------
  506|     66|      posPageTrailer = startPos;
  507|     66|      implicitPageTrailer = true;
  508|       |#ifdef DEBUG
  509|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit PageTrailer at position: " << startPos << "\n";
  510|       |#endif
  511|     66|    }
  512|       |    // remaining explicit comments
  513|   129k|    if (posEndComments == posEndEps && posLanguageLevel == posEndEps && line.starts_with("%%LanguageLevel:")) {
  ------------------
  |  Branch (513:9): [True: 15.3k, False: 114k]
  |  Branch (513:40): [True: 14.5k, False: 775]
  |  Branch (513:73): [True: 36, False: 14.5k]
  ------------------
  514|     36|      posLanguageLevel = startPos;
  515|   129k|    } else if (posEndComments == posEndEps && posContainsXmp == posEndEps && line.starts_with("%ADO_ContainsXMP:")) {
  ------------------
  |  Branch (515:16): [True: 15.3k, False: 114k]
  |  Branch (515:47): [True: 14.2k, False: 1.08k]
  |  Branch (515:78): [True: 804, False: 13.4k]
  ------------------
  516|    804|      posContainsXmp = startPos;
  517|   128k|    } else if (posEndComments == posEndEps && posPages == posEndEps && line.starts_with("%%Pages:")) {
  ------------------
  |  Branch (517:16): [True: 14.5k, False: 114k]
  |  Branch (517:47): [True: 13.6k, False: 881]
  |  Branch (517:72): [True: 40, False: 13.5k]
  ------------------
  518|     40|      posPages = startPos;
  519|   128k|    } else if (posEndComments == posEndEps && posExiv2Version == posEndEps && line.starts_with("%Exiv2Version:")) {
  ------------------
  |  Branch (519:16): [True: 14.4k, False: 114k]
  |  Branch (519:47): [True: 13.9k, False: 493]
  |  Branch (519:79): [True: 29, False: 13.9k]
  ------------------
  520|     29|      posExiv2Version = startPos;
  521|   128k|    } else if (posEndComments == posEndEps && posExiv2Website == posEndEps && line.starts_with("%Exiv2Website:")) {
  ------------------
  |  Branch (521:16): [True: 14.4k, False: 114k]
  |  Branch (521:47): [True: 14.2k, False: 209]
  |  Branch (521:79): [True: 21, False: 14.2k]
  ------------------
  522|     21|      posExiv2Website = startPos;
  523|   128k|    } else if (posEndComments == posEndEps && line.starts_with("%%Creator: Adobe Illustrator") &&
  ------------------
  |  Branch (523:16): [True: 14.4k, False: 114k]
  |  Branch (523:47): [True: 574, False: 13.8k]
  ------------------
  524|    574|               firstLine == "%!PS-Adobe-3.0 EPSF-3.0") {
  ------------------
  |  Branch (524:16): [True: 299, False: 275]
  ------------------
  525|    299|      illustrator8 = true;
  526|   128k|    } else if (posEndComments == posEndEps && line.starts_with("%AI7_Thumbnail:")) {
  ------------------
  |  Branch (526:16): [True: 14.1k, False: 114k]
  |  Branch (526:47): [True: 738, False: 13.3k]
  ------------------
  527|    738|      posAi7Thumbnail = startPos;
  528|   127k|    } else if (posEndComments == posEndEps && posAi7Thumbnail != posEndEps && posAi7ThumbnailEndData == posEndEps &&
  ------------------
  |  Branch (528:16): [True: 13.3k, False: 114k]
  |  Branch (528:47): [True: 2.45k, False: 10.9k]
  |  Branch (528:79): [True: 1.56k, False: 896]
  ------------------
  529|  1.56k|               line == "%%EndData") {
  ------------------
  |  Branch (529:16): [True: 225, False: 1.33k]
  ------------------
  530|    225|      posAi7ThumbnailEndData = startPos;
  531|   127k|    } else if (posEndComments == posEndEps && line == "%%EndComments") {
  ------------------
  |  Branch (531:16): [True: 13.1k, False: 114k]
  |  Branch (531:47): [True: 10, False: 13.1k]
  ------------------
  532|     10|      posEndComments = startPos;
  533|   127k|    } else if (inDefaultsPreviewPrologSetup && line.starts_with("%%BeginResource: procset wCorel")) {
  ------------------
  |  Branch (533:16): [True: 47.5k, False: 79.8k]
  |  Branch (533:48): [True: 720, False: 46.8k]
  ------------------
  534|    720|      corelDraw = true;
  535|   126k|    } else if (line == "%%EndPreview") {
  ------------------
  |  Branch (535:16): [True: 241, False: 126k]
  ------------------
  536|    241|      inDefaultsPreviewPrologSetup = false;
  537|   126k|    } else if (line == "%%EndDefaults") {
  ------------------
  |  Branch (537:16): [True: 461, False: 125k]
  ------------------
  538|    461|      inDefaultsPreviewPrologSetup = false;
  539|   125k|    } else if (line == "%%EndProlog") {
  ------------------
  |  Branch (539:16): [True: 320, False: 125k]
  ------------------
  540|    320|      inDefaultsPreviewPrologSetup = false;
  541|   125k|    } else if (line == "%%EndSetup") {
  ------------------
  |  Branch (541:16): [True: 203, False: 125k]
  ------------------
  542|    203|      inDefaultsPreviewPrologSetup = false;
  543|   125k|    } else if (posEndPageSetup == posEndEps && line == "%%EndPageSetup") {
  ------------------
  |  Branch (543:16): [True: 58.0k, False: 67.4k]
  |  Branch (543:48): [True: 14, False: 58.0k]
  ------------------
  544|     14|      posEndPageSetup = startPos;
  545|   125k|    } else if (posPageTrailer == posEndEps && line == "%%PageTrailer") {
  ------------------
  |  Branch (545:16): [True: 111k, False: 13.8k]
  |  Branch (545:47): [True: 21, False: 111k]
  ------------------
  546|     21|      posPageTrailer = startPos;
  547|   125k|    } else if (posBeginPhotoshop == posEndEps && line.starts_with("%BeginPhotoshop:")) {
  ------------------
  |  Branch (547:16): [True: 111k, False: 14.1k]
  |  Branch (547:50): [True: 142, False: 111k]
  ------------------
  548|    142|      posBeginPhotoshop = pos;
  549|   125k|    } else if (posBeginPhotoshop != posEndEps && posEndPhotoshop == posEndEps && line == "%EndPhotoshop") {
  ------------------
  |  Branch (549:16): [True: 14.1k, False: 111k]
  |  Branch (549:50): [True: 13.2k, False: 880]
  |  Branch (549:82): [True: 73, False: 13.1k]
  ------------------
  550|     73|      posEndPhotoshop = startPos;
  551|   125k|    } else if (inRemovableEmbedding && line == removableEmbeddingEndLine) {
  ------------------
  |  Branch (551:16): [True: 60.8k, False: 64.3k]
  |  Branch (551:40): [True: 6.61k, False: 54.2k]
  ------------------
  552|  6.61k|      inRemovableEmbedding = false;
  553|  6.61k|      removableEmbeddings.back().second = pos;
  554|   118k|    } else if (line == "%%EOF") {
  ------------------
  |  Branch (554:16): [True: 15, False: 118k]
  ------------------
  555|     15|      posEof = startPos;
  556|   118k|    } else {
  557|       |#ifdef DEBUG
  558|       |      significantLine = false;
  559|       |#endif
  560|   118k|    }
  561|       |#ifdef DEBUG
  562|       |    if (significantLine) {
  563|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  564|       |    }
  565|       |#endif
  566|   129k|  }
  567|       |
  568|       |  // check for unfinished nested documents
  569|  3.40k|  if (depth != 0) {
  ------------------
  |  Branch (569:7): [True: 35, False: 3.36k]
  ------------------
  570|     35|#ifndef SUPPRESS_WARNINGS
  571|     35|    EXV_WARNING << "Unmatched BeginDocument (" << depth << "x)\n";
  ------------------
  |  |  138|     35|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 35]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     35|  LogMsg(LogMsg::warn).os()
  ------------------
  572|     35|#endif
  573|     35|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (573:17): [True: 0, False: 35]
  ------------------
  574|     35|  }
  575|       |
  576|       |  // look for the unmarked trailers of some removable XMP embeddings
  577|  3.36k|  size_t posXmpTrailerEnd = posEof;
  578|  3.48k|  for (size_t i = 0; i < removableEmbeddingsWithUnmarkedTrailer; i++) {
  ------------------
  |  Branch (578:22): [True: 496, False: 2.99k]
  ------------------
  579|    496|    std::string line1;
  580|    496|    const size_t posLine1 = readPrevLine(line1, data, posXmpTrailerEnd, posEndEps);
  581|    496|    std::string line2;
  582|    496|    const size_t posLine2 = readPrevLine(line2, data, posLine1, posEndEps);
  583|    496|    size_t posXmpTrailer;
  584|    496|    if (line1 == "[/EMC pdfmark") {  // Exiftool style
  ------------------
  |  Branch (584:9): [True: 120, False: 376]
  ------------------
  585|    120|      posXmpTrailer = posLine1;
  586|    376|    } else if (line1 == "[/NamespacePop pdfmark" &&
  ------------------
  |  Branch (586:16): [True: 32, False: 344]
  ------------------
  587|     32|               line2 ==
  ------------------
  |  Branch (587:16): [True: 1, False: 31]
  ------------------
  588|     32|                   "[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT "
  589|     32|                   "pdfmark") {  // Photoshop style
  590|      1|      posXmpTrailer = posLine2;
  591|    375|    } else {
  592|    375|#ifndef SUPPRESS_WARNINGS
  593|    375|      EXV_WARNING << "Unable to find XMP embedding trailer ending at position: " << posXmpTrailerEnd << "\n";
  ------------------
  |  |  138|    375|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 375]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    375|  LogMsg(LogMsg::warn).os()
  ------------------
  594|    375|#endif
  595|    375|      if (write)
  ------------------
  |  Branch (595:11): [True: 0, False: 375]
  ------------------
  596|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  597|    375|      break;
  598|    375|    }
  599|    121|    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|    121|    posXmpTrailerEnd = posXmpTrailer;
  606|    121|  }
  607|       |
  608|       |  // interpret comment "%ADO_ContainsXMP:"
  609|  3.36k|  std::string line;
  610|  3.36k|  readLine(line, data, posContainsXmp, posEndEps);
  611|  3.36k|  bool containsXmp;
  612|  3.36k|  if (line == "%ADO_ContainsXMP: MainFirst" || line == "%ADO_ContainsXMP:MainFirst") {
  ------------------
  |  Branch (612:7): [True: 483, False: 2.88k]
  |  Branch (612:48): [True: 608, False: 2.27k]
  ------------------
  613|    618|    containsXmp = true;
  614|  2.74k|  } else if (line.empty() || line == "%ADO_ContainsXMP: NoMain" || line == "%ADO_ContainsXMP:NoMain") {
  ------------------
  |  Branch (614:14): [True: 2.57k, False: 179]
  |  Branch (614:30): [True: 10, False: 169]
  |  Branch (614:68): [True: 11, False: 158]
  ------------------
  615|  2.11k|    containsXmp = false;
  616|  2.11k|  } else {
  617|    631|#ifndef SUPPRESS_WARNINGS
  618|    631|    EXV_WARNING << "Invalid line \"" << line << "\" at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|    631|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 631]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    631|  LogMsg(LogMsg::warn).os()
  ------------------
  619|    631|#endif
  620|    631|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (620:17): [True: 0, False: 631]
  ------------------
  621|    631|  }
  622|       |
  623|  2.73k|  const bool deleteXmp = (write && xmpPacket.empty());
  ------------------
  |  Branch (623:27): [True: 0, False: 2.73k]
  |  Branch (623:36): [True: 0, False: 0]
  ------------------
  624|  2.73k|  bool fixBeginXmlPacket = false;
  625|  2.73k|  bool useFlexibleEmbedding = false;
  626|  2.73k|  size_t xmpPos = posEndEps;
  627|  2.73k|  size_t xmpSize = 0;
  628|  2.73k|  if (containsXmp) {
  ------------------
  |  Branch (628:7): [True: 618, False: 2.11k]
  ------------------
  629|       |    // search for XMP metadata
  630|    618|    findXmp(xmpPos, xmpSize, data, posEps, posEndEps, write);
  631|    618|    if (xmpPos == posEndEps) {
  ------------------
  |  Branch (631:9): [True: 28, False: 590]
  ------------------
  632|     28|#ifndef SUPPRESS_WARNINGS
  633|     28|      EXV_WARNING << "Unable to find XMP metadata as announced at position: " << posContainsXmp << "\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()
  ------------------
  634|     28|#endif
  635|     28|    }
  636|       |    // check embedding of XMP metadata
  637|    618|    const size_t posLineAfterXmp = readLine(line, data, xmpPos + xmpSize, posEndEps);
  638|    618|    if (!line.empty()) {
  ------------------
  |  Branch (638:9): [True: 459, False: 159]
  ------------------
  639|    459|#ifndef SUPPRESS_WARNINGS
  640|    459|      EXV_WARNING << "Unexpected " << line.size() << " bytes of data after XMP at position: " << (xmpPos + xmpSize)
  ------------------
  |  |  138|    459|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 459]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    459|  LogMsg(LogMsg::warn).os()
  ------------------
  641|      0|                  << "\n";
  642|    459|#endif
  643|    459|    } else if (!deleteXmp) {
  ------------------
  |  Branch (643:16): [True: 129, False: 30]
  ------------------
  644|    129|      readLine(line, data, posLineAfterXmp, posEndEps);
  645|    129|      if (line == "% &&end XMP packet marker&&" || line == "%  &&end XMP packet marker&&") {
  ------------------
  |  Branch (645:11): [True: 13, False: 116]
  |  Branch (645:52): [True: 11, False: 105]
  ------------------
  646|     24|        useFlexibleEmbedding = true;
  647|     24|      }
  648|    129|    }
  649|    618|  }
  650|  2.73k|  if (useFlexibleEmbedding) {
  ------------------
  |  Branch (650:7): [True: 24, False: 2.71k]
  ------------------
  651|       |#ifdef DEBUG
  652|       |    EXV_DEBUG << "readWriteEpsMetadata: Using flexible XMP embedding\n";
  653|       |#endif
  654|     24|    const size_t posBeginXmlPacket = readPrevLine(line, data, xmpPos, posEndEps);
  655|     24|    if (line.starts_with("%begin_xml_packet:")) {
  ------------------
  |  Branch (655:9): [True: 6, False: 18]
  ------------------
  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|     18|    } else if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (664:16): [True: 6, False: 12]
  ------------------
  665|      6|#ifndef SUPPRESS_WARNINGS
  666|      6|      EXV_WARNING << "Missing %begin_xml_packet in Photoshop EPS at position: " << xmpPos << "\n";
  ------------------
  |  |  138|      6|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      6|  LogMsg(LogMsg::warn).os()
  ------------------
  667|      6|#endif
  668|      6|      if (write)
  ------------------
  |  Branch (668:11): [True: 0, False: 6]
  ------------------
  669|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  670|      6|    }
  671|     24|  }
  672|  2.73k|  if (!useFlexibleEmbedding) {
  ------------------
  |  Branch (672:7): [True: 2.68k, False: 54]
  ------------------
  673|       |    // check if there are irremovable XMP metadata blocks before EndPageSetup
  674|  2.68k|    size_t posOtherXmp = containsXmp ? xmpPos : posEps;
  ------------------
  |  Branch (674:26): [True: 564, False: 2.11k]
  ------------------
  675|  2.68k|    size_t sizeOtherXmp = 0;
  676|  7.02k|    for (;;) {
  677|  7.02k|      findXmp(posOtherXmp, sizeOtherXmp, data, posOtherXmp + sizeOtherXmp, posEndPageSetup, write);
  678|  7.02k|      if (posOtherXmp >= posEndPageSetup)
  ------------------
  |  Branch (678:11): [True: 2.42k, False: 4.60k]
  ------------------
  679|  2.42k|        break;
  680|  4.60k|      bool isRemovableEmbedding = false;
  681|  13.2k|      for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (681:31): [True: 13.2k, False: 261]
  ------------------
  682|  13.2k|        if (r <= posOtherXmp && posOtherXmp < s) {
  ------------------
  |  Branch (682:13): [True: 11.1k, False: 2.09k]
  |  Branch (682:33): [True: 4.34k, False: 6.79k]
  ------------------
  683|  4.34k|          isRemovableEmbedding = true;
  684|  4.34k|          break;
  685|  4.34k|        }
  686|  13.2k|      }
  687|  4.60k|      if (!isRemovableEmbedding) {
  ------------------
  |  Branch (687:11): [True: 82, False: 4.51k]
  ------------------
  688|     82|#ifndef SUPPRESS_WARNINGS
  689|     82|        EXV_WARNING << "XMP metadata block is not removable at position: " << posOtherXmp << "\n";
  ------------------
  |  |  138|     82|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 82]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     82|  LogMsg(LogMsg::warn).os()
  ------------------
  690|     82|#endif
  691|     82|        if (write)
  ------------------
  |  Branch (691:13): [True: 0, False: 82]
  ------------------
  692|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  693|     82|        break;
  694|     82|      }
  695|  4.60k|    }
  696|  2.68k|  }
  697|       |
  698|  2.73k|  if (!write) {
  ------------------
  |  Branch (698:7): [True: 2.52k, False: 209]
  ------------------
  699|       |    // copy XMP metadata
  700|  2.52k|    xmpPacket.assign(reinterpret_cast<const char*>(data + xmpPos), xmpSize);
  701|       |
  702|       |    // native previews
  703|  2.52k|    nativePreviews.clear();
  704|  2.52k|    if (posAi7ThumbnailEndData != posEndEps) {
  ------------------
  |  Branch (704:9): [True: 224, False: 2.30k]
  ------------------
  705|    224|      NativePreview nativePreview;
  706|    224|      std::string dummy;
  707|    224|      std::string lineAi7Thumbnail;
  708|    224|      const size_t posBeginData = readLine(lineAi7Thumbnail, data, posAi7Thumbnail, posEndEps);
  709|    224|      std::istringstream lineStreamAi7Thumbnail(lineAi7Thumbnail);
  710|    224|      lineStreamAi7Thumbnail >> dummy;
  711|    224|      lineStreamAi7Thumbnail >> nativePreview.width_;
  712|    224|      lineStreamAi7Thumbnail >> nativePreview.height_;
  713|    224|      std::string depthStr;
  714|    224|      lineStreamAi7Thumbnail >> depthStr;
  715|    224|      std::string lineBeginData;
  716|    224|      const size_t posAfterBeginData = readLine(lineBeginData, data, posBeginData, posEndEps);
  717|    224|      std::istringstream lineStreamBeginData(lineBeginData);
  718|    224|      std::string beginData;
  719|    224|      lineStreamBeginData >> beginData;
  720|    224|      lineStreamBeginData >> dummy;
  721|    224|      std::string type;
  722|    224|      lineStreamBeginData >> type;
  723|    224|      nativePreview.position_ = static_cast<long>(posAfterBeginData);
  724|    224|      nativePreview.size_ = static_cast<uint32_t>(posAi7ThumbnailEndData - posAfterBeginData);
  725|    224|      nativePreview.filter_ = "hex-ai7thumbnail-pnm";
  726|    224|      nativePreview.mimeType_ = "image/x-portable-anymap";
  727|    224|      if (depthStr != "8") {
  ------------------
  |  Branch (727:11): [True: 162, False: 62]
  ------------------
  728|    162|#ifndef SUPPRESS_WARNINGS
  729|    162|        EXV_WARNING << "Unable to handle Illustrator thumbnail depth: " << depthStr << "\n";
  ------------------
  |  |  138|    162|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 162]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    162|  LogMsg(LogMsg::warn).os()
  ------------------
  730|    162|#endif
  731|    162|      } else if (beginData != "%%BeginData:") {
  ------------------
  |  Branch (731:18): [True: 30, False: 32]
  ------------------
  732|     30|#ifndef SUPPRESS_WARNINGS
  733|     30|        EXV_WARNING << "Unable to handle Illustrator thumbnail data section: " << lineBeginData << "\n";
  ------------------
  |  |  138|     30|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 30]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     30|  LogMsg(LogMsg::warn).os()
  ------------------
  734|     30|#endif
  735|     32|      } else if (type != "Hex") {
  ------------------
  |  Branch (735:18): [True: 30, False: 2]
  ------------------
  736|     30|#ifndef SUPPRESS_WARNINGS
  737|     30|        EXV_WARNING << "Unable to handle Illustrator thumbnail data type: " << type << "\n";
  ------------------
  |  |  138|     30|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 30]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     30|  LogMsg(LogMsg::warn).os()
  ------------------
  738|     30|#endif
  739|     30|      } else {
  740|      2|        nativePreviews.push_back(std::move(nativePreview));
  741|      2|      }
  742|    224|    }
  743|  2.52k|    if (posEndPhotoshop != posEndEps) {
  ------------------
  |  Branch (743:9): [True: 72, False: 2.45k]
  ------------------
  744|     72|      auto sizePhotoshop = posEndPhotoshop - posBeginPhotoshop;
  745|     72|      NativePreview nativePreview{posBeginPhotoshop, sizePhotoshop, 0, 0, "hex-irb", "image/jpeg"};
  746|     72|      nativePreviews.push_back(std::move(nativePreview));
  747|     72|    }
  748|  2.52k|    if (sizeWmf != 0) {
  ------------------
  |  Branch (748:9): [True: 12, False: 2.51k]
  ------------------
  749|     12|      NativePreview nativePreview{posWmf, sizeWmf, 0, 0, "", "image/x-wmf"};
  750|     12|      nativePreviews.push_back(std::move(nativePreview));
  751|     12|    }
  752|  2.52k|    if (sizeTiff != 0) {
  ------------------
  |  Branch (752:9): [True: 11, False: 2.51k]
  ------------------
  753|     11|      NativePreview nativePreview{posTiff, sizeTiff, 0, 0, "", "image/tiff"};
  754|     11|      nativePreviews.push_back(std::move(nativePreview));
  755|     11|    }
  756|  2.52k|  } else {
  757|       |    // check for Adobe Illustrator 8.0 or older
  758|    209|    if (illustrator8) {
  ------------------
  |  Branch (758:9): [True: 0, False: 209]
  ------------------
  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|    209|    MemIo tempIo;
  767|    209|    if (!tempIo.isopen()) {
  ------------------
  |  Branch (767:9): [True: 0, False: 209]
  ------------------
  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|    209|    std::vector<size_t> positions;
  779|    209|    positions.push_back(posLanguageLevel);
  780|    209|    positions.push_back(posContainsXmp);
  781|    209|    positions.push_back(posPages);
  782|    209|    positions.push_back(posExiv2Version);
  783|    209|    positions.push_back(posExiv2Website);
  784|    209|    positions.push_back(posEndComments);
  785|    209|    positions.push_back(posPage);
  786|    209|    positions.push_back(posBeginPageSetup);
  787|    209|    positions.push_back(posEndPageSetup);
  788|    209|    positions.push_back(posPageTrailer);
  789|    209|    positions.push_back(posEof);
  790|    209|    positions.push_back(posEndEps);
  791|    209|    if (useFlexibleEmbedding) {
  ------------------
  |  Branch (791:9): [True: 0, False: 209]
  ------------------
  792|      0|      positions.push_back(xmpPos);
  793|      0|    }
  794|    209|    for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (794:29): [True: 0, False: 209]
  ------------------
  795|      0|      positions.push_back(r);
  796|      0|    }
  797|    209|    std::sort(positions.begin(), positions.end());
  798|       |
  799|       |    // assemble result EPS document
  800|    209|    if (dosEps) {
  ------------------
  |  Branch (800:9): [True: 0, False: 209]
  ------------------
  801|       |      // DOS EPS header will be written afterwards
  802|      0|      writeTemp(tempIo, std::string(30, '\x00'));
  803|      0|    }
  804|    209|    const std::string containsXmpLine = deleteXmp ? "%ADO_ContainsXMP: NoMain" : "%ADO_ContainsXMP: MainFirst";
  ------------------
  |  Branch (804:41): [True: 0, False: 209]
  ------------------
  805|    209|    const uint32_t posEpsNew = posTemp(tempIo);
  806|    209|    size_t prevPos = posEps;
  807|    209|    size_t prevSkipPos = prevPos;
  808|    209|    for (const auto& pos : positions) {
  ------------------
  |  Branch (808:26): [True: 0, False: 209]
  ------------------
  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|    209|    const uint32_t posEndEpsNew = posTemp(tempIo);
  986|       |#ifdef DEBUG
  987|       |    EXV_DEBUG << "readWriteEpsMetadata: New EPS size: " << (posEndEpsNew - posEpsNew) << "\n";
  988|       |#endif
  989|    209|    if (dosEps) {
  ------------------
  |  Branch (989:9): [True: 0, False: 209]
  ------------------
  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|    209|    io.close();
 1017|    209|    io.transfer(tempIo);
 1018|    209|  }
 1019|  2.73k|}
epsimage.cpp:_ZN12_GLOBAL__N_18readLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  117|   410k|size_t readLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  118|   410k|  line.clear();
  119|   410k|  size_t pos = startPos;
  120|       |  // step through line
  121|   106M|  while (pos < size && data[pos] != '\r' && data[pos] != '\n') {
  ------------------
  |  Branch (121:10): [True: 106M, False: 5.20k]
  |  Branch (121:24): [True: 106M, False: 101k]
  |  Branch (121:45): [True: 106M, False: 303k]
  ------------------
  122|   106M|    line += data[pos];
  123|   106M|    pos++;
  124|   106M|  }
  125|       |  // skip line ending, if present
  126|   410k|  if (pos >= size)
  ------------------
  |  Branch (126:7): [True: 5.20k, False: 405k]
  ------------------
  127|  5.20k|    return pos;
  128|   405k|  pos++;
  129|   405k|  if (pos >= size)
  ------------------
  |  Branch (129:7): [True: 453, False: 404k]
  ------------------
  130|    453|    return pos;
  131|   404k|  if (data[pos - 1] == '\r' && data[pos] == '\n')
  ------------------
  |  Branch (131:7): [True: 101k, False: 303k]
  |  Branch (131:32): [True: 7.92k, False: 93.8k]
  ------------------
  132|  7.92k|    pos++;
  133|   404k|  return pos;
  134|   405k|}
epsimage.cpp:_ZN12_GLOBAL__N_115onlyWhitespacesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  110|  3.43k|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.43k|  return s.find_first_not_of(" \t") == std::string::npos;
  114|  3.43k|}
epsimage.cpp:_ZN12_GLOBAL__N_112readPrevLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  137|  1.01k|size_t readPrevLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  138|  1.01k|  line.clear();
  139|  1.01k|  size_t pos = startPos;
  140|  1.01k|  if (pos > size)
  ------------------
  |  Branch (140:7): [True: 0, False: 1.01k]
  ------------------
  141|      0|    return pos;
  142|       |  // skip line ending of previous line, if present
  143|  1.01k|  if (pos <= 0)
  ------------------
  |  Branch (143:7): [True: 0, False: 1.01k]
  ------------------
  144|      0|    return pos;
  145|  1.01k|  if (data[pos - 1] == '\r' || data[pos - 1] == '\n') {
  ------------------
  |  Branch (145:7): [True: 502, False: 514]
  |  Branch (145:32): [True: 191, False: 323]
  ------------------
  146|    693|    pos--;
  147|    693|    if (pos <= 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 693]
  ------------------
  148|      0|      return pos;
  149|    693|    if (data[pos - 1] == '\r' && data[pos] == '\n') {
  ------------------
  |  Branch (149:9): [True: 135, False: 558]
  |  Branch (149:34): [True: 31, False: 104]
  ------------------
  150|     31|      pos--;
  151|     31|      if (pos <= 0)
  ------------------
  |  Branch (151:11): [True: 0, False: 31]
  ------------------
  152|      0|        return pos;
  153|     31|    }
  154|    693|  }
  155|       |  // step through previous line
  156|  8.01M|  while (pos >= 1 && data[pos - 1] != '\r' && data[pos - 1] != '\n') {
  ------------------
  |  Branch (156:10): [True: 8.01M, False: 8]
  |  Branch (156:22): [True: 8.00M, False: 685]
  |  Branch (156:47): [True: 8.00M, False: 323]
  ------------------
  157|  8.00M|    pos--;
  158|  8.00M|    line += data[pos];
  159|  8.00M|  }
  160|  1.01k|  std::reverse(line.begin(), line.end());
  161|  1.01k|  return pos;
  162|  1.01k|}
epsimage.cpp:_ZN12_GLOBAL__N_17findXmpERmS0_PKhmmb:
  165|  7.64k|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|  7.64k|  xmpSize = 0;
  168|  20.7M|  for (xmpPos = startPos; xmpPos < size; xmpPos++) {
  ------------------
  |  Branch (168:27): [True: 20.7M, False: 2.44k]
  ------------------
  169|  20.7M|    if (data[xmpPos] != '\x00' && data[xmpPos] != '<')
  ------------------
  |  Branch (169:9): [True: 17.0M, False: 3.71M]
  |  Branch (169:35): [True: 16.9M, False: 25.6k]
  ------------------
  170|  16.9M|      continue;
  171|  29.9M|    for (auto&& header : xmpHeaders) {
  ------------------
  |  Branch (171:24): [True: 29.9M, False: 3.73M]
  ------------------
  172|  29.9M|      if (xmpPos + header.size() > size)
  ------------------
  |  Branch (172:11): [True: 51.4k, False: 29.8M]
  ------------------
  173|  51.4k|        continue;
  174|  29.8M|      if (memcmp(data + xmpPos, header.data(), header.size()) != 0)
  ------------------
  |  Branch (174:11): [True: 29.8M, False: 5.19k]
  ------------------
  175|  29.8M|        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|  33.3M|      for (size_t trailerPos = xmpPos + header.size(); trailerPos < size; trailerPos++) {
  ------------------
  |  Branch (181:56): [True: 33.3M, False: 128]
  ------------------
  182|  33.3M|        if (data[trailerPos] != '\x00' && data[trailerPos] != '<')
  ------------------
  |  Branch (182:13): [True: 33.1M, False: 149k]
  |  Branch (182:43): [True: 33.1M, False: 68.1k]
  ------------------
  183|  33.1M|          continue;
  184|   870k|        for (const auto& [trailer, readOnly] : xmpTrailers) {
  ------------------
  |  Branch (184:46): [True: 870k, False: 212k]
  ------------------
  185|   870k|          if (trailerPos + trailer.size() > size)
  ------------------
  |  Branch (185:15): [True: 1.27k, False: 868k]
  ------------------
  186|  1.27k|            continue;
  187|   868k|          if (memcmp(data + trailerPos, trailer.data(), trailer.size()) != 0)
  ------------------
  |  Branch (187:15): [True: 863k, False: 5.06k]
  ------------------
  188|   863k|            continue;
  189|       |#ifdef DEBUG
  190|       |          EXV_DEBUG << "findXmp: Found XMP trailer at position: " << trailerPos << "\n";
  191|       |#endif
  192|       |
  193|  5.06k|          if (readOnly) {
  ------------------
  |  Branch (193:15): [True: 25, False: 5.03k]
  ------------------
  194|     25|#ifndef SUPPRESS_WARNINGS
  195|     25|            EXV_WARNING << "Unable to handle read-only XMP metadata yet. Please provide your "
  ------------------
  |  |  138|     25|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 25]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     25|  LogMsg(LogMsg::warn).os()
  ------------------
  196|      0|                           "sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2\n";
  197|     25|#endif
  198|     25|            throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (198:25): [True: 0, False: 25]
  ------------------
  199|     25|          }
  200|       |
  201|       |          // search for end of XMP trailer
  202|  1.11M|          for (size_t trailerEndPos = trailerPos + trailer.size(); trailerEndPos + xmpTrailerEnd.size() <= size;
  ------------------
  |  Branch (202:68): [True: 1.11M, False: 56]
  ------------------
  203|  1.11M|               trailerEndPos++) {
  204|  1.11M|            if (memcmp(data + trailerEndPos, xmpTrailerEnd.data(), xmpTrailerEnd.size()) == 0) {
  ------------------
  |  Branch (204:17): [True: 4.98k, False: 1.11M]
  ------------------
  205|  4.98k|              xmpSize = (trailerEndPos + xmpTrailerEnd.size()) - xmpPos;
  206|  4.98k|              return;
  207|  4.98k|            }
  208|  1.11M|          }
  209|     56|#ifndef SUPPRESS_WARNINGS
  210|     56|          EXV_WARNING << "Found XMP header but incomplete XMP trailer.\n";
  ------------------
  |  |  138|     56|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 56]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     56|  LogMsg(LogMsg::warn).os()
  ------------------
  211|     56|#endif
  212|     56|          throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (212:23): [True: 0, False: 56]
  ------------------
  213|  5.03k|        }
  214|   217k|      }
  215|    128|#ifndef SUPPRESS_WARNINGS
  216|    128|      EXV_WARNING << "Found XMP header but no XMP trailer.\n";
  ------------------
  |  |  138|    128|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 128]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    128|  LogMsg(LogMsg::warn).os()
  ------------------
  217|    128|#endif
  218|    128|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (218:19): [True: 0, False: 128]
  ------------------
  219|  5.19k|    }
  220|  3.74M|  }
  221|  7.64k|}

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

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

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

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

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

_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  140|  36.4k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  141|  36.4k|}
_ZN5Exiv25ImageD2Ev:
  143|  36.4k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  181|    384|bool Image::isBigEndianPlatform() {
  182|    384|  return std::endian::native == std::endian::big;
  183|    384|}
_ZN5Exiv25Image8byteSwapEjb:
  205|  1.13k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  206|       |#ifdef __cpp_lib_byteswap
  207|       |  return bSwap ? std::byteswap(value) : value;
  208|       |#elif defined(_MSC_VER)
  209|       |  return bSwap ? _byteswap_ulong(value) : value;
  210|       |#else
  211|  1.13k|  uint32_t result = 0;
  212|  1.13k|  result |= (value & 0x000000FFU) << 24;
  213|  1.13k|  result |= (value & 0x0000FF00U) << 8;
  214|  1.13k|  result |= (value & 0x00FF0000U) >> 8;
  215|  1.13k|  result |= (value & 0xFF000000U) >> 24;
  216|  1.13k|  return bSwap ? result : value;
  ------------------
  |  Branch (216:10): [True: 0, False: 1.13k]
  ------------------
  217|  1.13k|#endif
  218|  1.13k|}
_ZN5Exiv25Image13clearMetadataEv:
  537|  31.2k|void Image::clearMetadata() {
  538|  31.2k|  clearExifData();
  539|  31.2k|  clearIptcData();
  540|  31.2k|  clearXmpPacket();
  541|  31.2k|  clearXmpData();
  542|  31.2k|  clearComment();
  543|  31.2k|  clearIccProfile();
  544|  31.2k|}
_ZN5Exiv25Image8exifDataEv:
  546|  5.48k|ExifData& Image::exifData() {
  547|  5.48k|  return exifData_;
  548|  5.48k|}
_ZN5Exiv25Image8iptcDataEv:
  550|  2.71k|IptcData& Image::iptcData() {
  551|  2.71k|  return iptcData_;
  552|  2.71k|}
_ZN5Exiv25Image7xmpDataEv:
  554|  11.3k|XmpData& Image::xmpData() {
  555|  11.3k|  return xmpData_;
  556|  11.3k|}
_ZN5Exiv25Image9xmpPacketEv:
  558|  2.57k|std::string& Image::xmpPacket() {
  559|       |  // Serialize the current XMP
  560|  2.57k|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (560:7): [True: 0, False: 2.57k]
  |  Branch (560:28): [True: 0, False: 0]
  ------------------
  561|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  562|      0|  }
  563|  2.57k|  return xmpPacket_;
  564|  2.57k|}
_ZN5Exiv25Image13clearExifDataEv:
  586|  31.2k|void Image::clearExifData() {
  587|  31.2k|  exifData_.clear();
  588|  31.2k|}
_ZN5Exiv25Image13clearIptcDataEv:
  594|  31.2k|void Image::clearIptcData() {
  595|  31.2k|  iptcData_.clear();
  596|  31.2k|}
_ZN5Exiv25Image14clearXmpPacketEv:
  602|  31.2k|void Image::clearXmpPacket() {
  603|  31.2k|  xmpPacket_.clear();
  604|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  605|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  606|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  607|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  608|  31.2k|  xmpData_.setPacket(std::string());
  609|  31.2k|  writeXmpFromPacket(true);
  610|  31.2k|}
_ZN5Exiv25Image12clearXmpDataEv:
  619|  31.2k|void Image::clearXmpData() {
  620|  31.2k|  xmpData_.clear();
  621|  31.2k|  writeXmpFromPacket(false);
  622|  31.2k|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  630|  62.4k|void Image::writeXmpFromPacket(bool flag) {
  631|  62.4k|  writeXmpFromPacket_ = flag;
  632|  62.4k|}
_ZN5Exiv25Image12clearCommentEv:
  638|  31.2k|void Image::clearComment() {
  639|  31.2k|  comment_.erase();
  640|  31.2k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  642|    104|void Image::setComment(const std::string& comment) {
  643|    104|  comment_ = comment;
  644|    104|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  646|    138|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  647|    138|  iccProfile_ = std::move(iccProfile);
  648|    138|  if (bTestValid) {
  ------------------
  |  Branch (648:7): [True: 138, False: 0]
  ------------------
  649|    138|    checkIccProfile();
  650|    138|  }
  651|    138|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  653|  1.17k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  654|  1.17k|  if (size == 0) {
  ------------------
  |  Branch (654:7): [True: 411, False: 761]
  ------------------
  655|    411|    return;
  656|    411|  }
  657|    761|  const size_t start = iccProfile_.size();
  658|    761|  iccProfile_.resize(Safe::add(start, size));
  659|    761|  memcpy(iccProfile_.data(start), bytes, size);
  660|    761|  if (bTestValid) {
  ------------------
  |  Branch (660:7): [True: 26, False: 735]
  ------------------
  661|     26|    checkIccProfile();
  662|     26|  }
  663|    761|}
_ZNK5Exiv25Image15checkIccProfileEv:
  665|    164|void Image::checkIccProfile() const {
  666|    164|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (666:7): [True: 28, False: 136]
  ------------------
  667|     28|    throw Error(ErrorCode::kerInvalidIccProfile);
  668|     28|  }
  669|    136|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  670|    136|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (670:7): [True: 91, False: 45]
  ------------------
  671|     91|    throw Error(ErrorCode::kerInvalidIccProfile);
  672|     91|  }
  673|    136|}
_ZN5Exiv25Image15clearIccProfileEv:
  675|  31.2k|void Image::clearIccProfile() {
  676|  31.2k|  iccProfile_.reset();
  677|  31.2k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  679|  10.6k|void Image::setByteOrder(ByteOrder byteOrder) {
  680|  10.6k|  byteOrder_ = byteOrder;
  681|  10.6k|}
_ZNK5Exiv25Image9byteOrderEv:
  683|     38|ByteOrder Image::byteOrder() const {
  684|     38|  return byteOrder_;
  685|     38|}
_ZNK5Exiv25Image10pixelWidthEv:
  687|  2.08k|uint32_t Image::pixelWidth() const {
  688|  2.08k|  return pixelWidth_;
  689|  2.08k|}
_ZNK5Exiv25Image11pixelHeightEv:
  691|  2.08k|uint32_t Image::pixelHeight() const {
  692|  2.08k|  return pixelHeight_;
  693|  2.08k|}
_ZNK5Exiv25Image8exifDataEv:
  695|   671k|const ExifData& Image::exifData() const {
  696|   671k|  return exifData_;
  697|   671k|}
_ZNK5Exiv25Image7xmpDataEv:
  703|  17.8k|const XmpData& Image::xmpData() const {
  704|  17.8k|  return xmpData_;
  705|  17.8k|}
_ZNK5Exiv25Image7commentEv:
  707|    643|std::string Image::comment() const {
  708|    643|  return comment_;
  709|    643|}
_ZNK5Exiv25Image2ioEv:
  715|  27.1k|BasicIo& Image::io() const {
  716|  27.1k|  return *io_;
  717|  27.1k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  723|  74.9k|const NativePreviewList& Image::nativePreviews() const {
  724|  74.9k|  return nativePreviews_;
  725|  74.9k|}
_ZNK5Exiv25Image4goodEv:
  727|  36.2k|bool Image::good() const {
  728|  36.2k|  if (io_->open() != 0)
  ------------------
  |  Branch (728:7): [True: 0, False: 36.2k]
  ------------------
  729|      0|    return false;
  730|  36.2k|  IoCloser closer(*io_);
  731|  36.2k|  return ImageFactory::checkType(imageType_, *io_, false);
  732|  36.2k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  782|  36.2k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  783|  36.2k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (783:12): [True: 36.2k, False: 0]
  ------------------
  784|  36.2k|    return r->isThisType_(io, advance);
  785|      0|  return false;
  786|  36.2k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  868|  37.2k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  869|  37.2k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  870|  37.2k|  if (!image)
  ------------------
  |  Branch (870:7): [True: 791, False: 36.4k]
  ------------------
  871|    791|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  872|  36.4k|  return image;
  873|  37.2k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  875|  37.2k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  876|  37.2k|  if (io->open() != 0) {
  ------------------
  |  Branch (876:7): [True: 0, False: 37.2k]
  ------------------
  877|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  878|      0|  }
  879|   679k|  for (const auto& r : registry) {
  ------------------
  |  Branch (879:22): [True: 679k, False: 996]
  ------------------
  880|   679k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (880:9): [True: 36.2k, False: 643k]
  ------------------
  881|  36.2k|      return r.newInstance_(std::move(io), false);
  882|  36.2k|    }
  883|   679k|  }
  884|    996|  return nullptr;
  885|  37.2k|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  923|  15.0k|void append(Blob& blob, const byte* buf, size_t len) {
  924|  15.0k|  if (len != 0) {
  ------------------
  |  Branch (924:7): [True: 15.0k, False: 0]
  ------------------
  925|  15.0k|    Blob::size_type size = blob.size();
  926|  15.0k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (926:9): [True: 621, False: 14.4k]
  ------------------
  927|    621|      blob.reserve(size + 65536);
  928|    621|    }
  929|  15.0k|    blob.resize(size + len);
  930|  15.0k|    std::copy_n(buf, len, blob.begin() + size);
  931|  15.0k|  }
  932|  15.0k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   653k|  bool operator==(const ImageType& imageType) const {
   67|   653k|    return imageType == imageType_;
   68|   653k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  54.7k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  54.7k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 41.3k, False: 13.4k]
  ------------------
   58|  41.3k|    value_ = pValue->clone();
   59|  54.7k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|  66.0k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|  66.0k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 66.0k, False: 0]
  ------------------
   63|  66.0k|    key_ = rhs.key_->clone();  // deep copy
   64|  66.0k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 66.0k, False: 0]
  ------------------
   65|  66.0k|    value_ = rhs.value_->clone();  // deep copy
   66|  66.0k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   120k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   129k|uint16_t Iptcdatum::record() const {
   87|   129k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 129k, False: 0]
  ------------------
   88|   129k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   360k|uint16_t Iptcdatum::tag() const {
  111|   360k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 360k, False: 0]
  ------------------
  112|   360k|}
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|    402|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|    402|  setValue(value);
  188|    402|  return *this;
  189|    402|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  13.5k|int Iptcdatum::setValue(const std::string& value) {
  203|  13.5k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 13.4k, False: 56]
  ------------------
  204|  13.4k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  13.4k|    value_ = Value::create(type);
  206|  13.4k|  }
  207|  13.5k|  return value_->read(value);
  208|  13.5k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|    402|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|    402|  IptcKey iptcKey(key);
  212|    402|  auto pos = findKey(iptcKey);
  213|    402|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 346, False: 56]
  ------------------
  214|    346|    return iptcMetadata_.emplace_back(iptcKey);
  215|    346|  }
  216|     56|  return *pos;
  217|    402|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  41.3k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  41.3k|  return add(Iptcdatum(key, value));
  236|  41.3k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  54.4k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  54.4k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 29.4k, False: 24.9k]
  |  Branch (239:7): [True: 27.8k, False: 26.5k]
  ------------------
  240|  29.4k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 27.8k, False: 1.58k]
  ------------------
  241|  27.8k|    return 6;
  242|  27.8k|  }
  243|       |  // allow duplicates
  244|  26.5k|  iptcMetadata_.push_back(iptcDatum);
  245|  26.5k|  return 0;
  246|  54.4k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|    719|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|    719|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|    719|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  29.4k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  29.4k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  29.4k|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  1.63k|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.63k|  auto pRead = pData;
  367|  1.63k|  const auto pEnd = pData + size;
  368|  1.63k|  iptcData.clear();
  369|       |
  370|  1.63k|  uint16_t record = 0;
  371|  1.63k|  uint16_t dataSet = 0;
  372|  1.63k|  uint32_t sizeData = 0;
  373|  1.63k|  byte extTest = 0;
  374|       |
  375|  1.87M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.87M, False: 899]
  ------------------
  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.87M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.82M, False: 42.0k]
  ------------------
  380|  1.82M|      continue;
  381|  42.0k|    record = *pRead++;
  382|  42.0k|    dataSet = *pRead++;
  383|       |
  384|  42.0k|    extTest = *pRead;
  385|  42.0k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 3.02k, False: 39.0k]
  ------------------
  386|       |      // extended dataset
  387|  3.02k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  3.02k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 144, False: 2.88k]
  ------------------
  389|    144|        return 5;
  390|  2.88k|      pRead += 2;
  391|  2.88k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 36, False: 2.84k]
  ------------------
  392|     36|        return 6;
  393|  2.84k|      sizeData = 0;
  394|  9.71k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 6.86k, False: 2.84k]
  ------------------
  395|  6.86k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  6.86k|      }
  397|  39.0k|    } else {
  398|       |      // standard dataset
  399|  39.0k|      sizeData = getUShort(pRead, bigEndian);
  400|  39.0k|      pRead += 2;
  401|  39.0k|    }
  402|  41.8k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 41.3k, False: 551]
  ------------------
  403|  41.3k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  41.3k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 41.3k]
  ------------------
  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|  41.3k|    } else {
  410|    551|#ifndef SUPPRESS_WARNINGS
  411|    551|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    551|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 551]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    551|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    551|#endif
  413|    551|      return 7;
  414|    551|    }
  415|  41.3k|    pRead += sizeData;
  416|  41.3k|  }
  417|       |
  418|    899|  return 0;
  419|  1.63k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  4.73k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  4.73k|  DataBuf buf;
  423|  4.73k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 4.73k, False: 0]
  ------------------
  424|  4.73k|    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.73k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   263k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   263k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 32.1k, False: 231k]
  |  Branch (42:43): [True: 27.9k, False: 4.19k]
  ------------------
   43|   263k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  30.1k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  30.1k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  41.3k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  41.3k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  41.3k|  auto value = Exiv2::Value::create(type);
  466|  41.3k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  41.3k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 20.9k, False: 20.3k]
  ------------------
  468|  20.9k|    Exiv2::IptcKey key(dataSet, record);
  469|  20.9k|    iptcData.add(key, value.get());
  470|  20.9k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 20.3k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  20.3k|    value = Exiv2::Value::create(Exiv2::string);
  473|  20.3k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  20.3k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 20.3k, False: 0]
  ------------------
  475|  20.3k|      Exiv2::IptcKey key(dataSet, record);
  476|  20.3k|      iptcData.add(key, value.get());
  477|  20.3k|    }
  478|  20.3k|  }
  479|  41.3k|  return rc;
  480|  41.3k|}

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    166|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|    166|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 10, False: 156]
  |  Branch (15:29): [True: 10, False: 146]
  ------------------
   16|     20|    return false;
   17|     20|  }
   18|       |
   19|    146|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    146|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    146|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    146|  bool clWithRightBrand = false;
   24|  2.32k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 2.22k, False: 99]
  ------------------
   25|  2.22k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  2.22k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 1.28k, False: 935]
  |  Branch (26:31): [True: 25, False: 1.26k]
  |  Branch (26:66): [True: 210, False: 1.98k]
  |  Branch (26:87): [True: 22, False: 188]
  ------------------
   27|     47|      clWithRightBrand = true;
   28|     47|      break;
   29|     47|    }
   30|  2.22k|  }
   31|    146|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 46, False: 100]
  |  Branch (31:32): [True: 19, False: 27]
  ------------------
   32|    166|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEEbPKhm:
  116|  1.33k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
  117|  1.33k|  if (create) {
  ------------------
  |  Branch (117:7): [True: 0, False: 1.33k]
  ------------------
  118|      0|    initImage(initData, dataSize);
  119|      0|  }
  120|  1.33k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  133|  34.8k|byte JpegBase::advanceToMarker(ErrorCode err) const {
  134|  34.8k|  int c = -1;
  135|       |  // Skips potential padding between markers
  136|  2.19M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (136:10): [True: 2.16M, False: 34.1k]
  ------------------
  137|  2.16M|    if (c == EOF)
  ------------------
  |  Branch (137:9): [True: 743, False: 2.16M]
  ------------------
  138|    743|      throw Error(err);
  139|  2.16M|  }
  140|       |
  141|       |  // Markers can start with any number of 0xff
  142|  37.1k|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (142:10): [True: 2.99k, False: 34.1k]
  ------------------
  143|  2.99k|  }
  144|  34.1k|  if (c == EOF)
  ------------------
  |  Branch (144:7): [True: 36, False: 34.1k]
  ------------------
  145|     36|    throw Error(err);
  146|       |
  147|  34.1k|  return static_cast<byte>(c);
  148|  34.1k|}
_ZN5Exiv28JpegBase12readMetadataEv:
  150|  1.33k|void JpegBase::readMetadata() {
  151|  1.33k|  int rc = 0;  // Todo: this should be the return value
  152|       |
  153|  1.33k|  if (io_->open() != 0)
  ------------------
  |  Branch (153:7): [True: 0, False: 1.33k]
  ------------------
  154|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  155|  1.33k|  IoCloser closer(*io_);
  156|       |  // Ensure that this is the correct image type
  157|  1.33k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (157:7): [True: 106, False: 1.22k]
  ------------------
  158|    106|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (158:9): [True: 0, False: 106]
  |  Branch (158:25): [True: 0, False: 106]
  ------------------
  159|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  160|    106|    throw Error(ErrorCode::kerNotAJpeg);
  161|    106|  }
  162|  1.22k|  clearMetadata();
  163|  1.22k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  164|  1.22k|  Blob psBlob;
  165|  1.22k|  bool foundCompletePsData = false;
  166|  1.22k|  bool foundExifData = false;
  167|  1.22k|  bool foundXmpData = false;
  168|  1.22k|  bool foundIccData = false;
  169|       |
  170|       |  // Read section marker
  171|  1.22k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  172|       |
  173|  34.1k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (173:10): [True: 34.0k, False: 82]
  |  Branch (173:28): [True: 34.0k, False: 14]
  |  Branch (173:46): [True: 34.0k, False: 9]
  ------------------
  174|  34.0k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  175|       |
  176|       |    // Read the rest of the segment.
  177|  34.0k|    DataBuf buf(size);
  178|       |    // check if the segment is not empty
  179|  34.0k|    if (size > 2) {
  ------------------
  |  Branch (179:9): [True: 27.7k, False: 6.27k]
  ------------------
  180|  27.7k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  181|  27.7k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  182|  27.7k|    }
  183|       |
  184|  34.0k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (184:14): [True: 3.38k, False: 30.6k]
  ------------------
  185|  3.38k|      sof_encoding_process_ = itSofMarker->label_;
  186|  3.38k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (186:11): [True: 1.98k, False: 1.40k]
  |  Branch (186:24): [True: 1.59k, False: 389]
  ------------------
  187|  1.59k|        num_color_components_ = *buf.c_data(7);
  188|  1.59k|      }
  189|  3.38k|    }
  190|       |
  191|  34.0k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (191:9): [True: 32.7k, False: 1.29k]
  |  Branch (191:27): [True: 769, False: 32.0k]
  |  Branch (191:46): [True: 536, False: 233]
  ------------------
  192|    536|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (192:12): [True: 55, False: 481]
  ------------------
  193|     55|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8);
  194|     55|      setByteOrder(bo);
  195|     55|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (195:11): [True: 28, False: 27]
  |  Branch (195:23): [True: 0, False: 28]
  ------------------
  196|      0|#ifndef SUPPRESS_WARNINGS
  197|      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()
  ------------------
  198|      0|#endif
  199|      0|        exifData_.clear();
  200|      0|      }
  201|     55|      --search;
  202|     55|      foundExifData = true;
  203|  34.0k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (203:16): [True: 33.1k, False: 858]
  |  Branch (203:33): [True: 645, False: 32.5k]
  |  Branch (203:52): [True: 280, False: 365]
  ------------------
  204|    280|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (204:19): [True: 47, False: 233]
  ------------------
  205|     47|      xmpPacket_.assign(buf.c_str(31), size - 31);
  206|     47|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (206:11): [True: 33, False: 14]
  |  Branch (206:34): [True: 29, False: 4]
  ------------------
  207|     29|#ifndef SUPPRESS_WARNINGS
  208|     29|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     29|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 29]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     29|  LogMsg(LogMsg::warn).os()
  ------------------
  209|     29|#endif
  210|     29|      }
  211|     47|      --search;
  212|     47|      foundXmpData = true;
  213|  33.9k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (213:16): [True: 33.3k, False: 629]
  |  Branch (213:40): [True: 20.5k, False: 12.7k]
  ------------------
  214|  20.5k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (214:16): [True: 20.2k, False: 308]
  ------------------
  215|  20.2k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (215:19): [True: 17.9k, False: 2.27k]
  ------------------
  216|       |#ifdef EXIV2_DEBUG_MESSAGES
  217|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  218|       |#endif
  219|  17.9k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (219:11): [True: 14.9k, False: 2.98k]
  ------------------
  220|  14.9k|        append(psBlob, buf.c_data(16), size - 16);
  221|  14.9k|      }
  222|       |      // Check whether psBlob is complete
  223|  17.9k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (223:11): [True: 17.7k, False: 248]
  |  Branch (223:30): [True: 109, False: 17.6k]
  ------------------
  224|    109|        --search;
  225|    109|        foundCompletePsData = true;
  226|    109|      }
  227|  17.9k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (227:16): [True: 969, False: 15.0k]
  |  Branch (227:34): [True: 269, False: 700]
  ------------------
  228|       |      // JPEGs can have multiple comments, but for now only read
  229|       |      // the first one (most jpegs only have one anyway). Comments
  230|       |      // are simple single byte ISO-8859-1 strings.
  231|    269|      comment_.assign(buf.c_str(2), size - 2);
  232|  1.27k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (232:14): [True: 1.08k, False: 195]
  |  Branch (232:35): [True: 1.00k, False: 74]
  ------------------
  233|  1.00k|        comment_.pop_back();
  234|  1.00k|      }
  235|    269|      --search;
  236|  15.7k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (236:16): [True: 2.09k, False: 13.6k]
  |  Branch (236:35): [True: 1.83k, False: 254]
  ------------------
  237|  1.83k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (237:19): [True: 1.20k, False: 633]
  ------------------
  238|  1.20k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (238:11): [True: 13, False: 1.19k]
  ------------------
  239|     13|        rc = 8;
  240|     13|        break;
  241|     13|      }
  242|       |      // ICC profile
  243|  1.19k|      if (!foundIccData) {
  ------------------
  |  Branch (243:11): [True: 99, False: 1.09k]
  ------------------
  244|     99|        foundIccData = true;
  245|     99|        --search;
  246|     99|      }
  247|  1.19k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  248|  1.19k|      auto chunks = static_cast<int>(buf.read_uint8(2 + 13));
  249|       |      // ICC1v43_2010-12.pdf header is 14 bytes
  250|       |      // header = "ICC_PROFILE\0" (12 bytes)
  251|       |      // chunk/chunks are a single byte
  252|       |      // Spec 7.2 Profile bytes 0-3 size
  253|  1.19k|      uint32_t s = buf.read_uint32(2 + 14, bigEndian);
  254|       |#ifdef EXIV2_DEBUG_MESSAGES
  255|       |      std::cerr << "Found ICC Profile chunk " << chunk << " of " << chunks << (chunk == 1 ? " size: " : "")
  256|       |                << (chunk == 1 ? s : 0) << '\n';
  257|       |#endif
  258|       |      // #1286 profile can be padded
  259|  1.19k|      size_t icc_size = size - 2 - 14;
  260|  1.19k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (260:11): [True: 759, False: 431]
  |  Branch (260:25): [True: 433, False: 326]
  ------------------
  261|    433|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  262|    433|        icc_size = s;
  263|    433|      }
  264|       |
  265|  1.19k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  266|  14.5k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (266:16): [True: 10.5k, False: 3.95k]
  |  Branch (266:37): [True: 653, False: 9.91k]
  ------------------
  267|       |      // We hit a SOFn (start-of-frame) marker
  268|    653|      if (size < 8) {
  ------------------
  |  Branch (268:11): [True: 36, False: 617]
  ------------------
  269|     36|        rc = 7;
  270|     36|        break;
  271|     36|      }
  272|    617|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  273|    617|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  274|    617|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (274:11): [True: 169, False: 448]
  ------------------
  275|    169|        --search;
  276|    617|    }
  277|       |
  278|       |    // Read the beginning of the next segment
  279|  34.0k|    try {
  280|  34.0k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  281|  34.0k|    } catch (const Error&) {
  282|    723|      rc = 5;
  283|    723|      break;
  284|    723|    }
  285|  34.0k|  }  // while there are segments to process
  286|       |
  287|    877|  if (!psBlob.empty()) {
  ------------------
  |  Branch (287:7): [True: 326, False: 551]
  ------------------
  288|       |    // Find actual IPTC data within the psBlob
  289|    326|    Blob iptcBlob;
  290|    326|    const byte* record = nullptr;
  291|    326|    uint32_t sizeIptc = 0;
  292|    326|    uint32_t sizeHdr = 0;
  293|    326|    const byte* pCur = psBlob.data();
  294|    326|    const byte* pEnd = pCur + psBlob.size();
  295|    459|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (295:12): [True: 434, False: 25]
  |  Branch (295:27): [True: 133, False: 301]
  ------------------
  296|       |#ifdef EXIV2_DEBUG_MESSAGES
  297|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  298|       |#endif
  299|    133|      if (sizeIptc) {
  ------------------
  |  Branch (299:11): [True: 114, False: 19]
  ------------------
  300|    114|        append(iptcBlob, record + sizeHdr, sizeIptc);
  301|    114|      }
  302|    133|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  303|    133|    }
  304|    326|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (304:9): [True: 111, False: 215]
  |  Branch (304:30): [True: 43, False: 68]
  ------------------
  305|     43|#ifndef SUPPRESS_WARNINGS
  306|     43|      EXV_WARNING << "Failed to decode IPTC metadata.\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()
  ------------------
  307|     43|#endif
  308|     43|      iptcData_.clear();
  309|     43|    }
  310|    326|  }
  311|       |
  312|    877|  if (rc != 0) {
  ------------------
  |  Branch (312:7): [True: 772, False: 105]
  ------------------
  313|    772|#ifndef SUPPRESS_WARNINGS
  314|    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()
  ------------------
  315|    772|#endif
  316|    772|  }
  317|    877|}  // JpegBase::readMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  968|  1.23k|    JpegBase(ImageType::jpeg, std::move(io), create, blank_, sizeof(blank_)) {
  969|  1.23k|}
_ZNK5Exiv29JpegImage8mimeTypeEv:
  971|  1.88k|std::string JpegImage::mimeType() const {
  972|  1.88k|  return "image/jpeg";
  973|  1.88k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  987|  1.23k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  988|  1.23k|  return isJpegType(iIo, advance);
  989|  1.23k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  991|  1.12k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, bool create) {
  992|  1.12k|  auto image = std::make_unique<JpegImage>(std::move(io), create);
  993|  1.12k|  if (!image->good()) {
  ------------------
  |  Branch (993:7): [True: 0, False: 1.12k]
  ------------------
  994|      0|    return nullptr;
  995|      0|  }
  996|  1.12k|  return image;
  997|  1.12k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
  999|  39.6k|bool isJpegType(BasicIo& iIo, bool advance) {
 1000|  39.6k|  bool result = true;
 1001|  39.6k|  byte tmpBuf[2];
 1002|  39.6k|  iIo.read(tmpBuf, 2);
 1003|  39.6k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1003:7): [True: 0, False: 39.6k]
  |  Branch (1003:22): [True: 27, False: 39.6k]
  ------------------
 1004|     27|    return false;
 1005|       |
 1006|  39.6k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1006:7): [True: 35.9k, False: 3.67k]
  |  Branch (1006:28): [True: 294, False: 3.38k]
  ------------------
 1007|  36.2k|    result = false;
 1008|  36.2k|  }
 1009|  39.6k|  if (!advance || !result)
  ------------------
  |  Branch (1009:7): [True: 38.3k, False: 1.23k]
  |  Branch (1009:19): [True: 106, False: 1.13k]
  ------------------
 1010|  38.4k|    iIo.seek(-2, BasicIo::cur);
 1011|  39.6k|  return result;
 1012|  39.6k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
 1015|     94|    JpegBase(ImageType::exv, std::move(io), create, blank_, sizeof(blank_)) {
 1016|     94|}
_ZNK5Exiv28ExvImage8mimeTypeEv:
 1018|      9|std::string ExvImage::mimeType() const {
 1019|      9|  return "image/x-exv";
 1020|      9|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1033|     94|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1034|     94|  return isExvType(iIo, advance);
 1035|     94|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1037|     94|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, bool create) {
 1038|     94|  auto image = std::make_unique<ExvImage>(std::move(io), create);
 1039|     94|  if (!image->good())
  ------------------
  |  Branch (1039:7): [True: 0, False: 94]
  ------------------
 1040|      0|    return nullptr;
 1041|     94|  return image;
 1042|     94|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1044|  36.3k|bool isExvType(BasicIo& iIo, bool advance) {
 1045|  36.3k|  bool result = true;
 1046|  36.3k|  byte tmpBuf[7];
 1047|  36.3k|  iIo.read(tmpBuf, 7);
 1048|  36.3k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1048:7): [True: 0, False: 36.3k]
  |  Branch (1048:22): [True: 76, False: 36.2k]
  ------------------
 1049|     76|    return false;
 1050|       |
 1051|  36.2k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1051:7): [True: 35.8k, False: 439]
  |  Branch (1051:28): [True: 125, False: 314]
  |  Branch (1051:49): [True: 32, False: 282]
  ------------------
 1052|  35.9k|    result = false;
 1053|  35.9k|  }
 1054|  36.2k|  if (!advance || !result)
  ------------------
  |  Branch (1054:7): [True: 36.1k, False: 94]
  |  Branch (1054:19): [True: 0, False: 94]
  ------------------
 1055|  36.1k|    iIo.seek(-7, BasicIo::cur);
 1056|  36.2k|  return result;
 1057|  36.3k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  34.0k|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  34.0k|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  34.0k|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  34.0k|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 29.1k, False: 4.86k]
  ------------------
  107|  29.1k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|  29.1k|    size = getUShort(buf.data(), bigEndian);
  109|  29.1k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|  29.1k|  }
  111|  34.0k|  return {buf, size};
  112|  34.0k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  10.5k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  10.5k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 406, False: 10.1k]
  |  Branch (92:38): [True: 247, False: 9.91k]
  ------------------
   93|  10.5k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  20.7k|constexpr bool inRange(int lo, int value, int hi) {
   88|  20.7k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 19.2k, False: 1.43k]
  |  Branch (88:25): [True: 653, False: 18.6k]
  ------------------
   89|  20.7k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  34.0k|bool markerHasLength(byte m) {
   99|  34.0k|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 29.4k, False: 4.56k]
  |  Branch (99:44): [True: 4.86k, False: 24.6k]
  ------------------
  100|  34.0k|  return !markerWithoutLength;
  101|  34.0k|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  599|  3.58k|MatroskaVideo::MatroskaVideo(BasicIo::UniquePtr io) : Image(ImageType::mkv, mdNone, std::move(io)) {
  600|  3.58k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  602|  9.87k|std::string MatroskaVideo::mimeType() const {
  603|  9.87k|  return "video/matroska";
  604|  9.87k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  609|  3.58k|void MatroskaVideo::readMetadata() {
  610|  3.58k|  if (io_->open() != 0)
  ------------------
  |  Branch (610:7): [True: 0, False: 3.58k]
  ------------------
  611|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  612|       |
  613|       |  // Ensure that this is the correct image type
  614|  3.58k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 3.58k]
  ------------------
  615|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (615:9): [True: 0, False: 0]
  |  Branch (615:25): [True: 0, False: 0]
  ------------------
  616|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  617|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  618|      0|  }
  619|       |
  620|  3.58k|  IoCloser closer(*io_);
  621|  3.58k|  clearMetadata();
  622|  3.58k|  continueTraversing_ = true;
  623|  3.58k|  height_ = width_ = 1;
  624|       |
  625|  3.58k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  626|  3.58k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  627|       |
  628|  78.4k|  while (continueTraversing_)
  ------------------
  |  Branch (628:10): [True: 74.8k, False: 3.58k]
  ------------------
  629|  74.8k|    decodeBlock();
  630|       |
  631|  3.58k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  632|  3.58k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  634|  74.8k|void MatroskaVideo::decodeBlock() {
  635|  74.8k|  byte buf[8];
  636|  74.8k|  io_->read(buf, 1);
  637|       |
  638|  74.8k|  if (io_->eof()) {
  ------------------
  |  Branch (638:7): [True: 361, False: 74.5k]
  ------------------
  639|    361|    continueTraversing_ = false;
  640|    361|    return;
  641|    361|  }
  642|       |
  643|  74.5k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  644|  74.5k|  if (block_size > 0)
  ------------------
  |  Branch (644:7): [True: 73.9k, False: 503]
  ------------------
  645|  73.9k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  646|       |
  647|  74.5k|  auto tag_id = returnTagValue(buf, block_size);
  648|  74.5k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  649|       |
  650|  74.5k|  if (!tag) {
  ------------------
  |  Branch (650:7): [True: 1.91k, False: 72.5k]
  ------------------
  651|  1.91k|    continueTraversing_ = false;
  652|  1.91k|    return;
  653|  1.91k|  }
  654|       |
  655|       |  // tag->dump(std::cout);
  656|       |
  657|  72.5k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (657:7): [True: 571, False: 72.0k]
  |  Branch (657:27): [True: 1, False: 72.0k]
  ------------------
  658|     11|    continueTraversing_ = false;
  659|     11|    return;
  660|     11|  }
  661|       |
  662|  72.5k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  663|  72.5k|  block_size = findBlockSize(buf[0]);  // 0-8
  664|       |
  665|  72.5k|  if (block_size > 0)
  ------------------
  |  Branch (665:7): [True: 71.8k, False: 679]
  ------------------
  666|  71.8k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  667|  72.5k|  size_t size = returnTagValue(buf, block_size);
  668|       |
  669|  72.5k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (669:7): [True: 32.1k, False: 40.3k]
  |  Branch (669:29): [True: 32.1k, False: 0]
  ------------------
  670|  32.1k|    return;
  671|       |
  672|  40.3k|  const size_t bufMaxSize = 200;
  673|       |
  674|  40.3k|#ifndef SUPPRESS_WARNINGS
  675|  40.3k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (675:7): [True: 38.4k, False: 1.88k]
  |  Branch (675:28): [True: 183, False: 38.3k]
  ------------------
  676|    183|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    183|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 183]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    183|  LogMsg(LogMsg::warn).os()
  ------------------
  677|      0|                << bufMaxSize << ": ignoring it.\n";
  678|    183|  }
  679|  40.3k|#endif
  680|  40.3k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (680:7): [True: 1.88k, False: 38.4k]
  |  Branch (680:27): [True: 183, False: 38.3k]
  ------------------
  681|  1.36k|    io_->seek(size, BasicIo::cur);
  682|  1.36k|    return;
  683|  1.36k|  }
  684|       |
  685|  39.0k|  DataBuf buf2(bufMaxSize + 1);
  686|  39.0k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  687|  39.0k|  switch (tag->_type) {
  688|  7.84k|    case InternalField:
  ------------------
  |  Branch (688:5): [True: 7.84k, False: 31.1k]
  ------------------
  689|  7.84k|      decodeInternalTags(tag, buf2.data());
  690|  7.84k|      break;
  691|  2.68k|    case String:
  ------------------
  |  Branch (691:5): [True: 2.68k, False: 36.3k]
  ------------------
  692|  2.68k|    case Utf8:
  ------------------
  |  Branch (692:5): [True: 0, False: 39.0k]
  ------------------
  693|  2.68k|      decodeStringTags(tag, buf2.data());
  694|  2.68k|      break;
  695|  2.88k|    case Integer:
  ------------------
  |  Branch (695:5): [True: 2.88k, False: 36.1k]
  ------------------
  696|  4.12k|    case UInteger:
  ------------------
  |  Branch (696:5): [True: 1.23k, False: 37.7k]
  ------------------
  697|  4.12k|      decodeIntegerTags(tag, buf2.data());
  698|  4.12k|      break;
  699|  20.3k|    case Boolean:
  ------------------
  |  Branch (699:5): [True: 20.3k, False: 18.6k]
  ------------------
  700|  20.3k|      decodeBooleanTags(tag, buf2.data());
  701|  20.3k|      break;
  702|  1.50k|    case Date:
  ------------------
  |  Branch (702:5): [True: 1.50k, False: 37.5k]
  ------------------
  703|  1.50k|      decodeDateTags(tag, buf2.data(), size);
  704|  1.50k|      break;
  705|  1.56k|    case Float:
  ------------------
  |  Branch (705:5): [True: 1.56k, False: 37.4k]
  ------------------
  706|  1.56k|      decodeFloatTags(tag, buf2.data());
  707|  1.56k|      break;
  708|      0|    case Binary:
  ------------------
  |  Branch (708:5): [True: 0, False: 39.0k]
  ------------------
  709|      0|      break;
  710|      0|    case Master:
  ------------------
  |  Branch (710:5): [True: 0, False: 39.0k]
  ------------------
  711|      0|      break;
  712|      0|    default:
  ------------------
  |  Branch (712:5): [True: 0, False: 39.0k]
  ------------------
  713|      0|      break;
  714|  39.0k|  }
  715|  39.0k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  717|  7.84k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  718|  7.84k|  uint64_t key = getULongLong(buf, bigEndian);
  719|  7.84k|  if (!key)
  ------------------
  |  Branch (719:7): [True: 256, False: 7.58k]
  ------------------
  720|    256|    return;
  721|       |
  722|  7.58k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  7.58k|    switch (tag->_id) {
  724|  7.58k|      case Xmp_video_VideoScanTpye:
  725|  7.58k|        return Exiv2::find(videoScanType, key);
  726|  7.58k|      case Xmp_audio_ChannelType:
  727|  7.58k|        return Exiv2::find(audioChannels, key);
  728|  7.58k|      case Xmp_video_ContentCompressAlgo:
  729|  7.58k|        return Exiv2::find(compressionAlgorithm, key);
  730|  7.58k|      case Xmp_video_ContentEncryptAlgo:
  731|  7.58k|        return Exiv2::find(encryptionAlgorithm, key);
  732|  7.58k|      case Xmp_video_ContentSignAlgo_1:
  733|  7.58k|      case Xmp_video_ContentSignAlgo_2:
  734|  7.58k|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|  7.58k|      case Xmp_video_ContentSignHashAlgo_1:
  736|  7.58k|      case Xmp_video_ContentSignHashAlgo_2:
  737|  7.58k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  7.58k|      case Xmp_video_ContentEncodingType:
  739|  7.58k|        return Exiv2::find(encodingType, key);
  740|  7.58k|      case Xmp_video_DisplayUnit:
  741|  7.58k|        return Exiv2::find(displayUnit, key);
  742|  7.58k|      case Xmp_video_AspectRatioType:
  743|  7.58k|        return Exiv2::find(aspectRatioType, key);
  744|  7.58k|      case Xmp_video_PhysicalEquivalent:
  745|  7.58k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|  7.58k|      case Xmp_video_TranslateCodec:
  747|  7.58k|        return Exiv2::find(chapterTranslateCodec, key);
  748|  7.58k|      case Video_Audio_CodecID:
  749|  7.58k|        return Exiv2::find(trackCodec, key);
  750|  7.58k|      case Video_Audio_CodecName:
  751|  7.58k|        return Exiv2::find(codecInfo, key);
  752|  7.58k|      case CodecDownloadURL:
  753|  7.58k|      case CodecInfoURL:
  754|  7.58k|        return Exiv2::find(codecDownloadUrl, key);
  755|  7.58k|    }
  756|  7.58k|    return nullptr;
  757|  7.58k|  }();
  758|  7.58k|  if (internalMt) {
  ------------------
  |  Branch (758:7): [True: 2.82k, False: 4.76k]
  ------------------
  759|  2.82k|    xmpData_[tag->_label] = internalMt->_label;
  760|  4.76k|  } else {
  761|  4.76k|    xmpData_[tag->_label] = key;
  762|  4.76k|  }
  763|  7.58k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  765|  2.68k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  766|  2.68k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (766:7): [True: 205, False: 2.48k]
  ------------------
  767|    205|    track_count_++;
  768|    205|    xmpData_[tag->_label] = track_count_;
  769|  2.48k|  } else {
  770|  2.48k|    xmpData_[tag->_label] = buf;
  771|  2.48k|  }
  772|  2.68k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  774|  4.12k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  775|  4.12k|  uint64_t value = getULongLong(buf, bigEndian);
  776|  4.12k|  if (!value)
  ------------------
  |  Branch (776:7): [True: 673, False: 3.45k]
  ------------------
  777|    673|    return;
  778|       |
  779|  3.45k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (779:7): [True: 599, False: 2.85k]
  |  Branch (779:40): [True: 279, False: 2.57k]
  ------------------
  780|    878|    width_ = value;
  781|  3.45k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (781:7): [True: 987, False: 2.46k]
  |  Branch (781:41): [True: 678, False: 1.78k]
  ------------------
  782|  1.66k|    height_ = value;
  783|  3.45k|  xmpData_[tag->_label] = value;
  784|  3.45k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  786|  20.3k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  787|  20.3k|  const MatroskaTag* internalMt = nullptr;
  788|  20.3k|  uint64_t key = getULongLong(buf, bigEndian);
  789|  20.3k|  if (!key)
  ------------------
  |  Branch (789:7): [True: 564, False: 19.8k]
  ------------------
  790|    564|    return;
  791|       |
  792|  19.8k|  switch (tag->_id) {
  793|  5.51k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (793:5): [True: 5.51k, False: 14.3k]
  ------------------
  794|  5.51k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (794:16): [True: 2.10k, False: 3.40k]
  ------------------
  795|  2.10k|        stream_ = f->_id;
  796|  2.10k|      }
  797|  5.51k|      break;
  798|    933|    case TrackUsed:
  ------------------
  |  Branch (798:5): [True: 933, False: 18.8k]
  ------------------
  799|    933|      internalMt = Exiv2::find(trackEnable, key);
  800|    933|      break;
  801|  9.23k|    case TrackDefault:
  ------------------
  |  Branch (801:5): [True: 9.23k, False: 10.6k]
  ------------------
  802|  9.23k|      internalMt = Exiv2::find(defaultOn, key);
  803|  9.23k|      break;
  804|  1.13k|    case TrackForced:
  ------------------
  |  Branch (804:5): [True: 1.13k, False: 18.6k]
  ------------------
  805|  1.13k|      internalMt = Exiv2::find(trackForced, key);
  806|  1.13k|      break;
  807|  1.13k|    case TrackLacing:
  ------------------
  |  Branch (807:5): [True: 1.13k, False: 18.7k]
  ------------------
  808|  1.13k|      internalMt = Exiv2::find(trackLacing, key);
  809|  1.13k|      break;
  810|  1.62k|    case CodecDecodeAll:
  ------------------
  |  Branch (810:5): [True: 1.62k, False: 18.2k]
  ------------------
  811|  1.62k|      internalMt = Exiv2::find(codecDecodeAll, key);
  812|  1.62k|      break;
  813|    203|    case CodecSettings:
  ------------------
  |  Branch (813:5): [True: 203, False: 19.6k]
  ------------------
  814|    203|      internalMt = Exiv2::find(codecSettings, key);
  815|    203|      break;
  816|     66|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (816:5): [True: 66, False: 19.7k]
  ------------------
  817|     66|      internalMt = tag;
  818|     66|      break;
  819|      0|    default:
  ------------------
  |  Branch (819:5): [True: 0, False: 19.8k]
  ------------------
  820|      0|      break;
  821|  19.8k|  }
  822|       |
  823|  19.8k|  if (internalMt) {
  ------------------
  |  Branch (823:7): [True: 2.89k, False: 16.9k]
  ------------------
  824|  2.89k|    xmpData_[internalMt->_label] = "Yes";
  825|  2.89k|  }
  826|  19.8k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  828|  1.50k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  829|  1.50k|  int64_t duration_in_ms = 0;
  830|  1.50k|  uint64_t value;
  831|  1.50k|  switch (tag->_id) {
  832|    487|    case Xmp_video_Duration:
  ------------------
  |  Branch (832:5): [True: 487, False: 1.01k]
  ------------------
  833|    487|      if (size <= 4) {
  ------------------
  |  Branch (833:11): [True: 269, False: 218]
  ------------------
  834|    269|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  835|    269|      } else {
  836|    218|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  837|    218|      }
  838|    487|      xmpData_[tag->_label] = duration_in_ms;
  839|    487|      break;
  840|    482|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (840:5): [True: 482, False: 1.02k]
  ------------------
  841|    482|      value = getULongLong(buf, bigEndian);
  842|    482|      if (!value)
  ------------------
  |  Branch (842:11): [True: 200, False: 282]
  ------------------
  843|    200|        return;
  844|    282|      duration_in_ms = value / 1000000000;
  845|    282|      xmpData_[tag->_label] = duration_in_ms;
  846|    282|      break;
  847|       |
  848|    537|    case TimecodeScale:
  ------------------
  |  Branch (848:5): [True: 537, False: 969]
  ------------------
  849|    537|      value = getULongLong(buf, bigEndian);
  850|    537|      if (!value)
  ------------------
  |  Branch (850:11): [True: 334, False: 203]
  ------------------
  851|    334|        return;
  852|    203|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  853|    203|      xmpData_[tag->_label] = time_code_scale_;
  854|    203|      break;
  855|      0|    default:
  ------------------
  |  Branch (855:5): [True: 0, False: 1.50k]
  ------------------
  856|      0|      break;
  857|  1.50k|  }
  858|  1.50k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  860|  1.56k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  861|  1.56k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  862|       |
  863|  1.56k|  switch (tag->_id) {
  864|    296|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (864:5): [True: 296, False: 1.26k]
  ------------------
  865|    363|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (865:5): [True: 67, False: 1.49k]
  ------------------
  866|    363|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  867|    363|      break;
  868|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (868:5): [True: 0, False: 1.56k]
  ------------------
  869|  1.19k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (869:5): [True: 1.19k, False: 363]
  ------------------
  870|  1.19k|      uint64_t key = getULongLong(buf, bigEndian);
  871|  1.19k|      if (!key)
  ------------------
  |  Branch (871:11): [True: 636, False: 562]
  ------------------
  872|    636|        return;
  873|    562|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (873:16): [True: 266, False: 296]
  ------------------
  874|    266|        double frame_rate = 0;
  875|    266|        switch (stream_) {
  876|     74|          case 1:  // video
  ------------------
  |  Branch (876:11): [True: 74, False: 192]
  ------------------
  877|     74|            frame_rate = 1000000000.0 / static_cast<double>(key);
  878|     74|            break;
  879|     91|          case 2:  // audio
  ------------------
  |  Branch (879:11): [True: 91, False: 175]
  ------------------
  880|     91|            frame_rate = static_cast<double>(key) / 1000;
  881|     91|            break;
  882|    101|          default:
  ------------------
  |  Branch (882:11): [True: 101, False: 165]
  ------------------
  883|    101|            break;
  884|    266|        }
  885|    266|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (885:13): [True: 165, False: 101]
  ------------------
  886|    165|          xmpData_[internalMt->_label] = frame_rate;
  887|    266|      } else
  888|    296|        xmpData_[tag->_label] = "Variable Bit Rate";
  889|    562|    } break;
  890|    562|    default:
  ------------------
  |  Branch (890:5): [True: 0, False: 1.56k]
  ------------------
  891|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  892|      0|      break;
  893|  1.56k|  }
  894|  1.56k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  896|   146k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  897|   146k|  if (b & 128)
  ------------------
  |  Branch (897:7): [True: 118k, False: 27.8k]
  ------------------
  898|   118k|    return 1;
  899|  27.8k|  if (b & 64)
  ------------------
  |  Branch (899:7): [True: 14.1k, False: 13.6k]
  ------------------
  900|  14.1k|    return 2;
  901|  13.6k|  if (b & 32)
  ------------------
  |  Branch (901:7): [True: 1.80k, False: 11.8k]
  ------------------
  902|  1.80k|    return 3;
  903|  11.8k|  if (b & 16)
  ------------------
  |  Branch (903:7): [True: 6.85k, False: 5.03k]
  ------------------
  904|  6.85k|    return 4;
  905|  5.03k|  if (b & 8)
  ------------------
  |  Branch (905:7): [True: 673, False: 4.36k]
  ------------------
  906|    673|    return 5;
  907|  4.36k|  if (b & 4)
  ------------------
  |  Branch (907:7): [True: 727, False: 3.63k]
  ------------------
  908|    727|    return 6;
  909|  3.63k|  if (b & 2)
  ------------------
  |  Branch (909:7): [True: 1.18k, False: 2.44k]
  ------------------
  910|  1.18k|    return 7;
  911|  2.44k|  if (b & 1)
  ------------------
  |  Branch (911:7): [True: 1.87k, False: 574]
  ------------------
  912|  1.87k|    return 8;
  913|    574|  return 0;
  914|  2.44k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  916|  3.58k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, bool /*create*/) {
  917|  3.58k|  auto image = std::make_unique<MatroskaVideo>(std::move(io));
  918|  3.58k|  if (!image->good()) {
  ------------------
  |  Branch (918:7): [True: 0, False: 3.58k]
  ------------------
  919|      0|    return nullptr;
  920|      0|  }
  921|  3.58k|  return image;
  922|  3.58k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  924|  15.1k|bool isMkvType(BasicIo& iIo, bool advance) {
  925|  15.1k|  bool result = true;
  926|  15.1k|  byte tmpBuf[4];
  927|  15.1k|  iIo.read(tmpBuf, 4);
  928|       |
  929|  15.1k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (929:7): [True: 0, False: 15.1k]
  |  Branch (929:22): [True: 353, False: 14.7k]
  ------------------
  930|    353|    return false;
  931|       |
  932|  14.7k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (932:7): [True: 3.97k, False: 10.7k]
  |  Branch (932:28): [True: 16, False: 10.7k]
  |  Branch (932:49): [True: 10, False: 10.7k]
  |  Branch (932:70): [True: 12, False: 10.7k]
  ------------------
  933|  4.01k|    result = false;
  934|  4.01k|  }
  935|       |
  936|  14.7k|  if (!advance || !result)
  ------------------
  |  Branch (936:7): [True: 14.7k, False: 0]
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|  14.7k|    iIo.seek(0, BasicIo::beg);
  938|  14.7k|  return result;
  939|  15.1k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   146k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   146k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 145k, False: 574]
  |  Branch (583:23): [True: 145k, False: 0]
  ------------------
  584|       |
  585|   146k|  size_t b0 = buf[0] & (0xff >> size);
  586|   146k|  size_t tag = b0 << ((size - 1) * 8);
  587|   211k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 64.6k, False: 146k]
  ------------------
  588|  64.6k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  64.6k|  }
  590|       |
  591|   146k|  return tag;
  592|   146k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  722|  7.58k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  7.58k|    switch (tag->_id) {
  ------------------
  |  Branch (723:13): [True: 7.58k, False: 0]
  ------------------
  724|    470|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (724:7): [True: 470, False: 7.11k]
  ------------------
  725|    470|        return Exiv2::find(videoScanType, key);
  726|  1.51k|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (726:7): [True: 1.51k, False: 6.07k]
  ------------------
  727|  1.51k|        return Exiv2::find(audioChannels, key);
  728|    363|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (728:7): [True: 363, False: 7.22k]
  ------------------
  729|    363|        return Exiv2::find(compressionAlgorithm, key);
  730|    792|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (730:7): [True: 792, False: 6.79k]
  ------------------
  731|    792|        return Exiv2::find(encryptionAlgorithm, key);
  732|    357|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (732:7): [True: 357, False: 7.23k]
  ------------------
  733|    432|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (733:7): [True: 75, False: 7.51k]
  ------------------
  734|    432|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|    732|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (735:7): [True: 732, False: 6.85k]
  ------------------
  736|  1.12k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (736:7): [True: 397, False: 7.19k]
  ------------------
  737|  1.12k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|    547|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (738:7): [True: 547, False: 7.04k]
  ------------------
  739|    547|        return Exiv2::find(encodingType, key);
  740|    733|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (740:7): [True: 733, False: 6.85k]
  ------------------
  741|    733|        return Exiv2::find(displayUnit, key);
  742|    701|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (742:7): [True: 701, False: 6.88k]
  ------------------
  743|    701|        return Exiv2::find(aspectRatioType, key);
  744|    417|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (744:7): [True: 417, False: 7.17k]
  ------------------
  745|    417|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|    186|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (746:7): [True: 186, False: 7.40k]
  ------------------
  747|    186|        return Exiv2::find(chapterTranslateCodec, key);
  748|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (748:7): [True: 0, False: 7.58k]
  ------------------
  749|      0|        return Exiv2::find(trackCodec, key);
  750|    142|      case Video_Audio_CodecName:
  ------------------
  |  Branch (750:7): [True: 142, False: 7.44k]
  ------------------
  751|    142|        return Exiv2::find(codecInfo, key);
  752|     10|      case CodecDownloadURL:
  ------------------
  |  Branch (752:7): [True: 10, False: 7.57k]
  ------------------
  753|    160|      case CodecInfoURL:
  ------------------
  |  Branch (753:7): [True: 150, False: 7.43k]
  ------------------
  754|    160|        return Exiv2::find(codecDownloadUrl, key);
  755|  7.58k|    }
  756|      0|    return nullptr;
  757|  7.58k|  }();

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

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

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

_ZN5Exiv28Internal15Nikon1MakerNote7tagListEv:
   38|    203|  static constexpr auto tagList() {
   39|    203|    return tagInfo_;
   40|    203|  }
_ZN5Exiv28Internal15Nikon2MakerNote7tagListEv:
   71|    446|  static constexpr auto tagList() {
   72|    446|    return tagInfo_;
   73|    446|  }
_ZN5Exiv28Internal15Nikon3MakerNote7tagListEv:
   91|  8.80k|  static constexpr auto tagList() {
   92|  8.80k|    return tagInfo_;
   93|  8.80k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListVrEv:
   95|  1.88k|  static constexpr auto tagListVr() {
   96|  1.88k|    return tagInfoVr_;
   97|  1.88k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListPcEv:
   99|    273|  static constexpr auto tagListPc() {
  100|    273|    return tagInfoPc_;
  101|    273|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListWtEv:
  103|    590|  static constexpr auto tagListWt() {
  104|    590|    return tagInfoWt_;
  105|    590|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListIiEv:
  107|    343|  static constexpr auto tagListIi() {
  108|    343|    return tagInfoIi_;
  109|    343|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListAfEv:
  111|    555|  static constexpr auto tagListAf() {
  112|    555|    return tagInfoAf_;
  113|    555|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf21Ev:
  115|    327|  static constexpr auto tagListAf21() {
  116|    327|    return tagInfoAf21_;
  117|    327|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf22Ev:
  119|    407|  static constexpr auto tagListAf22() {
  120|    407|    return tagInfoAf22_;
  121|    407|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListAFTEv:
  123|    411|  static constexpr auto tagListAFT() {
  124|    411|    return tagInfoAFT_;
  125|    411|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListFiEv:
  127|     11|  static constexpr auto tagListFi() {
  128|     11|    return tagInfoFi_;
  129|     11|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListMeEv:
  131|     11|  static constexpr auto tagListMe() {
  132|     11|    return tagInfoMe_;
  133|     11|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl1Ev:
  135|     35|  static constexpr auto tagListFl1() {
  136|     35|    return tagInfoFl1_;
  137|     35|  }
_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|     43|  static constexpr auto tagListFl6() {
  148|     43|    return tagInfoFl6_;
  149|     43|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl7Ev:
  151|     73|  static constexpr auto tagListFl7() {
  152|     73|    return tagInfoFl7_;
  153|     73|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi1Ev:
  155|     21|  static constexpr auto tagListSi1() {
  156|     21|    return tagInfoSi1_;
  157|     21|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi2Ev:
  159|     15|  static constexpr auto tagListSi2() {
  160|     15|    return tagInfoSi2_;
  161|     15|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi5Ev:
  171|    436|  static constexpr auto tagListSi5() {
  172|    436|    return tagInfoSi5_;
  173|    436|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb1Ev:
  175|      6|  static constexpr auto tagListCb1() {
  176|      6|    return tagInfoCb1_;
  177|      6|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb2Ev:
  179|     13|  static constexpr auto tagListCb2() {
  180|     13|    return tagInfoCb2_;
  181|     13|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2aEv:
  183|     43|  static constexpr auto tagListCb2a() {
  184|     43|    return tagInfoCb2a_;
  185|     43|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2bEv:
  187|    110|  static constexpr auto tagListCb2b() {
  188|    110|    return tagInfoCb2b_;
  189|    110|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb3Ev:
  191|     13|  static constexpr auto tagListCb3() {
  192|     13|    return tagInfoCb3_;
  193|     13|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb4Ev:
  195|     10|  static constexpr auto tagListCb4() {
  196|     10|    return tagInfoCb4_;
  197|     10|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd1Ev:
  199|    323|  static constexpr auto tagListLd1() {
  200|    323|    return tagInfoLd1_;
  201|    323|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd2Ev:
  203|    412|  static constexpr auto tagListLd2() {
  204|    412|    return tagInfoLd2_;
  205|    412|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd3Ev:
  207|    425|  static constexpr auto tagListLd3() {
  208|    425|    return tagInfoLd3_;
  209|    425|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd4Ev:
  211|     92|  static constexpr auto tagListLd4() {
  212|     92|    return tagInfoLd4_;
  213|     92|  }

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

_ZN5Exiv28OrfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   25|     73|    TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ std::move(io), create) {
   26|     73|  setTypeSupported(ImageType::orf, mdExif | mdIptc | mdXmp);
   27|     73|}  // OrfImage::OrfImage
_ZNK5Exiv28OrfImage8mimeTypeEv:
   29|     10|std::string OrfImage::mimeType() const {
   30|     10|  return "image/x-olympus-orf";
   31|     10|}
_ZNK5Exiv28OrfImage10pixelWidthEv:
   33|     53|uint32_t OrfImage::pixelWidth() const {
   34|     53|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   35|     53|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (35:7): [True: 20, False: 33]
  |  Branch (35:7): [True: 10, False: 43]
  |  Branch (35:40): [True: 10, False: 10]
  ------------------
   36|     10|    return imageWidth->toUint32();
   37|     10|  }
   38|     43|  return 0;
   39|     53|}
_ZNK5Exiv28OrfImage11pixelHeightEv:
   41|     53|uint32_t OrfImage::pixelHeight() const {
   42|     53|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   43|     53|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (43:7): [True: 21, False: 32]
  |  Branch (43:7): [True: 11, False: 42]
  |  Branch (43:41): [True: 11, False: 10]
  ------------------
   44|     11|    return imageHeight->toUint32();
   45|     11|  }
   46|     42|  return 0;
   47|     53|}
_ZN5Exiv28OrfImage12readMetadataEv:
   70|     73|void OrfImage::readMetadata() {
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |  std::cerr << "Reading ORF file " << io_->path() << "\n";
   73|       |#endif
   74|     73|  if (io_->open() != 0) {
  ------------------
  |  Branch (74:7): [True: 0, False: 73]
  ------------------
   75|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   76|      0|  }
   77|     73|  IoCloser closer(*io_);
   78|       |  // Ensure that this is the correct image type
   79|     73|  if (!isOrfType(*io_, false)) {
  ------------------
  |  Branch (79:7): [True: 0, False: 73]
  ------------------
   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|     73|  clearMetadata();
   85|     73|  ByteOrder bo = OrfParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
   86|     73|  setByteOrder(bo);
   87|     73|}
_ZN5Exiv29OrfParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  113|     73|ByteOrder OrfParser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  114|     73|  OrfHeader orfHeader;
  115|     73|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::root, TiffMapping::findDecoder,
  116|     73|                                  &orfHeader);
  117|     73|}
_ZN5Exiv214newOrfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  139|     73|Image::UniquePtr newOrfInstance(BasicIo::UniquePtr io, bool create) {
  140|     73|  auto image = std::make_unique<OrfImage>(std::move(io), create);
  141|     73|  if (!image->good()) {
  ------------------
  |  Branch (141:7): [True: 0, False: 73]
  ------------------
  142|      0|    return nullptr;
  143|      0|  }
  144|     73|  return image;
  145|     73|}
_ZN5Exiv29isOrfTypeERNS_7BasicIoEb:
  147|  24.8k|bool isOrfType(BasicIo& iIo, bool advance) {
  148|  24.8k|  const int32_t len = 8;
  149|  24.8k|  byte buf[len];
  150|  24.8k|  iIo.read(buf, len);
  151|  24.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (151:7): [True: 0, False: 24.8k]
  |  Branch (151:22): [True: 258, False: 24.6k]
  ------------------
  152|    258|    return false;
  153|    258|  }
  154|  24.6k|  OrfHeader orfHeader;
  155|  24.6k|  bool rc = orfHeader.read(buf, len);
  156|  24.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (156:7): [True: 24.6k, False: 0]
  |  Branch (156:19): [True: 0, False: 0]
  ------------------
  157|  24.6k|    iIo.seek(-len, BasicIo::cur);
  158|  24.6k|  }
  159|  24.6k|  return rc;
  160|  24.8k|}

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  24.6k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  24.6k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  24.6k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  24.6k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 24.6k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  24.6k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 115, False: 24.5k]
  |  Branch (13:26): [True: 98, False: 17]
  ------------------
   14|     98|    setByteOrder(littleEndian);
   15|  24.5k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 282, False: 24.2k]
  |  Branch (15:33): [True: 253, False: 29]
  ------------------
   16|    253|    setByteOrder(bigEndian);
   17|  24.3k|  } else {
   18|  24.3k|    return false;
   19|  24.3k|  }
   20|       |
   21|    351|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    351|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 319, False: 32]
  |  Branch (22:23): [True: 59, False: 260]
  ------------------
   23|     59|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    292|  sig_ = sig;
   25|    292|  setOffset(getULong(pData + 4, byteOrder()));
   26|    292|  return true;
   27|    351|}

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

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

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

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  31.5k|bool Photoshop::isIrb(const byte* pPsData) {
   28|  31.5k|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 31.5k]
  ------------------
   29|      0|    return false;
   30|       |
   31|  31.5k|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 89.6k, False: 13.8k]
  ------------------
   32|  89.6k|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 17.6k, False: 71.9k]
  ------------------
   33|  17.6k|      return true;
   34|       |
   35|  13.8k|  return false;
   36|  31.5k|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  17.7k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  17.7k|  const byte* record = nullptr;
   40|  17.7k|  uint32_t sizeIptc = 0;
   41|  17.7k|  uint32_t sizeHdr = 0;
   42|  17.7k|  const byte* pCur = pPsData;
   43|  17.7k|  const byte* pEnd = pPsData + sizePsData;
   44|  17.7k|  int ret = 0;
   45|  19.1k|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 19.0k, False: 25]
  |  Branch (45:25): [True: 1.40k, False: 17.6k]
  ------------------
   46|  1.40k|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  1.40k|  }
   48|  17.7k|  return ret >= 0;
   49|  17.7k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  19.7k|                         uint32_t& sizeData) {
   56|  19.7k|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 314, False: 19.4k]
  ------------------
   57|    314|    return 3;
   58|    314|  }
   59|       |
   60|       |  // Used for error checking
   61|  19.4k|  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|  29.7k|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 29.4k, False: 242]
  |  Branch (66:43): [True: 16.1k, False: 13.3k]
  ------------------
   67|  16.1k|    const byte* hrd = pPsData + position;
   68|  16.1k|    position += 4;
   69|  16.1k|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  16.1k|    position += 2;
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |    std::cerr << "0x" << std::hex << type << std::dec << " ";
   73|       |#endif
   74|       |    // Pascal string is padded to have an even size (including size byte)
   75|  16.1k|    byte psSize = pPsData[position] + 1;
   76|  16.1k|    psSize += (psSize & 1);
   77|  16.1k|    position += psSize;
   78|  16.1k|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 317, False: 15.8k]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|    317|      return -2;
   84|    317|    }
   85|  15.8k|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  15.8k|    position += 4;
   87|  15.8k|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 4.04k, False: 11.7k]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|  4.04k|      return -2;
   93|  4.04k|    }
   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|  11.7k|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 1.54k, False: 10.2k]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  1.54k|      sizeData = dataSize;
  105|  1.54k|      sizeHdr = psSize + 10;
  106|  1.54k|      *record = hrd;
  107|  1.54k|      return 0;
  108|  1.54k|    }
  109|       |    // Data size is also padded to be even
  110|  10.2k|    position += dataSize + (dataSize & 1);
  111|  10.2k|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  13.5k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 13.5k, False: 23]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  13.5k|    return -2;
  121|  13.5k|  }
  122|     23|  return 3;
  123|  13.5k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  19.6k|                             uint32_t& sizeData) {
  127|  19.6k|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  19.6k|}
_ZN5Exiv29Photoshop16locatePreviewIrbEPKhmPS2_RjS4_:
  131|    126|                                uint32_t& sizeData) {
  132|    126|  return locateIrb(pPsData, sizePsData, preview_, record, sizeHdr, sizeData);
  133|    126|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|     20|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|     20|  *outWidth = data.read_uint32(0, bigEndian);
   48|     20|  *outHeight = data.read_uint32(4, bigEndian);
   49|     20|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  7.69k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  7.69k|  DataBuf key = keyTXTChunk(data);
   53|  7.69k|  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.69k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 7.13k, False: 563]
  ------------------
   59|  7.13k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  7.69k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  7.69k|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.69k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 0, False: 7.69k]
  ------------------
   74|  7.69k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 10, False: 7.68k]
  ------------------
   75|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  7.68k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  7.68k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 12, False: 7.67k]
  ------------------
   79|     12|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  7.67k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  7.68k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.67k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.67k|  DataBuf arr;
   86|       |
   87|  7.67k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 250, False: 7.42k]
  ------------------
   88|    250|    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|    250|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 11, False: 239]
  ------------------
   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|     11|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     11|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    239|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    239|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 30, False: 209]
  ------------------
  104|     30|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     30|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     30|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     30|    }
  109|  7.42k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 1.55k, False: 5.86k]
  ------------------
  110|  1.55k|    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|  1.55k|    size_t textsize = data.size() - keysize - 1;
  115|  1.55k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 1.36k, False: 192]
  ------------------
  116|  1.36k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  1.36k|      arr = DataBuf(text, textsize);
  119|  1.36k|    }
  120|  5.86k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 5.86k, False: 0]
  ------------------
  121|  5.86k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  5.86k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  5.86k|    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.86k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  5.86k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  5.86k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.79k, False: 71]
  |  Branch (132:40): [True: 46, False: 25]
  ------------------
  133|  5.86k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 46, False: 5.82k]
  ------------------
  134|     46|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  5.86k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  5.86k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  5.86k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  5.86k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  5.86k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  5.86k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  5.86k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  5.86k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  5.86k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  5.86k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  5.86k|    const auto textsize =
  152|  5.86k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  5.86k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 5.78k, False: 84]
  ------------------
  154|  5.78k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  5.78k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 5.75k, False: 33]
  ------------------
  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.75k|        arr = DataBuf(text, textsize);
  162|  5.75k|      } 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|     33|        zlibUncompress(text, textsize, arr);
  170|     33|      }
  171|  5.78k|    }
  172|  5.86k|  } 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.66k|  return arr;
  180|  7.67k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  7.13k|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.13k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 3.83k, False: 3.30k]
  ------------------
  186|  3.83k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 92, False: 3.74k]
  |  Branch (186:57): [True: 1.98k, False: 1.75k]
  ------------------
  187|  2.07k|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 2.00k, False: 70]
  ------------------
  188|  2.00k|    DataBuf exifData = readRawProfile(arr, false);
  189|  2.00k|    size_t length = exifData.size();
  190|       |
  191|  2.00k|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 53, False: 1.95k]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|     53|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|     53|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|     53|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    335|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 282, False: 53]
  ------------------
  200|    282|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 282]
  ------------------
  201|    282|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 282]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|    282|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|     53|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 53]
  ------------------
  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|     53|      } else {
  217|     53|#ifndef SUPPRESS_WARNINGS
  218|     53|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|     53|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 53]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     53|  LogMsg(LogMsg::warn).os()
  ------------------
  219|     53|#endif
  220|     53|        pImage->exifData().clear();
  221|     53|      }
  222|     53|    }
  223|  2.00k|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  7.13k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 3.80k, False: 3.32k]
  |  Branch (227:24): [True: 224, False: 3.57k]
  |  Branch (227:73): [True: 206, False: 18]
  ------------------
  228|    206|    DataBuf psData = readRawProfile(arr, false);
  229|    206|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 67, False: 139]
  ------------------
  230|     67|      Blob iptcBlob;
  231|     67|      const byte* record = nullptr;
  232|     67|      uint32_t sizeIptc = 0;
  233|     67|      uint32_t sizeHdr = 0;
  234|       |
  235|     67|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|     67|      const byte* pCur = psData.c_data();
  237|     67|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 57, False: 10]
  |  Branch (237:29): [True: 0, False: 57]
  ------------------
  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|     67|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 67]
  |  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|     67|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 67, False: 0]
  |  Branch (254:31): [True: 18, False: 49]
  ------------------
  255|     18|#ifndef SUPPRESS_WARNINGS
  256|     18|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     18|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     18|  LogMsg(LogMsg::warn).os()
  ------------------
  257|     18|#endif
  258|     18|        pImage->clearIptcData();
  259|     18|      }
  260|     67|    }  // if (psData.size() > 0)
  261|    206|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  7.13k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 4.07k, False: 3.05k]
  |  Branch (265:24): [True: 920, False: 3.15k]
  |  Branch (265:72): [True: 920, False: 0]
  ------------------
  266|    920|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|    920|    size_t length = xmpBuf.size();
  268|       |
  269|    920|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 565, False: 355]
  ------------------
  270|    565|      std::string& xmpPacket = pImage->xmpPacket();
  271|    565|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|    565|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 226, False: 339]
  |  Branch (272:80): [True: 27, False: 199]
  ------------------
  273|     27|#ifndef SUPPRESS_WARNINGS
  274|     27|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\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()
  ------------------
  275|     27|#endif
  276|     27|        xmpPacket = xmpPacket.substr(idx);
  277|     27|      }
  278|    565|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 565, False: 0]
  ------------------
  279|    565|#ifndef SUPPRESS_WARNINGS
  280|    565|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    565|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 565]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    565|  LogMsg(LogMsg::warn).os()
  ------------------
  281|    565|#endif
  282|    565|      }
  283|    565|    }
  284|    920|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  7.13k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 5.94k, False: 1.18k]
  |  Branch (288:24): [True: 2.02k, False: 3.92k]
  |  Branch (288:69): [True: 2.02k, False: 0]
  |  Branch (288:98): [True: 2.01k, False: 10]
  ------------------
  289|  2.01k|    std::string& xmpPacket = pImage->xmpPacket();
  290|  2.01k|    xmpPacket.assign(arr.c_str(), arr.size());
  291|  2.01k|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 1.82k, False: 182]
  |  Branch (291:78): [True: 810, False: 1.01k]
  ------------------
  292|    810|#ifndef SUPPRESS_WARNINGS
  293|    810|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    810|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 810]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    810|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    810|#endif
  296|    810|      xmpPacket = xmpPacket.substr(idx);
  297|    810|    }
  298|  2.01k|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 333, False: 1.67k]
  ------------------
  299|    333|#ifndef SUPPRESS_WARNINGS
  300|    333|      EXV_WARNING << "Failed to decode XMP metadata.\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()
  ------------------
  301|    333|#endif
  302|    333|    }
  303|  2.01k|  }
  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.13k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 6.23k, False: 894]
  |  Branch (308:7): [True: 94, False: 7.03k]
  |  Branch (308:24): [True: 640, False: 5.59k]
  |  Branch (308:63): [True: 94, False: 546]
  ------------------
  309|     94|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|     94|  }
  311|       |
  312|  7.13k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|     63|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|     63|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|     63|  int zlibResult = Z_BUF_ERROR;
  338|     63|  int dos = 0;
  339|       |
  340|     83|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 83, False: 0]
  ------------------
  341|     83|    arr.alloc(uncompressedLen);
  342|     83|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|     83|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 0, False: 83]
  ------------------
  344|      0|      arr.resize(uncompressedLen);
  345|     83|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 20, False: 63]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     20|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     20|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 0, False: 20]
  ------------------
  350|      0|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|          break;
  352|      0|        uncompressedLen = 131072;
  353|      0|      }
  354|     63|    } else {
  355|       |      // something bad happened
  356|     63|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|     63|    }
  358|     83|  }
  359|       |
  360|      0|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (360:7): [True: 0, False: 0]
  ------------------
  361|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  362|      0|  }
  363|      0|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  469|  3.13k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  3.13k|  DataBuf info;
  471|  3.13k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 72, False: 3.06k]
  ------------------
  472|     72|    return info;
  473|     72|  }
  474|       |
  475|  3.06k|  const unsigned char unhex[103] = {
  476|  3.06k|      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|  3.06k|      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|  3.06k|      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|  3.06k|  };
  480|       |
  481|  3.06k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 3.06k]
  ------------------
  482|      0|    info.alloc(text.size());
  483|      0|    std::copy(text.begin(), text.end(), info.begin());
  484|      0|    return info;
  485|      0|  }
  486|       |
  487|  3.06k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  3.06k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  3.06k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 58, False: 3.00k]
  ------------------
  491|     58|    return info;
  492|     58|  }
  493|       |
  494|       |  // Look for newline
  495|  56.1k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 53.2k, False: 2.90k]
  ------------------
  496|  53.2k|    sp++;
  497|  53.2k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 105, False: 53.0k]
  ------------------
  498|    105|      return info;
  499|    105|    }
  500|  53.2k|  }
  501|  2.90k|  sp++;  // step over '\n'
  502|  2.90k|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 67, False: 2.83k]
  ------------------
  503|     67|    return info;
  504|     67|  }
  505|       |
  506|       |  // Look for length
  507|   100k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 8.52k, False: 92.0k]
  |  Branch (507:25): [True: 77.4k, False: 14.6k]
  |  Branch (507:39): [True: 12.0k, False: 2.63k]
  ------------------
  508|  97.9k|    sp++;
  509|  97.9k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 203, False: 97.7k]
  ------------------
  510|    203|      return info;
  511|    203|    }
  512|  97.9k|  }
  513|       |
  514|       |  // Parse the length.
  515|  2.63k|  size_t length = 0;
  516|  6.03k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 3.93k, False: 2.10k]
  |  Branch (516:24): [True: 3.47k, False: 459]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  3.47k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  3.47k|    length = newlength;
  520|  3.47k|    sp++;
  521|  3.47k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 69, False: 3.40k]
  ------------------
  522|     69|      return info;
  523|     69|    }
  524|  3.47k|  }
  525|  2.56k|  sp++;  // step over '\n'
  526|  2.56k|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 396, False: 2.16k]
  ------------------
  527|    396|    return info;
  528|    396|  }
  529|       |
  530|  2.16k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|  2.16k|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 929, False: 1.23k]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|    929|  }
  538|  2.16k|  info.alloc(length);
  539|  2.16k|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 2.16k]
  ------------------
  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|  2.16k|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 929, False: 1.23k]
  ------------------
  547|    929|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|  1.23k|  unsigned char* dp = info.data();  // decode pointer
  551|  1.23k|  size_t nibbles = length * 2;
  552|       |
  553|  9.31k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 8.48k, False: 831]
  ------------------
  554|  8.48k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  16.4k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 3.33k, False: 13.1k]
  |  Branch (555:26): [True: 7.44k, False: 5.67k]
  |  Branch (555:39): [True: 2.28k, False: 5.16k]
  |  Branch (555:53): [True: 2.79k, False: 8.04k]
  ------------------
  556|  8.38k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 405, False: 7.97k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|    405|        return {};
  561|    405|      }
  562|       |
  563|  7.97k|      sp++;
  564|  7.97k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  7.97k|    }
  566|       |
  567|  8.08k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 4.03k, False: 4.04k]
  ------------------
  568|  4.03k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  4.04k|    else
  570|  4.04k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  8.08k|  }
  572|       |
  573|    831|  return info;
  574|       |
  575|  1.23k|}  // PngChunk::readRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   56|  1.18k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
   57|  1.18k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.18k]
  |  Branch (57:17): [True: 0, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|      0|    IoCloser closer(*io_);
   62|      0|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 0]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|      0|  }
   68|  1.18k|}
_ZNK5Exiv28PngImage8mimeTypeEv:
   70|      3|std::string PngImage::mimeType() const {
   71|      3|  return "image/png";
   72|      3|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.18k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.18k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.18k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.18k|  IoCloser closer(*io_);
  400|  1.18k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.18k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.18k|  clearMetadata();
  404|       |
  405|  1.18k|  const size_t imgSize = io_->size();
  406|  1.18k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  26.6k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 26.1k, False: 496]
  ------------------
  409|  26.1k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  26.1k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  26.1k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 365, False: 25.7k]
  ------------------
  414|    365|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    365|    }
  416|       |
  417|  25.7k|    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|  25.7k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 132, False: 25.6k]
  |  Branch (424:32): [True: 86, False: 25.5k]
  |  Branch (424:55): [True: 1.56k, False: 23.9k]
  |  Branch (424:78): [True: 255, False: 23.7k]
  ------------------
  425|  23.7k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 210, False: 23.5k]
  |  Branch (425:32): [True: 5.87k, False: 17.6k]
  |  Branch (425:55): [True: 1.52k, False: 16.1k]
  ------------------
  426|  9.53k|      DataBuf chunkData(chunkLength);
  427|  9.53k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 9.32k, False: 209]
  ------------------
  428|  9.32k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  9.32k|      }
  430|       |
  431|  9.53k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 10, False: 9.52k]
  ------------------
  432|     10|        return;  // Last chunk found: we stop parsing.
  433|     10|      }
  434|  9.52k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 86, False: 9.43k]
  |  Branch (434:34): [True: 20, False: 66]
  ------------------
  435|     20|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  9.50k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 1.56k, False: 7.93k]
  ------------------
  437|  1.56k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  7.93k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 255, False: 7.68k]
  ------------------
  439|    255|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  7.68k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 5.87k, False: 1.80k]
  ------------------
  441|  5.87k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  5.87k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 210, False: 1.59k]
  ------------------
  443|    210|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    210|        setByteOrder(bo);
  445|  1.59k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 1.52k, False: 66]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|  1.52k|        uint32_t iccOffset = 0;
  448|  8.08k|        do {
  449|  8.08k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 8.08k, False: 6]
  |  Branch (449:37): [True: 8.06k, False: 13]
  ------------------
  450|  8.08k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 6.55k, False: 1.52k]
  ------------------
  451|       |
  452|  1.52k|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|  1.52k|        ++iccOffset;  // +1 = 'compressed' flag
  454|  1.52k|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|  1.52k|        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|  1.52k|      }
  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|  9.52k|      chunkLength = 0;
  466|  9.52k|    }
  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|  25.7k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  25.7k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 496, False: 25.2k]
  |  Branch (473:25): [True: 316, False: 24.9k]
  ------------------
  474|    316|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    316|    }
  476|  25.7k|  }
  477|  1.18k|}  // PngImage::readMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  684|  1.18k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, bool create) {
  685|  1.18k|  auto image = std::make_unique<PngImage>(std::move(io), create);
  686|  1.18k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.18k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.18k|  return image;
  690|  1.18k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  27.0k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  27.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 27.0k]
  |  Branch (693:22): [True: 258, False: 26.7k]
  ------------------
  694|    258|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    258|  }
  696|  26.7k|  const int32_t len = 8;
  697|  26.7k|  std::array<byte, len> buf;
  698|  26.7k|  iIo.read(buf.data(), len);
  699|  26.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 26.7k]
  |  Branch (699:22): [True: 0, False: 26.7k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  26.7k|  bool rc = buf == pngSignature;
  703|  26.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 25.5k, False: 1.18k]
  |  Branch (703:19): [True: 0, False: 1.18k]
  ------------------
  704|  25.5k|    iIo.seek(-len, BasicIo::cur);
  705|  25.5k|  }
  706|       |
  707|  26.7k|  return rc;
  708|  26.7k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|  1.49k|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|  1.49k|  uLongf uncompressedLen = length;  // just a starting point
   76|  1.49k|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  3.45k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 1.95k, False: 1.49k]
  ------------------
   79|  1.95k|    result.alloc(uncompressedLen);
   80|  1.95k|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|  1.95k|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.95k]
  |  Branch (82:31): [True: 0, False: 0]
  ------------------
   83|      0|      result.reset();
   84|       |
   85|      0|      result.alloc(uncompressedLen);
   86|      0|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|      0|    }
   88|  1.95k|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 454, False: 1.49k]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    454|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    454|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 454]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    454|      else
   96|    454|        uncompressedLen *= 2;
   97|    454|    }
   98|  1.95k|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|  1.49k|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  35.4k|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.4k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  35.4k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 35.4k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  35.4k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 122, False: 35.3k]
  ------------------
  388|    122|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|    122|  }
  390|  35.4k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  954|      7|    properties_(std::move(properties)), preview_(std::move(data)) {
  955|      7|}
_ZNK5Exiv212PreviewImage5pDataEv:
  981|      7|const byte* PreviewImage::pData() const {
  982|      7|  return preview_.c_data();
  983|      7|}
_ZNK5Exiv212PreviewImage4sizeEv:
  985|      7|uint32_t PreviewImage::size() const {
  986|      7|  return static_cast<uint32_t>(preview_.size());
  987|      7|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1009|  18.0k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1010|  18.0k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1012|  18.0k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1013|  18.0k|  PreviewPropertiesList list;
 1014|       |  // go through the loader table and store all successfully created loaders in the list
 1015|   629k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1015:26): [True: 611k, False: 18.0k]
  ------------------
 1016|   611k|    auto loader = Loader::create(id, image_);
 1017|   611k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1017:9): [True: 15.5k, False: 596k]
  |  Branch (1017:19): [True: 10.1k, False: 5.35k]
  ------------------
 1018|  10.1k|      PreviewProperties props = loader->getProperties();
 1019|  10.1k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1020|  10.1k|      props.size_ = buf.size();         //     update the size
 1021|  10.1k|      list.push_back(std::move(props));
 1022|  10.1k|    }
 1023|   611k|  }
 1024|  18.0k|  std::sort(list.begin(), list.end(),
 1025|  18.0k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1026|       |
 1027|  18.0k|  return list;
 1028|  18.0k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1030|      7|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1031|      7|  auto loader = Loader::create(properties.id_, image_);
 1032|      7|  DataBuf buf;
 1033|      7|  if (loader) {
  ------------------
  |  Branch (1033:7): [True: 7, False: 0]
  ------------------
 1034|      7|    buf = loader->getData();
 1035|      7|  }
 1036|       |
 1037|      7|  return {properties, std::move(buf)};
 1038|      7|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  342|  1.24M|PreviewId Loader::getNumLoaders() {
  343|  1.24M|  return PreviewId{std::size(loaderList_)};
  344|  1.24M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  360|  72.2k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  361|  72.2k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  362|  72.2k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  346|  72.2k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  347|  72.2k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (347:7): [True: 0, False: 72.2k]
  |  Branch (347:21): [True: 69.4k, False: 2.74k]
  ------------------
  348|  69.4k|    return;
  349|  2.74k|  nativePreview_ = image.nativePreviews()[parIdx];
  350|  2.74k|  width_ = nativePreview_.width_;
  351|  2.74k|  height_ = nativePreview_.height_;
  352|  2.74k|  valid_ = true;
  353|  2.74k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (353:7): [True: 2.68k, False: 63]
  ------------------
  354|  2.68k|    size_ = nativePreview_.size_;
  355|  2.68k|  } else {
  356|     63|    size_ = getData().size();
  357|     63|  }
  358|  2.74k|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  335|   557k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  336|   557k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  338|  10.1k|PreviewProperties Loader::getProperties() const {
  339|  10.1k|  return {"", "", size_, width_, height_, id_};
  340|  10.1k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   69|  4.78k|  virtual bool readDimensions() {
   70|  4.78k|    return true;
   71|  4.78k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   46|   557k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   58|   575k|  [[nodiscard]] virtual bool valid() const {
   59|   575k|    return valid_;
   60|   575k|  }
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative13getPropertiesEv:
  364|  2.59k|PreviewProperties LoaderNative::getProperties() const {
  365|  2.59k|  PreviewProperties prop = Loader::getProperties();
  366|  2.59k|  prop.mimeType_ = nativePreview_.mimeType_;
  367|  2.59k|  if (nativePreview_.mimeType_ == "image/jpeg") {
  ------------------
  |  Branch (367:7): [True: 2.20k, False: 383]
  ------------------
  368|  2.20k|    prop.extension_ = ".jpg";
  369|  2.20k|  } else if (nativePreview_.mimeType_ == "image/tiff") {
  ------------------
  |  Branch (369:14): [True: 2, False: 381]
  ------------------
  370|      2|    prop.extension_ = ".tif";
  371|    381|  } else if (nativePreview_.mimeType_ == "image/x-wmf") {
  ------------------
  |  Branch (371:14): [True: 2, False: 379]
  ------------------
  372|      2|    prop.extension_ = ".wmf";
  373|    379|  } else if (nativePreview_.mimeType_ == "image/x-portable-anymap") {
  ------------------
  |  Branch (373:14): [True: 0, False: 379]
  ------------------
  374|      0|    prop.extension_ = ".pnm";
  375|    379|  } else {
  376|    379|#ifndef SUPPRESS_WARNINGS
  377|    379|    EXV_WARNING << "Unknown native preview format: " << nativePreview_.mimeType_ << "\n";
  ------------------
  |  |  138|    379|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 379]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    379|  LogMsg(LogMsg::warn).os()
  ------------------
  378|    379|#endif
  379|    379|    prop.extension_ = ".dat";
  380|    379|  }
  381|  2.59k|  return prop;
  382|  2.59k|}
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative7getDataEv:
  384|  3.43k|DataBuf LoaderNative::getData() const {
  385|  3.43k|  if (!valid())
  ------------------
  |  Branch (385:7): [True: 0, False: 3.43k]
  ------------------
  386|      0|    return {};
  387|       |
  388|  3.43k|  BasicIo& io = image_.io();
  389|  3.43k|  if (io.open() != 0) {
  ------------------
  |  Branch (389:7): [True: 0, False: 3.43k]
  ------------------
  390|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  391|      0|  }
  392|  3.43k|  IoCloser closer(io);
  393|  3.43k|  const byte* data = io.mmap();
  394|  3.43k|  if (io.size() < nativePreview_.position_ + nativePreview_.size_) {
  ------------------
  |  Branch (394:7): [True: 980, False: 2.45k]
  ------------------
  395|    980|#ifndef SUPPRESS_WARNINGS
  396|    980|    EXV_WARNING << "Invalid native preview position or size.\n";
  ------------------
  |  |  138|    980|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 980]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    980|  LogMsg(LogMsg::warn).os()
  ------------------
  397|    980|#endif
  398|    980|    return {};
  399|    980|  }
  400|  2.45k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (400:7): [True: 2.32k, False: 126]
  ------------------
  401|  2.32k|    return {data + nativePreview_.position_, nativePreview_.size_};
  402|  2.32k|  }
  403|    126|  if (nativePreview_.filter_ == "hex-ai7thumbnail-pnm") {
  ------------------
  |  Branch (403:7): [True: 0, False: 126]
  ------------------
  404|      0|    const DataBuf ai7thumbnail = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  405|      0|    const DataBuf rgb = decodeAi7Thumbnail(ai7thumbnail);
  406|      0|    return makePnm(width_, height_, rgb);
  407|      0|  }
  408|    126|  if (nativePreview_.filter_ == "hex-irb") {
  ------------------
  |  Branch (408:7): [True: 126, False: 0]
  ------------------
  409|    126|    const DataBuf psData = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  410|    126|    const byte* record;
  411|    126|    uint32_t sizeHdr = 0;
  412|    126|    uint32_t sizeData = 0;
  413|    126|    if (Photoshop::locatePreviewIrb(psData.c_data(), psData.size(), &record, sizeHdr, sizeData) != 0) {
  ------------------
  |  Branch (413:9): [True: 126, False: 0]
  ------------------
  414|    126|#ifndef SUPPRESS_WARNINGS
  415|    126|      EXV_WARNING << "Missing preview IRB in Photoshop EPS preview.\n";
  ------------------
  |  |  138|    126|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 126]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    126|  LogMsg(LogMsg::warn).os()
  ------------------
  416|    126|#endif
  417|    126|      return {};
  418|    126|    }
  419|      0|    Internal::enforce(sizeData >= 28, ErrorCode::kerCorruptedMetadata);
  420|      0|    return {record + sizeHdr + 28, sizeData - 28};
  421|    126|  }
  422|      0|  throw Error(ErrorCode::kerErrorMessage, "Invalid native preview filter: ", nativePreview_.filter_);
  423|    126|}
preview.cpp:_ZN12_GLOBAL__N_19decodeHexEPKhm:
  813|    126|DataBuf decodeHex(const byte* src, size_t srcSize) {
  814|       |  // create decoding table
  815|    126|  byte invalid = 16;
  816|    126|  std::array<byte, 256> decodeHexTable;
  817|    126|  decodeHexTable.fill(invalid);
  818|  1.38k|  for (byte i = 0; i < 10; i++)
  ------------------
  |  Branch (818:20): [True: 1.26k, False: 126]
  ------------------
  819|  1.26k|    decodeHexTable[static_cast<byte>('0') + i] = i;
  820|    882|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (820:20): [True: 756, False: 126]
  ------------------
  821|    756|    decodeHexTable[static_cast<byte>('A') + i] = i + 10;
  822|    882|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (822:20): [True: 756, False: 126]
  ------------------
  823|    756|    decodeHexTable[static_cast<byte>('a') + i] = i + 10;
  824|       |
  825|       |  // calculate dest size
  826|    126|  long validSrcSize = 0;
  827|  10.4M|  for (size_t srcPos = 0; srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (827:27): [True: 10.4M, False: 126]
  ------------------
  828|  10.4M|    if (decodeHexTable[src[srcPos]] != invalid)
  ------------------
  |  Branch (828:9): [True: 9.16M, False: 1.32M]
  ------------------
  829|  9.16M|      validSrcSize++;
  830|  10.4M|  }
  831|    126|  const size_t destSize = validSrcSize / 2;
  832|       |
  833|       |  // allocate dest buffer
  834|    126|  DataBuf dest(destSize);
  835|       |
  836|       |  // decode
  837|  4.58M|  for (size_t srcPos = 0, destPos = 0; destPos < destSize; destPos++) {
  ------------------
  |  Branch (837:40): [True: 4.58M, False: 126]
  ------------------
  838|  4.58M|    byte buffer = 0;
  839|  15.0M|    for (int bufferPos = 1; bufferPos >= 0 && srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (839:29): [True: 10.4M, False: 4.58M]
  |  Branch (839:47): [True: 10.4M, False: 0]
  ------------------
  840|  10.4M|      byte srcValue = decodeHexTable[src[srcPos]];
  841|  10.4M|      if (srcValue == invalid)
  ------------------
  |  Branch (841:11): [True: 1.32M, False: 9.16M]
  ------------------
  842|  1.32M|        continue;
  843|  9.16M|      buffer |= srcValue << (bufferPos * 4);
  844|  9.16M|      bufferPos--;
  845|  9.16M|    }
  846|  4.58M|    dest.write_uint8(destPos, buffer);
  847|  4.58M|  }
  848|    126|  return dest;
  849|    126|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNative14readDimensionsEv:
  425|  2.74k|bool LoaderNative::readDimensions() {
  426|  2.74k|  if (!valid())
  ------------------
  |  Branch (426:7): [True: 0, False: 2.74k]
  ------------------
  427|      0|    return false;
  428|  2.74k|  if (width_ != 0 || height_ != 0)
  ------------------
  |  Branch (428:7): [True: 1.56k, False: 1.17k]
  |  Branch (428:22): [True: 403, False: 775]
  ------------------
  429|  1.97k|    return true;
  430|       |
  431|    775|  const DataBuf data = getData();
  432|    775|  if (data.empty())
  ------------------
  |  Branch (432:7): [True: 99, False: 676]
  ------------------
  433|     99|    return false;
  434|       |
  435|    676|  try {
  436|    676|    auto image = ImageFactory::open(data.c_data(), data.size());
  437|    676|    if (!image)
  ------------------
  |  Branch (437:9): [True: 0, False: 676]
  ------------------
  438|      0|      return false;
  439|    676|    image->readMetadata();
  440|       |
  441|    676|    width_ = image->pixelWidth();
  442|    676|    height_ = image->pixelHeight();
  443|    676|  } catch (const Error& /* error */) {
  444|     51|#ifndef SUPPRESS_WARNINGS
  445|     51|    EXV_WARNING << "Invalid native preview image.\n";
  ------------------
  |  |  138|     51|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 51]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     51|  LogMsg(LogMsg::warn).os()
  ------------------
  446|     51|#endif
  447|     51|    return false;
  448|     51|  }
  449|    621|  return true;
  450|    676|}
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  553|   198k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  554|   198k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  555|   198k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  540|   198k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  541|   198k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (541:55): [True: 678, False: 198k]
  ------------------
  542|    678|    size_ = pos->sizeDataArea();  // indirect data
  543|    678|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (543:9): [True: 555, False: 123]
  |  Branch (543:23): [True: 63, False: 492]
  ------------------
  544|     63|      size_ = pos->size();  // direct data
  545|    678|  }
  546|       |
  547|   198k|  if (size_ == 0)
  ------------------
  |  Branch (547:7): [True: 198k, False: 170]
  ------------------
  548|   198k|    return;
  549|       |
  550|    170|  valid_ = true;
  551|    170|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  557|     13|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  558|     13|  PreviewProperties prop = Loader::getProperties();
  559|     13|  prop.mimeType_ = "image/jpeg";
  560|     13|  prop.extension_ = ".jpg";
  561|     13|  return prop;
  562|     13|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  564|    183|DataBuf LoaderExifDataJpeg::getData() const {
  565|    183|  DataBuf buf;
  566|       |
  567|    183|  if (!valid())
  ------------------
  |  Branch (567:7): [True: 0, False: 183]
  ------------------
  568|      0|    return buf;
  569|       |
  570|    183|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (570:55): [True: 183, False: 0]
  ------------------
  571|    183|    buf = pos->dataArea();  // indirect data
  572|       |
  573|    183|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (573:9): [True: 56, False: 127]
  ------------------
  574|     56|      buf = DataBuf(pos->size());
  575|     56|      pos->copy(buf.data(), invalidByteOrder);
  576|     56|    }
  577|       |
  578|    183|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  579|    183|    return buf;
  580|    183|  }
  581|       |
  582|      0|  return buf;
  583|    183|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  585|    163|bool LoaderExifDataJpeg::readDimensions() {
  586|    163|  if (!valid())
  ------------------
  |  Branch (586:7): [True: 0, False: 163]
  ------------------
  587|      0|    return false;
  588|       |
  589|    163|  DataBuf buf = getData();
  590|    163|  if (buf.empty())
  ------------------
  |  Branch (590:7): [True: 0, False: 163]
  ------------------
  591|      0|    return false;
  592|       |
  593|    163|  try {
  594|    163|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  595|    163|    if (!image)
  ------------------
  |  Branch (595:9): [True: 0, False: 163]
  ------------------
  596|      0|      return false;
  597|    163|    image->readMetadata();
  598|       |
  599|    163|    width_ = image->pixelWidth();
  600|    163|    height_ = image->pixelHeight();
  601|    163|  } catch (const Error& /* error */) {
  602|    150|    return false;
  603|    150|  }
  604|       |
  605|     13|  return true;
  606|    163|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  666|   126k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  667|   126k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  668|   126k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  609|   126k|    Loader(id, image), group_(param_[parIdx].group_) {
  610|   126k|  const ExifData& exifData = image_.exifData();
  611|       |
  612|   126k|  size_t offsetCount = 0;
  613|   126k|  ExifData::const_iterator pos;
  614|       |
  615|       |  // check if the group_ contains a preview image
  616|   126k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (616:7): [True: 107k, False: 18.0k]
  ------------------
  617|   107k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  618|   107k|    if (pos == exifData.end())
  ------------------
  |  Branch (618:9): [True: 102k, False: 5.55k]
  ------------------
  619|   102k|      return;
  620|  5.55k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (620:9): [True: 5.55k, False: 0]
  |  Branch (620:9): [True: 924, False: 4.63k]
  |  Branch (620:39): [True: 924, False: 4.63k]
  ------------------
  621|    924|      return;
  622|  5.55k|  }
  623|       |
  624|  22.6k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  625|  22.6k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (625:7): [True: 4.93k, False: 17.7k]
  ------------------
  626|  4.93k|    offsetTag_ = "StripOffsets";
  627|  4.93k|    sizeTag_ = "StripByteCounts";
  628|  4.93k|    offsetCount = pos->value().count();
  629|  17.7k|  } else {
  630|  17.7k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  631|  17.7k|    if (pos == exifData.end())
  ------------------
  |  Branch (631:9): [True: 17.4k, False: 291]
  ------------------
  632|  17.4k|      return;
  633|    291|    offsetTag_ = "TileOffsets";
  634|    291|    sizeTag_ = "TileByteCounts";
  635|    291|    offsetCount = pos->value().count();
  636|    291|  }
  637|       |
  638|  5.22k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  639|  5.22k|  if (pos == exifData.end())
  ------------------
  |  Branch (639:7): [True: 156, False: 5.07k]
  ------------------
  640|    156|    return;
  641|  5.07k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (641:7): [True: 53, False: 5.01k]
  ------------------
  642|     53|    return;
  643|  28.5k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (643:22): [True: 23.4k, False: 5.01k]
  ------------------
  644|  23.4k|    size_ += pos->toUint32(i);
  645|  23.4k|  }
  646|       |
  647|  5.01k|  if (size_ == 0)
  ------------------
  |  Branch (647:7): [True: 63, False: 4.95k]
  ------------------
  648|     63|    return;
  649|       |
  650|  4.95k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  651|  4.95k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (651:7): [True: 4.87k, False: 82]
  |  Branch (651:7): [True: 4.82k, False: 128]
  |  Branch (651:32): [True: 4.82k, False: 46]
  ------------------
  652|  4.82k|    width_ = pos->toUint32();
  653|  4.82k|  }
  654|       |
  655|  4.95k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  656|  4.95k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (656:7): [True: 4.88k, False: 69]
  |  Branch (656:7): [True: 4.84k, False: 113]
  |  Branch (656:32): [True: 4.84k, False: 44]
  ------------------
  657|  4.84k|    height_ = pos->toUint32();
  658|  4.84k|  }
  659|       |
  660|  4.95k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (660:7): [True: 141, False: 4.81k]
  |  Branch (660:22): [True: 32, False: 4.78k]
  ------------------
  661|    173|    return;
  662|       |
  663|  4.78k|  valid_ = true;
  664|  4.78k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  670|  4.78k|PreviewProperties LoaderTiff::getProperties() const {
  671|  4.78k|  PreviewProperties prop = Loader::getProperties();
  672|  4.78k|  prop.mimeType_ = "image/tiff";
  673|  4.78k|  prop.extension_ = ".tif";
  674|  4.78k|  return prop;
  675|  4.78k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  677|  4.78k|DataBuf LoaderTiff::getData() const {
  678|  4.78k|  const ExifData& exifData = image_.exifData();
  679|       |
  680|  4.78k|  ExifData preview;
  681|       |
  682|       |  // copy tags
  683|   786k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (683:19): [True: 786k, False: 4.78k]
  ------------------
  684|   786k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (684:9): [True: 241k, False: 545k]
  ------------------
  685|       |      /*
  686|       |         Write only the necessary TIFF image tags
  687|       |         tags that especially could cause problems are:
  688|       |         "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
  689|       |         "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
  690|       |                         consistent result for all previews, including JPEG
  691|       |      */
  692|   241k|      uint16_t tag = pos.tag();
  693|   241k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (693:11): [True: 236k, False: 5.07k]
  |  Branch (693:28): [True: 235k, False: 463]
  |  Branch (693:45): [True: 151k, False: 84.7k]
  ------------------
  694|   151k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  695|   151k|      }
  696|   241k|    }
  697|   786k|  }
  698|       |
  699|  4.78k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  700|       |
  701|  4.78k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (701:7): [True: 4.55k, False: 224]
  ------------------
  702|       |    // image data are not available via exifData, read them from image_.io()
  703|  4.55k|    BasicIo& io = image_.io();
  704|       |
  705|  4.55k|    if (io.open() != 0) {
  ------------------
  |  Branch (705:9): [True: 0, False: 4.55k]
  ------------------
  706|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  707|      0|    }
  708|  4.55k|    IoCloser closer(io);
  709|       |
  710|  4.55k|    const Exiv2::byte* base = io.mmap();
  711|       |
  712|  4.55k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  713|       |
  714|  4.55k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (714:9): [True: 4.55k, False: 0]
  ------------------
  715|  4.55k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (715:11): [True: 4.37k, False: 187]
  ------------------
  716|       |        // this saves one copying of the buffer
  717|  4.37k|        uint32_t offset = dataValue.toUint32(0);
  718|  4.37k|        uint32_t size = sizes.toUint32(0);
  719|  4.37k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (719:13): [True: 2.58k, False: 1.78k]
  ------------------
  720|  2.58k|          dataValue.setDataArea(base + offset, size);
  721|  4.37k|      } else {
  722|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  723|    187|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  724|    187|        DataBuf buf(size_);
  725|    187|        uint32_t idxBuf = 0;
  726|  11.1k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (726:28): [True: 10.9k, False: 187]
  ------------------
  727|  10.9k|          uint32_t offset = dataValue.toUint32(i);
  728|  10.9k|          uint32_t size = sizes.toUint32(i);
  729|       |
  730|       |          // the size_ parameter is originally computed by summing all values inside sizes
  731|       |          // see the constructor of LoaderTiff
  732|       |          // But e.g in malicious files some of these values could be negative
  733|       |          // That's why we check again for each step here to really make sure we don't overstep
  734|  10.9k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  735|  10.9k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (735:15): [True: 5.48k, False: 5.46k]
  |  Branch (735:28): [True: 3.21k, False: 2.26k]
  ------------------
  736|  3.21k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  737|  3.21k|          }
  738|       |
  739|  10.9k|          idxBuf += size;
  740|  10.9k|        }
  741|    187|        dataValue.setDataArea(buf.c_data(), buf.size());
  742|    187|      }
  743|  4.55k|    }
  744|  4.55k|  }
  745|       |
  746|       |  // Fix compression value in the CR2 IFD2 image
  747|  4.78k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (747:7): [True: 2, False: 4.78k]
  |  Branch (747:7): [True: 2, False: 4.78k]
  |  Branch (747:40): [True: 2, False: 0]
  ------------------
  748|      2|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  749|      2|  }
  750|       |
  751|       |  // write new image
  752|  4.78k|  MemIo mio;
  753|  4.78k|  IptcData emptyIptc;
  754|  4.78k|  XmpData emptyXmp;
  755|  4.78k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  756|  4.78k|  return {mio.mmap(), mio.size()};
  757|  4.78k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  481|   143k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  482|   143k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  483|   143k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  452|   143k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  453|   143k|  const ExifData& exifData = image_.exifData();
  454|   143k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  455|   143k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (455:7): [True: 9.40k, False: 133k]
  |  Branch (455:7): [True: 8.25k, False: 134k]
  |  Branch (455:32): [True: 8.25k, False: 1.15k]
  ------------------
  456|  8.25k|    offset_ = pos->toUint32();
  457|  8.25k|  }
  458|       |
  459|   143k|  size_ = 0;
  460|   143k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  461|   143k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (461:7): [True: 10.6k, False: 132k]
  |  Branch (461:7): [True: 8.39k, False: 134k]
  |  Branch (461:32): [True: 8.39k, False: 2.28k]
  ------------------
  462|  8.39k|    size_ = pos->toUint32();
  463|  8.39k|  }
  464|       |
  465|   143k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (465:7): [True: 134k, False: 8.13k]
  |  Branch (465:23): [True: 170, False: 7.96k]
  ------------------
  466|   135k|    return;
  467|       |
  468|  7.96k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (468:7): [True: 2, False: 7.96k]
  ------------------
  469|      2|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  470|      2|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:9): [True: 2, False: 0]
  |  Branch (470:9): [True: 2, False: 0]
  |  Branch (470:34): [True: 2, False: 0]
  ------------------
  471|      2|      offset_ += pos->toUint32();
  472|      2|    }
  473|      2|  }
  474|       |
  475|  7.96k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (475:7): [True: 151, False: 7.81k]
  ------------------
  476|    151|    return;
  477|       |
  478|  7.81k|  valid_ = true;
  479|  7.81k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  485|  2.76k|PreviewProperties LoaderExifJpeg::getProperties() const {
  486|  2.76k|  PreviewProperties prop = Loader::getProperties();
  487|  2.76k|  prop.mimeType_ = "image/jpeg";
  488|  2.76k|  prop.extension_ = ".jpg";
  489|  2.76k|  return prop;
  490|  2.76k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  492|  2.76k|DataBuf LoaderExifJpeg::getData() const {
  493|  2.76k|  if (!valid())
  ------------------
  |  Branch (493:7): [True: 0, False: 2.76k]
  ------------------
  494|      0|    return {};
  495|  2.76k|  BasicIo& io = image_.io();
  496|       |
  497|  2.76k|  if (io.open() != 0) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.76k]
  ------------------
  498|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  499|      0|  }
  500|  2.76k|  IoCloser closer(io);
  501|       |
  502|  2.76k|  const Exiv2::byte* base = io.mmap();
  503|       |
  504|  2.76k|  return {base + offset_, size_};
  505|  2.76k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  507|  7.81k|bool LoaderExifJpeg::readDimensions() {
  508|  7.81k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 7.81k]
  ------------------
  509|      0|    return false;
  510|  7.81k|  if (width_ || height_)
  ------------------
  |  Branch (510:7): [True: 0, False: 7.81k]
  |  Branch (510:17): [True: 0, False: 7.81k]
  ------------------
  511|      0|    return true;
  512|       |
  513|  7.81k|  BasicIo& io = image_.io();
  514|       |
  515|  7.81k|  if (io.open() != 0) {
  ------------------
  |  Branch (515:7): [True: 0, False: 7.81k]
  ------------------
  516|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  517|      0|  }
  518|  7.81k|  IoCloser closer(io);
  519|  7.81k|  const Exiv2::byte* base = io.mmap();
  520|       |
  521|  7.81k|  try {
  522|  7.81k|    auto image = ImageFactory::open(base + offset_, size_);
  523|  7.81k|    if (!image)
  ------------------
  |  Branch (523:9): [True: 0, False: 7.81k]
  ------------------
  524|      0|      return false;
  525|  7.81k|    image->readMetadata();
  526|       |
  527|  7.81k|    width_ = image->pixelWidth();
  528|  7.81k|    height_ = image->pixelHeight();
  529|  7.81k|  } catch (const Error& /* error */) {
  530|  5.03k|#ifndef SUPPRESS_WARNINGS
  531|  5.03k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  5.03k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.03k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.03k|  LogMsg(LogMsg::warn).os()
  ------------------
  532|  5.03k|#endif
  533|  5.03k|    return false;
  534|  5.03k|  }
  535|       |
  536|  2.76k|  return true;
  537|  7.81k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  792|  17.8k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  793|  17.8k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  794|  17.8k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  759|  17.8k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  760|  17.8k|  (void)parIdx;
  761|       |
  762|  17.8k|  const XmpData& xmpData = image_.xmpData();
  763|       |
  764|  17.8k|  std::string prefix = "xmpGImg";
  765|  17.8k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (765:7): [True: 0, False: 17.8k]
  ------------------
  766|      0|    prefix = "xapGImg";
  767|      0|  }
  768|       |
  769|  17.8k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  770|  17.8k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (770:7): [True: 17.8k, False: 0]
  ------------------
  771|  17.8k|    return;
  772|      0|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  773|      0|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (773:7): [True: 0, False: 0]
  ------------------
  774|      0|    return;
  775|      0|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  776|      0|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (776:7): [True: 0, False: 0]
  ------------------
  777|      0|    return;
  778|      0|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  779|      0|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (779:7): [True: 0, False: 0]
  ------------------
  780|      0|    return;
  781|       |
  782|      0|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (782:7): [True: 0, False: 0]
  ------------------
  783|      0|    return;
  784|       |
  785|      0|  width_ = widthDatum->toUint32();
  786|      0|  height_ = heightDatum->toUint32();
  787|      0|  preview_ = decodeBase64(imageDatum->toString());
  788|      0|  size_ = preview_.size();
  789|      0|  valid_ = true;
  790|      0|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  320|   611k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  321|   611k|  Loader::UniquePtr loader;
  322|   611k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (322:7): [True: 0, False: 611k]
  |  Branch (322:17): [True: 0, False: 611k]
  ------------------
  323|      0|    return loader;
  324|       |
  325|   611k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (325:7): [True: 53.8k, False: 557k]
  |  Branch (325:7): [True: 53.5k, False: 557k]
  |  Branch (325:41): [True: 53.5k, False: 239]
  ------------------
  326|  53.5k|    return loader;
  327|       |
  328|   557k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  329|   557k|  if (!loader->valid())
  ------------------
  |  Branch (329:7): [True: 542k, False: 15.5k]
  ------------------
  330|   542k|    loader = nullptr;
  331|       |
  332|   557k|  return loader;
  333|   611k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1025|  8.87k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

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

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  540|  4.62k|    Image(ImageType::qtime, mdNone, std::move(io)),
  541|  4.62k|    mvhdTimeScale_(1),
  542|  4.62k|    mdhdTimeScale_(1),
  543|  4.62k|    currentStream_(Null),
  544|  4.62k|    max_recursion_depth_(max_recursion_depth) {
  545|  4.62k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  5.64k|std::string QuickTimeVideo::mimeType() const {
  548|  5.64k|  return "video/quicktime";
  549|  5.64k|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  4.60k|void QuickTimeVideo::readMetadata() {
  555|  4.60k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 4.60k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  4.60k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 4.60k]
  ------------------
  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|  4.60k|  IoCloser closer(*io_);
  566|  4.60k|  clearMetadata();
  567|  4.60k|  continueTraversing_ = true;
  568|  4.60k|  height_ = width_ = 1;
  569|       |
  570|  4.60k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  4.60k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  39.8k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 35.2k, False: 4.60k]
  ------------------
  574|  35.2k|    decodeBlock(0);
  575|       |
  576|  4.60k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  4.60k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|   633k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|   633k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|   633k|  const long bufMinSize = 4;
  583|   633k|  DataBuf buf(bufMinSize + 1);
  584|   633k|  uint64_t size = 0;
  585|   633k|  buf.data()[4] = '\0';
  586|       |
  587|   633k|  io_->read(buf.data(), 4);
  588|   633k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 383, False: 632k]
  ------------------
  589|    383|    continueTraversing_ = false;
  590|    383|    return;
  591|    383|  }
  592|       |
  593|   632k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|   632k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|   632k|  size_t hdrsize = 8;
  599|       |
  600|   632k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 143, False: 632k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    143|    DataBuf data(8);
  603|    143|    hdrsize += 8;
  604|    143|    io_->readOrThrow(data.data(), data.size());
  605|    143|    size = data.read_uint64(0, bigEndian);
  606|   632k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 11.9k, False: 620k]
  |  Branch (606:27): [True: 11.7k, False: 158]
  ------------------
  607|  11.7k|    size = buf.read_uint32(0, bigEndian);
  608|  11.7k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  11.7k|  }
  610|       |
  611|   632k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|   632k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|   632k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|   632k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|   632k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 1.27k, False: 631k]
  ------------------
  618|  1.27k|    discard(newsize);
  619|  1.27k|    return;
  620|  1.27k|  }
  621|   631k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 611k, False: 20.3k]
  ------------------
  622|   611k|    buf.resize(newsize);
  623|   611k|  }
  624|   631k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|   631k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  1.18M|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  1.18M|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  1.18M|  assert(buf.size() > 4);
  638|       |
  639|  1.18M|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 1.18M]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  1.18M|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 596k, False: 587k]
  ------------------
  643|   596k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|   596k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 8.92k, False: 579k]
  ------------------
  645|  8.92k|    fileTypeDecoder(size);
  646|       |
  647|   579k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 3.79k, False: 575k]
  ------------------
  648|  3.79k|    setMediaStream(size);
  649|       |
  650|   575k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 664, False: 574k]
  ------------------
  651|    664|    movieHeaderDecoder(size);
  652|       |
  653|   574k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 498, False: 574k]
  ------------------
  654|    498|    trackHeaderDecoder(size);
  655|       |
  656|   574k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 1.84k, False: 572k]
  ------------------
  657|  1.84k|    mediaHeaderDecoder(size);
  658|       |
  659|   572k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 11.8k, False: 560k]
  ------------------
  660|  11.8k|    handlerDecoder(size);
  661|       |
  662|   560k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 6.50k, False: 553k]
  ------------------
  663|  6.50k|    videoHeaderDecoder(size);
  664|       |
  665|   553k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 475k, False: 78.7k]
  ------------------
  666|   475k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  78.7k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 727, False: 78.0k]
  ------------------
  669|    727|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  78.0k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 1.02k, False: 77.0k]
  ------------------
  672|  1.02k|    sampleDesc(size);
  673|       |
  674|  77.0k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 293, False: 76.7k]
  ------------------
  675|    293|    timeToSampleDecoder();
  676|       |
  677|  76.7k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 1.35k, False: 75.3k]
  ------------------
  678|  1.35k|    previewTagDecoder(size);
  679|       |
  680|  75.3k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 1.45k, False: 73.9k]
  ------------------
  681|  1.45k|    trackApertureTagDecoder(size);
  682|       |
  683|  73.9k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 1.37k, False: 72.5k]
  ------------------
  684|  1.37k|    keysTagDecoder(size);
  685|       |
  686|  72.5k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 667, False: 71.8k]
  ------------------
  687|    667|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 104, False: 563]
  ------------------
  688|    104|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    563|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 318, False: 245]
  ------------------
  690|    318|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|    245|    else
  692|    245|      discard(size);
  693|    667|  }
  694|       |
  695|  71.8k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 798, False: 71.0k]
  ------------------
  696|    798|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 431, False: 367]
  ------------------
  697|    431|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    367|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 152, False: 215]
  ------------------
  699|    152|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|    215|    else
  701|    215|      discard(size);
  702|    798|  }
  703|       |
  704|  71.0k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 475, False: 70.6k]
  ------------------
  705|    475|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|    475|  }
  707|       |
  708|  70.6k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 89, False: 70.5k]
  ------------------
  709|     89|    io_->readOrThrow(buf.data(), 4);
  710|     89|    io_->readOrThrow(buf.data(), 4);
  711|     89|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|     89|  }
  713|       |
  714|  70.5k|  else {
  715|  70.5k|    discard(size);
  716|  70.5k|  }
  717|  1.18M|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  72.2k|void QuickTimeVideo::discard(size_t size) {
  720|  72.2k|  size_t cur_pos = io_->tell();
  721|  72.2k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  72.2k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|  1.35k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|  1.35k|  DataBuf buf(4);
  726|  1.35k|  size_t cur_pos = io_->tell();
  727|  1.35k|  io_->readOrThrow(buf.data(), 4);
  728|  1.35k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|  1.35k|  io_->readOrThrow(buf.data(), 2);
  730|  1.35k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|  1.35k|  io_->readOrThrow(buf.data(), 4);
  733|  1.35k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 226, False: 1.12k]
  ------------------
  734|    226|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|  1.12k|  else
  736|  1.12k|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|  1.35k|  io_->seek(cur_pos + size, BasicIo::beg);
  739|  1.35k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|  1.37k|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|  1.37k|  DataBuf buf(4);
  743|  1.37k|  size_t cur_pos = io_->tell();
  744|  1.37k|  io_->readOrThrow(buf.data(), 4);
  745|  1.37k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|  1.37k|  io_->readOrThrow(buf.data(), 2);
  747|  1.37k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|  1.37k|  io_->readOrThrow(buf.data(), 4);
  750|  1.37k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 462, False: 915]
  ------------------
  751|    462|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    915|  else
  753|    915|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|  1.37k|  io_->seek(cur_pos + size, BasicIo::beg);
  756|  1.37k|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|  1.45k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|  1.45k|  DataBuf buf(4);
  760|  1.45k|  DataBuf buf2(2);
  761|  1.45k|  size_t cur_pos = io_->tell();
  762|  1.45k|  byte n = 3;
  763|       |
  764|  5.81k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 4.36k, False: 1.45k]
  ------------------
  765|  4.36k|    io_->seek(4L, BasicIo::cur);
  766|  4.36k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  4.36k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 295, False: 4.06k]
  ------------------
  769|    295|      io_->seek(4L, BasicIo::cur);
  770|    295|      io_->readOrThrow(buf.data(), 2);
  771|    295|      io_->readOrThrow(buf2.data(), 2);
  772|    295|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|    295|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    295|#define stringFormat std::format
  ------------------
  774|    295|      io_->readOrThrow(buf.data(), 2);
  775|    295|      io_->readOrThrow(buf2.data(), 2);
  776|    295|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|    295|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    295|#define stringFormat std::format
  ------------------
  778|    295|    }
  779|       |
  780|  4.06k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 132, False: 3.93k]
  ------------------
  781|    132|      io_->seek(4L, BasicIo::cur);
  782|    132|      io_->readOrThrow(buf.data(), 2);
  783|    132|      io_->readOrThrow(buf2.data(), 2);
  784|    132|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|    132|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    132|#define stringFormat std::format
  ------------------
  786|    132|      io_->readOrThrow(buf.data(), 2);
  787|    132|      io_->readOrThrow(buf2.data(), 2);
  788|    132|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|    132|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    132|#define stringFormat std::format
  ------------------
  790|    132|    }
  791|       |
  792|  3.93k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 196, False: 3.73k]
  ------------------
  793|    196|      io_->seek(4L, BasicIo::cur);
  794|    196|      io_->readOrThrow(buf.data(), 2);
  795|    196|      io_->readOrThrow(buf2.data(), 2);
  796|    196|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|    196|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    196|#define stringFormat std::format
  ------------------
  798|    196|      io_->readOrThrow(buf.data(), 2);
  799|    196|      io_->readOrThrow(buf2.data(), 2);
  800|    196|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|    196|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    196|#define stringFormat std::format
  ------------------
  802|    196|    }
  803|  4.36k|  }
  804|  1.45k|  io_->seek(cur_pos + size, BasicIo::beg);
  805|  1.45k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|  3.91k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|  3.91k|  size_t cur_pos = io_->tell();
  809|  3.91k|  DataBuf buf(50);
  810|  3.91k|  DataBuf buf2(4);
  811|       |
  812|  3.91k|  io_->readOrThrow(buf.data(), 4);
  813|  3.91k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 2.91k, False: 1.00k]
  ------------------
  814|  2.91k|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|  2.91k|    io_->readOrThrow(buf.data(), 24);
  817|  2.91k|    xmpData_["Xmp.video.Make"] = buf.data();
  818|  2.91k|    io_->readOrThrow(buf.data(), 14);
  819|  2.91k|    xmpData_["Xmp.video.Model"] = buf.data();
  820|  2.91k|    io_->readOrThrow(buf.data(), 4);
  821|  2.91k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  2.91k|#define stringFormat std::format
  ------------------
  822|  2.91k|    io_->readOrThrow(buf.data(), 4);
  823|  2.91k|    io_->readOrThrow(buf2.data(), 4);
  824|  2.91k|    xmpData_["Xmp.video.FNumber"] =
  825|  2.91k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|  2.91k|    io_->readOrThrow(buf.data(), 4);
  827|  2.91k|    io_->readOrThrow(buf2.data(), 4);
  828|  2.91k|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|  2.91k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|  2.91k|    io_->readOrThrow(buf.data(), 10);
  831|  2.91k|    io_->readOrThrow(buf.data(), 4);
  832|  2.91k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 1.53k, False: 1.38k]
  ------------------
  833|  1.53k|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|  1.53k|#define _(String) (String)
  ------------------
  834|  2.91k|    io_->readOrThrow(buf.data(), 4);
  835|  2.91k|    io_->readOrThrow(buf2.data(), 4);
  836|  2.91k|    xmpData_["Xmp.video.FocalLength"] =
  837|  2.91k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|  2.91k|    io_->seek(95L, BasicIo::cur);
  839|  2.91k|    io_->readOrThrow(buf.data(), 48);
  840|  2.91k|    buf.write_uint8(48, 0);
  841|  2.91k|    xmpData_["Xmp.video.Software"] = buf.data();
  842|  2.91k|    io_->readOrThrow(buf.data(), 4);
  843|  2.91k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|  2.91k|  }
  845|       |
  846|  3.91k|  io_->seek(cur_pos + size, BasicIo::beg);
  847|  3.91k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|   475k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|   475k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|   475k|  size_t cur_pos = io_->tell();
  852|   475k|  const TagVocabulary* td;
  853|   475k|  const TagVocabulary* tv;
  854|   475k|  const TagVocabulary* tv_internal;
  855|       |
  856|   475k|  const long bufMinSize = 100;
  857|   475k|  DataBuf buf(bufMinSize);
  858|   475k|  size_t size_internal = outer_size;
  859|   475k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  1.10M|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 1.09M, False: 10.1k]
  |  Branch (861:38): [True: 1.09M, False: 0]
  ------------------
  862|  1.09M|    buf.data()[4] = '\0';
  863|  1.09M|    io_->readOrThrow(buf.data(), 4);
  864|  1.09M|    const size_t size = buf.read_uint32(0, bigEndian);
  865|  1.09M|    if (size > size_internal)
  ------------------
  |  Branch (865:9): [True: 454k, False: 636k]
  ------------------
  866|   454k|      break;
  867|   636k|    size_internal -= size;
  868|   636k|    io_->readOrThrow(buf.data(), 4);
  869|       |
  870|   636k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (870:9): [True: 194, False: 636k]
  ------------------
  871|    194|      buf.data()[0] = ' ';
  872|   636k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  873|       |
  874|   636k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  875|       |
  876|   636k|    if (size <= 12)
  ------------------
  |  Branch (876:9): [True: 10.4k, False: 625k]
  ------------------
  877|  10.4k|      break;
  878|       |
  879|   625k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (879:9): [True: 211, False: 625k]
  |  Branch (879:40): [True: 231, False: 625k]
  ------------------
  880|    426|      userDataDecoder(size - 8, recursion_depth + 1);
  881|       |
  882|   625k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (882:14): [True: 9.03k, False: 616k]
  ------------------
  883|  9.03k|      NikonTagsDecoder(size - 8);
  884|       |
  885|   616k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (885:14): [True: 3.91k, False: 612k]
  ------------------
  886|  3.91k|      CameraTagsDecoder(size - 8);
  887|       |
  888|   612k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (888:14): [True: 458, False: 611k]
  |  Branch (888:45): [True: 350, False: 611k]
  |  Branch (888:76): [True: 103, False: 611k]
  ------------------
  889|   611k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (889:14): [True: 272, False: 611k]
  |  Branch (889:45): [True: 204, False: 610k]
  ------------------
  890|  1.37k|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  891|  1.37k|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|  1.37k|#define _(String) (String)
  ------------------
  892|  1.37k|    }
  893|       |
  894|   610k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (894:14): [True: 786, False: 610k]
  |  Branch (894:45): [True: 0, False: 610k]
  ------------------
  895|    770|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  896|    770|      io_->readOrThrow(buf.data(), 2);
  897|    770|      buf.data()[2] = '\0';
  898|    770|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  899|       |
  900|    770|      if (tv_internal)
  ------------------
  |  Branch (900:11): [True: 397, False: 373]
  ------------------
  901|    397|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    397|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    397|#define _(String) (String)
  ------------------
  902|    373|      else
  903|    373|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|    373|#define _(String) (String)
  ------------------
  904|    770|    }
  905|       |
  906|   610k|    else if (tv) {
  ------------------
  |  Branch (906:14): [True: 1.16k, False: 609k]
  ------------------
  907|  1.16k|      io_->readOrThrow(buf.data(), 4);
  908|  1.16k|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|  1.16k|#define _(String) (String)
  ------------------
  909|  1.16k|    }
  910|       |
  911|   609k|    else if (td)
  ------------------
  |  Branch (911:14): [True: 555k, False: 53.4k]
  ------------------
  912|   555k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  913|   625k|  }
  914|       |
  915|   475k|  io_->seek(cur_pos + outer_size, BasicIo::beg);
  916|   475k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  9.03k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  9.03k|  size_t cur_pos = io_->tell();
  920|  9.03k|  DataBuf buf(201);
  921|  9.03k|  DataBuf buf2(4 + 1);
  922|  9.03k|  uint32_t TagID = 0;
  923|  9.03k|  uint16_t dataLength = 0;
  924|  9.03k|  uint16_t dataType = 2;
  925|  9.03k|  const TagDetails* td;
  926|  9.03k|  const TagDetails* td2;
  927|       |
  928|   833k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 824k, False: 9.03k]
  ------------------
  929|   824k|    io_->readOrThrow(buf.data(), 4);
  930|   824k|    TagID = buf.read_uint32(0, bigEndian);
  931|   824k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   824k|    io_->readOrThrow(buf.data(), 2);
  934|   824k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   824k|    std::memset(buf.data(), 0x0, buf.size());
  937|   824k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   824k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 16.2k, False: 807k]
  ------------------
  940|  16.2k|      size_t local_pos = io_->tell();
  941|  16.2k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  16.2k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  16.2k|      io_->readOrThrow(buf.data(), 4);
  945|  16.2k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  16.2k|      io_->readOrThrow(buf.data(), 20);
  947|  16.2k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  16.2k|      io_->readOrThrow(buf.data(), 20);
  949|  16.2k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  16.2k|      io_->readOrThrow(buf.data(), 4);
  951|  16.2k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  16.2k|      io_->readOrThrow(buf.data(), 1);
  954|  16.2k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  16.2k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 9.73k, False: 6.55k]
  ------------------
  956|  9.73k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  9.73k|#define _(String) (String)
  ------------------
  957|  6.55k|      else
  958|  6.55k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  16.2k|      io_->readOrThrow(buf.data(), 1);
  961|  16.2k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  16.2k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 10.3k, False: 5.94k]
  ------------------
  963|  10.3k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  10.3k|#define _(String) (String)
  ------------------
  964|       |
  965|  16.2k|      io_->readOrThrow(buf.data(), 1);
  966|  16.2k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  16.2k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 9.62k, False: 6.66k]
  ------------------
  968|  9.62k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  9.62k|#define _(String) (String)
  ------------------
  969|  6.66k|      else
  970|  6.66k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  16.2k|      io_->readOrThrow(buf.data(), 1);
  973|  16.2k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  16.2k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 8.24k, False: 8.04k]
  ------------------
  975|  8.24k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  8.24k|#define _(String) (String)
  ------------------
  976|  8.04k|      else
  977|  8.04k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  16.2k|      io_->readOrThrow(buf.data(), 1);
  980|  16.2k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  16.2k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 8.50k, False: 7.78k]
  ------------------
  982|  8.50k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  8.50k|#define _(String) (String)
  ------------------
  983|  7.78k|      else
  984|  7.78k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  16.2k|      io_->readOrThrow(buf.data(), 1);
  987|  16.2k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  16.2k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 9.66k, False: 6.62k]
  ------------------
  989|  9.66k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  9.66k|#define _(String) (String)
  ------------------
  990|  6.62k|      else
  991|  6.62k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  16.2k|      io_->readOrThrow(buf.data(), 1);
  994|  16.2k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  16.2k|      io_->readOrThrow(buf.data(), 1);
  997|  16.2k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  16.2k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 3.13k, False: 13.1k]
  ------------------
  999|  3.13k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  3.13k|#define _(String) (String)
  ------------------
 1000|  13.1k|      else
 1001|  13.1k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  16.2k|      io_->readOrThrow(buf.data(), 1);
 1004|  16.2k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  16.2k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 4.23k, False: 12.0k]
  ------------------
 1006|  4.23k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  4.23k|#define _(String) (String)
  ------------------
 1007|  12.0k|      else
 1008|  12.0k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  16.2k|      io_->readOrThrow(buf.data(), 1);
 1011|  16.2k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  16.2k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  16.2k|    }
 1015|       |
 1016|   807k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 2.37k, False: 805k]
  ------------------
 1017|  2.37k|      size_t local_pos = io_->tell();
 1018|  2.37k|      dataLength = buf.read_uint16(0, bigEndian);
 1019|  2.37k|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|  2.37k|      io_->readOrThrow(buf.data(), 2);
 1022|  2.37k|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|  2.37k|      io_->readOrThrow(buf.data(), 1);
 1024|  2.37k|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|  2.37k|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 1.72k, False: 644]
  ------------------
 1026|  1.72k|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|  1.72k|#define _(String) (String)
  ------------------
 1027|       |
 1028|  2.37k|      io_->readOrThrow(buf.data(), 1);
 1029|  2.37k|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|  2.37k|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 1.30k, False: 1.06k]
  ------------------
 1031|  1.30k|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|  1.30k|#define _(String) (String)
  ------------------
 1032|       |
 1033|  2.37k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|  2.37k|    }
 1035|       |
 1036|   805k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 9.84k, False: 795k]
  |  Branch (1036:31): [True: 1.64k, False: 793k]
  ------------------
 1037|  10.6k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  10.6k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  10.6k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 4.06k, False: 6.62k]
  ------------------
 1042|  4.06k|#ifndef SUPPRESS_WARNINGS
 1043|  4.06k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|  4.06k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.06k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.06k|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|  4.06k|#endif
 1046|  4.06k|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|  4.06k|        buf.data()[0] = '\0';
 1048|  6.62k|      } else {
 1049|  6.62k|        io_->readOrThrow(buf.data(), dataLength);
 1050|  6.62k|        buf.data()[dataLength] = '\0';
 1051|  6.62k|      }
 1052|       |
 1053|  10.6k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 2.44k, False: 8.24k]
  ------------------
 1054|  2.44k|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|  2.44k|#define _(String) (String)
  ------------------
 1055|  2.44k|      }
 1056|   794k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 7.42k, False: 787k]
  ------------------
 1057|  7.42k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  7.42k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  7.42k|      io_->readOrThrow(buf.data(), 4);
 1060|  7.42k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 1.91k, False: 5.50k]
  ------------------
 1061|  1.91k|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|  1.91k|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  7.42k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 2.12k, False: 5.29k]
  |  Branch (1064:31): [True: 4.73k, False: 555]
  ------------------
 1065|  6.86k|#ifndef SUPPRESS_WARNINGS
 1066|  6.86k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  6.86k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 6.86k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  6.86k|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|  6.86k|#endif
 1069|  6.86k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|  6.86k|      } else
 1071|    558|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|   787k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 4.12k, False: 783k]
  ------------------
 1073|  4.12k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  4.12k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  4.12k|      io_->readOrThrow(buf.data(), 2);
 1076|  4.12k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 918, False: 3.20k]
  ------------------
 1077|    918|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    918|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  4.12k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 1.84k, False: 2.27k]
  |  Branch (1080:31): [True: 1.77k, False: 503]
  ------------------
 1081|  3.62k|#ifndef SUPPRESS_WARNINGS
 1082|  3.62k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.62k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.62k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.62k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  3.62k|#endif
 1085|  3.62k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  3.62k|      } else
 1087|    505|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|   783k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 4.02k, False: 779k]
  ------------------
 1089|  4.02k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  4.02k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  4.02k|      io_->readOrThrow(buf.data(), 4);
 1092|  4.02k|      io_->readOrThrow(buf2.data(), 4);
 1093|  4.02k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 985, False: 3.04k]
  ------------------
 1094|    985|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    985|#define _(String) (String)
  ------------------
 1095|    985|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1096|       |
 1097|       |      // Sanity check with an "unreasonably" large number
 1098|  4.02k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 2.23k, False: 1.79k]
  |  Branch (1098:31): [True: 1.27k, False: 519]
  ------------------
 1099|  3.50k|#ifndef SUPPRESS_WARNINGS
 1100|  3.50k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.50k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.50k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.50k|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|  3.50k|#endif
 1103|  3.50k|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|  3.50k|      } else
 1105|    523|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|   779k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 3.68k, False: 775k]
  ------------------
 1107|  3.68k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  3.68k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  3.68k|      io_->readOrThrow(buf.data(), 2);
 1110|  3.68k|      io_->readOrThrow(buf2.data(), 2);
 1111|  3.68k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 1.47k, False: 2.20k]
  ------------------
 1112|  1.47k|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|  1.47k|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|  1.47k|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  3.68k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 2.01k, False: 1.67k]
  |  Branch (1115:31): [True: 1.31k, False: 362]
  ------------------
 1116|  3.32k|#ifndef SUPPRESS_WARNINGS
 1117|  3.32k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.32k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.32k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.32k|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|  3.32k|#endif
 1120|  3.32k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|  3.32k|      } else
 1122|    362|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  3.68k|    }
 1124|   824k|  }
 1125|       |
 1126|  9.03k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  9.03k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  3.79k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  3.79k|  size_t current_position = io_->tell();
 1131|  3.79k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  3.79k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 3.79k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  3.79k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  54.4k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 54.4k, False: 0]
  |  Branch (1136:25): [True: 53.7k, False: 719]
  ------------------
 1137|  53.7k|    io_->readOrThrow(buf.data(), 4);
 1138|  53.7k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 3.07k, False: 50.6k]
  ------------------
 1139|  3.07k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 241, False: 2.83k]
  ------------------
 1140|    241|        break;
 1141|  2.83k|      io_->readOrThrow(buf.data(), 4);
 1142|  2.83k|      io_->readOrThrow(buf.data(), 4);
 1143|  2.83k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  2.83k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 290, False: 2.54k]
  ------------------
 1146|    290|        currentStream_ = Video;
 1147|  2.54k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 490, False: 2.05k]
  ------------------
 1148|    490|        currentStream_ = Audio;
 1149|  2.05k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 18, False: 2.03k]
  ------------------
 1150|     18|        currentStream_ = Hint;
 1151|  2.03k|      else
 1152|  2.03k|        currentStream_ = GenMediaHeader;
 1153|  2.83k|      break;
 1154|  3.07k|    }
 1155|  53.7k|  }
 1156|       |
 1157|  3.79k|  io_->seek(current_position, BasicIo::beg);
 1158|  3.79k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|    293|void QuickTimeVideo::timeToSampleDecoder() {
 1161|    293|  DataBuf buf(4 + 1);
 1162|    293|  io_->readOrThrow(buf.data(), 4);
 1163|    293|  io_->readOrThrow(buf.data(), 4);
 1164|    293|  uint64_t totalframes = 0;
 1165|    293|  uint64_t timeOfFrames = 0;
 1166|    293|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|    886|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 593, False: 293]
  ------------------
 1169|    593|    io_->readOrThrow(buf.data(), 4);
 1170|    593|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|    593|    totalframes = Safe::add(totalframes, temp);
 1172|    593|    io_->readOrThrow(buf.data(), 4);
 1173|    593|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|    593|  }
 1175|    293|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 148, False: 145]
  ------------------
 1176|    148|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 36, False: 112]
  ------------------
 1177|     36|      timeOfFrames = 1;
 1178|    148|    xmpData_["Xmp.video.FrameRate"] =
 1179|    148|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    148|  }
 1181|    293|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.02k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.02k|  DataBuf buf(100);
 1185|  1.02k|  size_t cur_pos = io_->tell();
 1186|  1.02k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.02k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.02k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|  22.9k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 22.1k, False: 719]
  ------------------
 1191|  22.1k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 7.08k, False: 15.1k]
  ------------------
 1192|  7.08k|      imageDescDecoder();
 1193|  15.1k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 14.8k, False: 306]
  ------------------
 1194|  14.8k|      audioDescDecoder();
 1195|    306|    else
 1196|    306|      break;
 1197|  22.1k|  }
 1198|  1.02k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.02k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  14.8k|void QuickTimeVideo::audioDescDecoder() {
 1202|  14.8k|  DataBuf buf(40);
 1203|  14.8k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  14.8k|  buf.data()[4] = '\0';
 1205|  14.8k|  io_->readOrThrow(buf.data(), 4);
 1206|  14.8k|  size_t size = 82;
 1207|       |
 1208|  14.8k|  const TagVocabulary* td;
 1209|       |
 1210|   309k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 295k, False: 14.7k]
  ------------------
 1211|   295k|    io_->readOrThrow(buf.data(), 4);
 1212|   295k|    switch (i) {
 1213|  14.7k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 14.7k, False: 280k]
  ------------------
 1214|  14.7k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  14.7k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 248, False: 14.5k]
  ------------------
 1216|    248|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    248|#define _(String) (String)
  ------------------
 1217|  14.5k|        else
 1218|  14.5k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  14.7k|        break;
 1220|  14.7k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 14.7k, False: 280k]
  ------------------
 1221|  14.7k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  14.7k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 508, False: 14.2k]
  ------------------
 1223|    508|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    508|#define _(String) (String)
  ------------------
 1224|  14.7k|        break;
 1225|  14.7k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 14.7k, False: 280k]
  ------------------
 1226|  14.7k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  14.7k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  14.7k|        break;
 1229|  14.7k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 14.7k, False: 280k]
  ------------------
 1230|  14.7k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  14.7k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  14.7k|        break;
 1233|   236k|      default:
  ------------------
  |  Branch (1233:7): [True: 236k, False: 59.1k]
  ------------------
 1234|   236k|        break;
 1235|   295k|    }
 1236|   295k|  }
 1237|  14.7k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  14.7k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  7.08k|void QuickTimeVideo::imageDescDecoder() {
 1241|  7.08k|  DataBuf buf(40);
 1242|  7.08k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  7.08k|  buf.data()[4] = '\0';
 1244|  7.08k|  io_->readOrThrow(buf.data(), 4);
 1245|  7.08k|  size_t size = 82;
 1246|       |
 1247|  7.08k|  const TagVocabulary* td;
 1248|       |
 1249|  84.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 77.3k, False: 6.98k]
  ------------------
 1250|  77.3k|    io_->readOrThrow(buf.data(), 4);
 1251|       |
 1252|  77.3k|    switch (i) {
 1253|  7.04k|      case codec:
  ------------------
  |  Branch (1253:7): [True: 7.04k, False: 70.2k]
  ------------------
 1254|  7.04k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1255|  7.04k|        if (td)
  ------------------
  |  Branch (1255:13): [True: 465, False: 6.58k]
  ------------------
 1256|    465|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    465|#define _(String) (String)
  ------------------
 1257|  6.58k|        else
 1258|  6.58k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1259|  7.04k|        break;
 1260|  7.03k|      case VendorID:
  ------------------
  |  Branch (1260:7): [True: 7.03k, False: 70.2k]
  ------------------
 1261|  7.03k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1262|  7.03k|        if (td)
  ------------------
  |  Branch (1262:13): [True: 225, False: 6.80k]
  ------------------
 1263|    225|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    225|#define _(String) (String)
  ------------------
 1264|  7.03k|        break;
 1265|  7.02k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1265:7): [True: 7.02k, False: 70.3k]
  ------------------
 1266|  7.02k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1267|  7.02k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1268|  7.02k|        break;
 1269|  7.01k|      case XResolution:
  ------------------
  |  Branch (1269:7): [True: 7.01k, False: 70.3k]
  ------------------
 1270|  7.01k|        xmpData_["Xmp.video.XResolution"] =
 1271|  7.01k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1272|  7.01k|        break;
 1273|  7.01k|      case YResolution:
  ------------------
  |  Branch (1273:7): [True: 7.01k, False: 70.3k]
  ------------------
 1274|  7.01k|        xmpData_["Xmp.video.YResolution"] =
 1275|  7.01k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1276|  7.01k|        io_->readOrThrow(buf.data(), 3);
 1277|  7.01k|        size -= 3;
 1278|  7.01k|        break;
 1279|  7.00k|      case CompressorName:
  ------------------
  |  Branch (1279:7): [True: 7.00k, False: 70.3k]
  ------------------
 1280|  7.00k|        io_->readOrThrow(buf.data(), 32);
 1281|  7.00k|        size -= 32;
 1282|  7.00k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1283|  7.00k|        break;
 1284|  35.1k|      default:
  ------------------
  |  Branch (1284:7): [True: 35.1k, False: 42.1k]
  ------------------
 1285|  35.1k|        break;
 1286|  77.3k|    }
 1287|  77.3k|  }
 1288|  6.98k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1289|  6.98k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1290|  6.98k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1292|    727|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1293|    727|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1294|    727|  DataBuf buf(4 + 1);
 1295|    727|  io_->readOrThrow(buf.data(), 4);
 1296|    727|  io_->readOrThrow(buf.data(), 4);
 1297|    727|  uint32_t noOfEntries;
 1298|       |
 1299|    727|  noOfEntries = buf.read_uint32(0, bigEndian);
 1300|       |
 1301|  2.01k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1301:24): [True: 1.37k, False: 634]
  |  Branch (1301:43): [True: 1.28k, False: 93]
  ------------------
 1302|  1.28k|    decodeBlock(recursion_depth + 1);
 1303|  1.28k|  }
 1304|    727|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1306|  6.50k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1307|  6.50k|  DataBuf buf(3);
 1308|  6.50k|  std::memset(buf.data(), 0x0, buf.size());
 1309|  6.50k|  buf.data()[2] = '\0';
 1310|  6.50k|  currentStream_ = Video;
 1311|       |
 1312|  6.50k|  const TagDetails* td;
 1313|       |
 1314|  61.4k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1314:19): [True: 54.9k, False: 6.50k]
  ------------------
 1315|  54.9k|    io_->readOrThrow(buf.data(), 2);
 1316|       |
 1317|  54.9k|    switch (i) {
 1318|  6.18k|      case GraphicsMode:
  ------------------
  |  Branch (1318:7): [True: 6.18k, False: 48.8k]
  ------------------
 1319|  6.18k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1320|  6.18k|        if (td)
  ------------------
  |  Branch (1320:13): [True: 5.45k, False: 727]
  ------------------
 1321|  5.45k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  5.45k|#define _(String) (String)
  ------------------
 1322|  6.18k|        break;
 1323|  5.02k|      case OpColor:
  ------------------
  |  Branch (1323:7): [True: 5.02k, False: 49.9k]
  ------------------
 1324|  5.02k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1325|  5.02k|        break;
 1326|  43.7k|      default:
  ------------------
  |  Branch (1326:7): [True: 43.7k, False: 11.2k]
  ------------------
 1327|  43.7k|        break;
 1328|  54.9k|    }
 1329|  54.9k|  }
 1330|  6.50k|  io_->readOrThrow(buf.data(), size % 2);
 1331|  6.50k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1333|  11.8k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1334|  11.8k|  size_t cur_pos = io_->tell();
 1335|  11.8k|  DataBuf buf(100);
 1336|  11.8k|  std::memset(buf.data(), 0x0, buf.size());
 1337|  11.8k|  buf.data()[4] = '\0';
 1338|       |
 1339|  11.8k|  const TagVocabulary* tv;
 1340|       |
 1341|  71.3k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1341:19): [True: 59.4k, False: 11.8k]
  ------------------
 1342|  59.4k|    io_->readOrThrow(buf.data(), 4);
 1343|       |
 1344|  59.4k|    switch (i) {
  ------------------
  |  Branch (1344:13): [True: 35.6k, False: 23.7k]
  ------------------
 1345|  11.8k|      case HandlerClass:
  ------------------
  |  Branch (1345:7): [True: 11.8k, False: 47.5k]
  ------------------
 1346|  11.8k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1347|  11.8k|        if (tv) {
  ------------------
  |  Branch (1347:13): [True: 937, False: 10.9k]
  ------------------
 1348|    937|          if (currentStream_ == Video)
  ------------------
  |  Branch (1348:15): [True: 204, False: 733]
  ------------------
 1349|    204|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    204|#define _(String) (String)
  ------------------
 1350|    733|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1350:20): [True: 258, False: 475]
  ------------------
 1351|    258|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    258|#define _(String) (String)
  ------------------
 1352|    937|        }
 1353|  11.8k|        break;
 1354|  11.8k|      case HandlerType:
  ------------------
  |  Branch (1354:7): [True: 11.8k, False: 47.5k]
  ------------------
 1355|  11.8k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1356|  11.8k|        if (tv) {
  ------------------
  |  Branch (1356:13): [True: 8.11k, False: 3.78k]
  ------------------
 1357|  8.11k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1357:15): [True: 319, False: 7.79k]
  ------------------
 1358|    319|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    319|#define _(String) (String)
  ------------------
 1359|  7.79k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1359:20): [True: 548, False: 7.24k]
  ------------------
 1360|    548|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    548|#define _(String) (String)
  ------------------
 1361|  8.11k|        }
 1362|  11.8k|        break;
 1363|  11.8k|      case HandlerVendorID:
  ------------------
  |  Branch (1363:7): [True: 11.8k, False: 47.5k]
  ------------------
 1364|  11.8k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1365|  11.8k|        if (tv) {
  ------------------
  |  Branch (1365:13): [True: 5.68k, False: 6.20k]
  ------------------
 1366|  5.68k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1366:15): [True: 233, False: 5.45k]
  ------------------
 1367|    233|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    233|#define _(String) (String)
  ------------------
 1368|  5.45k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1368:20): [True: 324, False: 5.13k]
  ------------------
 1369|    324|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    324|#define _(String) (String)
  ------------------
 1370|  5.68k|        }
 1371|  11.8k|        break;
 1372|  59.4k|    }
 1373|  59.4k|  }
 1374|  11.8k|  io_->seek(cur_pos + size, BasicIo::beg);
 1375|  11.8k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1377|  8.92k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1378|  8.92k|  DataBuf buf(5);
 1379|  8.92k|  std::memset(buf.data(), 0x0, buf.size());
 1380|  8.92k|  buf.data()[4] = '\0';
 1381|  8.92k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1382|  8.92k|  const TagVocabulary* td;
 1383|       |
 1384|   125k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1384:19): [True: 116k, False: 8.92k]
  ------------------
 1385|   116k|    io_->readOrThrow(buf.data(), 4);
 1386|   116k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1387|       |
 1388|   116k|    switch (i) {
 1389|  8.08k|      case 0:
  ------------------
  |  Branch (1389:7): [True: 8.08k, False: 108k]
  ------------------
 1390|  8.08k|        if (td)
  ------------------
  |  Branch (1390:13): [True: 7.28k, False: 802]
  ------------------
 1391|  7.28k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  7.28k|#define _(String) (String)
  ------------------
 1392|  8.08k|        break;
 1393|  2.45k|      case 1:
  ------------------
  |  Branch (1393:7): [True: 2.45k, False: 114k]
  ------------------
 1394|  2.45k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1395|  2.45k|        break;
 1396|   106k|      default:
  ------------------
  |  Branch (1396:7): [True: 106k, False: 10.5k]
  ------------------
 1397|   106k|        if (td)
  ------------------
  |  Branch (1397:13): [True: 2.09k, False: 104k]
  ------------------
 1398|  2.09k|          v->read(_(td->label_));
  ------------------
  |  |   40|  2.09k|#define _(String) (String)
  ------------------
 1399|   104k|        else
 1400|   104k|          v->read(Exiv2::toString(buf.data()));
 1401|   106k|        break;
 1402|   116k|    }
 1403|   116k|  }
 1404|  8.92k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1405|  8.92k|  io_->readOrThrow(buf.data(), size % 4);
 1406|  8.92k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1408|  1.84k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1409|  1.84k|  DataBuf buf(5);
 1410|  1.84k|  std::memset(buf.data(), 0x0, buf.size());
 1411|  1.84k|  buf.data()[4] = '\0';
 1412|  1.84k|  int64_t time_scale = 1;
 1413|       |
 1414|  11.4k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1414:19): [True: 9.65k, False: 1.84k]
  ------------------
 1415|  9.65k|    io_->readOrThrow(buf.data(), 4);
 1416|       |
 1417|  9.65k|    switch (i) {
 1418|  1.77k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1418:7): [True: 1.77k, False: 7.87k]
  ------------------
 1419|  1.77k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1419:13): [True: 1.05k, False: 720]
  ------------------
 1420|  1.05k|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1421|    720|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1421:18): [True: 288, False: 432]
  ------------------
 1422|    288|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1423|  1.77k|        break;
 1424|    898|      case MediaCreateDate:
  ------------------
  |  Branch (1424:7): [True: 898, False: 8.75k]
  ------------------
 1425|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1426|    898|        if (currentStream_ == Video)
  ------------------
  |  Branch (1426:13): [True: 404, False: 494]
  ------------------
 1427|    404|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1428|    494|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1428:18): [True: 253, False: 241]
  ------------------
 1429|    253|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1430|    898|        break;
 1431|    897|      case MediaModifyDate:
  ------------------
  |  Branch (1431:7): [True: 897, False: 8.75k]
  ------------------
 1432|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1433|    897|        if (currentStream_ == Video)
  ------------------
  |  Branch (1433:13): [True: 404, False: 493]
  ------------------
 1434|    404|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1435|    493|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1435:18): [True: 253, False: 240]
  ------------------
 1436|    253|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1437|    897|        break;
 1438|    893|      case MediaTimeScale:
  ------------------
  |  Branch (1438:7): [True: 893, False: 8.75k]
  ------------------
 1439|    893|        if (currentStream_ == Video)
  ------------------
  |  Branch (1439:13): [True: 401, False: 492]
  ------------------
 1440|    401|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1441|    492|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1441:18): [True: 253, False: 239]
  ------------------
 1442|    253|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1443|    893|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1444|    893|        mdhdTimeScale_ = time_scale;
 1445|    893|        break;
 1446|    891|      case MediaDuration:
  ------------------
  |  Branch (1446:7): [True: 891, False: 8.75k]
  ------------------
 1447|    891|        if (currentStream_ == Video)
  ------------------
  |  Branch (1447:13): [True: 400, False: 491]
  ------------------
 1448|    400|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1448:49): [True: 400, False: 0]
  ------------------
 1449|    491|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1449:18): [True: 253, False: 238]
  ------------------
 1450|    253|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1450:49): [True: 253, False: 0]
  ------------------
 1451|    891|        break;
 1452|    891|      case MediaLanguageCode:
  ------------------
  |  Branch (1452:7): [True: 891, False: 8.75k]
  ------------------
 1453|    891|        if (currentStream_ == Video)
  ------------------
  |  Branch (1453:13): [True: 400, False: 491]
  ------------------
 1454|    400|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1455|    491|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1455:18): [True: 253, False: 238]
  ------------------
 1456|    253|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1457|    891|        break;
 1458|       |
 1459|  3.40k|      default:
  ------------------
  |  Branch (1459:7): [True: 3.40k, False: 6.24k]
  ------------------
 1460|  3.40k|        break;
 1461|  9.65k|    }
 1462|  9.65k|  }
 1463|  1.84k|  io_->readOrThrow(buf.data(), size % 4);
 1464|  1.84k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1466|    498|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1467|    498|  DataBuf buf(5);
 1468|    498|  std::memset(buf.data(), 0x0, buf.size());
 1469|    498|  buf.data()[4] = '\0';
 1470|    498|  int64_t temp = 0;
 1471|       |
 1472|  9.65k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1472:19): [True: 9.15k, False: 498]
  ------------------
 1473|  9.15k|    io_->readOrThrow(buf.data(), 4);
 1474|       |
 1475|  9.15k|    switch (i) {
 1476|    430|      case TrackHeaderVersion:
  ------------------
  |  Branch (1476:7): [True: 430, False: 8.72k]
  ------------------
 1477|    430|        if (currentStream_ == Video)
  ------------------
  |  Branch (1477:13): [True: 106, False: 324]
  ------------------
 1478|    106|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1479|    324|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1479:18): [True: 35, False: 289]
  ------------------
 1480|     35|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1481|    430|        break;
 1482|    364|      case TrackCreateDate:
  ------------------
  |  Branch (1482:7): [True: 364, False: 8.79k]
  ------------------
 1483|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1484|    364|        if (currentStream_ == Video)
  ------------------
  |  Branch (1484:13): [True: 106, False: 258]
  ------------------
 1485|    106|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1486|    258|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1486:18): [True: 35, False: 223]
  ------------------
 1487|     35|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1488|    364|        break;
 1489|    362|      case TrackModifyDate:
  ------------------
  |  Branch (1489:7): [True: 362, False: 8.79k]
  ------------------
 1490|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1491|    362|        if (currentStream_ == Video)
  ------------------
  |  Branch (1491:13): [True: 106, False: 256]
  ------------------
 1492|    106|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1493|    256|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1493:18): [True: 34, False: 222]
  ------------------
 1494|     34|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1495|    362|        break;
 1496|    361|      case TrackID:
  ------------------
  |  Branch (1496:7): [True: 361, False: 8.79k]
  ------------------
 1497|    361|        if (currentStream_ == Video)
  ------------------
  |  Branch (1497:13): [True: 106, False: 255]
  ------------------
 1498|    106|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1499|    255|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1499:18): [True: 34, False: 221]
  ------------------
 1500|     34|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1501|    361|        break;
 1502|    359|      case TrackDuration:
  ------------------
  |  Branch (1502:7): [True: 359, False: 8.79k]
  ------------------
 1503|    359|        if (currentStream_ == Video)
  ------------------
  |  Branch (1503:13): [True: 106, False: 253]
  ------------------
 1504|    106|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1504:49): [True: 106, False: 0]
  ------------------
 1505|    253|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1505:18): [True: 34, False: 219]
  ------------------
 1506|     34|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1506:49): [True: 34, False: 0]
  ------------------
 1507|    359|        break;
 1508|    358|      case TrackLayer:
  ------------------
  |  Branch (1508:7): [True: 358, False: 8.79k]
  ------------------
 1509|    358|        if (currentStream_ == Video)
  ------------------
  |  Branch (1509:13): [True: 106, False: 252]
  ------------------
 1510|    106|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1511|    252|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1511:18): [True: 34, False: 218]
  ------------------
 1512|     34|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1513|    358|        break;
 1514|    357|      case TrackVolume:
  ------------------
  |  Branch (1514:7): [True: 357, False: 8.79k]
  ------------------
 1515|    357|        if (currentStream_ == Video)
  ------------------
  |  Branch (1515:13): [True: 106, False: 251]
  ------------------
 1516|    106|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1517|    251|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1517:18): [True: 34, False: 217]
  ------------------
 1518|     34|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1519|    357|        break;
 1520|    298|      case ImageWidth:
  ------------------
  |  Branch (1520:7): [True: 298, False: 8.85k]
  ------------------
 1521|    298|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1521:13): [True: 67, False: 231]
  ------------------
 1522|     67|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1523|     67|          xmpData_["Xmp.video.Width"] = temp;
 1524|     67|          width_ = temp;
 1525|     67|        }
 1526|    298|        break;
 1527|    298|      case ImageHeight:
  ------------------
  |  Branch (1527:7): [True: 298, False: 8.85k]
  ------------------
 1528|    298|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1528:13): [True: 67, False: 231]
  ------------------
 1529|     67|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1530|     67|          xmpData_["Xmp.video.Height"] = temp;
 1531|     67|          height_ = temp;
 1532|     67|        }
 1533|    298|        break;
 1534|  5.96k|      default:
  ------------------
  |  Branch (1534:7): [True: 5.96k, False: 3.18k]
  ------------------
 1535|  5.96k|        break;
 1536|  9.15k|    }
 1537|  9.15k|  }
 1538|    498|  io_->readOrThrow(buf.data(), size % 4);
 1539|    498|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1541|    664|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1542|    664|  DataBuf buf(5);
 1543|    664|  std::memset(buf.data(), 0x0, buf.size());
 1544|    664|  buf.data()[4] = '\0';
 1545|       |
 1546|  16.2k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1546:19): [True: 15.6k, False: 664]
  ------------------
 1547|  15.6k|    io_->readOrThrow(buf.data(), 4);
 1548|       |
 1549|  15.6k|    switch (i) {
 1550|    629|      case MovieHeaderVersion:
  ------------------
  |  Branch (1550:7): [True: 629, False: 14.9k]
  ------------------
 1551|    629|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1552|    629|        break;
 1553|    618|      case CreateDate:
  ------------------
  |  Branch (1553:7): [True: 618, False: 15.0k]
  ------------------
 1554|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1555|    618|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1556|    618|        break;
 1557|    612|      case ModifyDate:
  ------------------
  |  Branch (1557:7): [True: 612, False: 15.0k]
  ------------------
 1558|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1559|    612|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1560|    612|        break;
 1561|    602|      case TimeScale:
  ------------------
  |  Branch (1561:7): [True: 602, False: 15.0k]
  ------------------
 1562|    602|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1563|    602|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1564|    602|        break;
 1565|    600|      case Duration:
  ------------------
  |  Branch (1565:7): [True: 600, False: 15.0k]
  ------------------
 1566|    600|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1566:13): [True: 600, False: 0]
  ------------------
 1567|    600|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1568|    600|        }
 1569|    600|        break;
 1570|    600|      case PreferredRate:
  ------------------
  |  Branch (1570:7): [True: 600, False: 15.0k]
  ------------------
 1571|    600|        xmpData_["Xmp.video.PreferredRate"] =
 1572|    600|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1573|    600|        break;
 1574|    600|      case PreferredVolume:
  ------------------
  |  Branch (1574:7): [True: 600, False: 15.0k]
  ------------------
 1575|    600|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1576|    600|        break;
 1577|    266|      case PreviewTime:
  ------------------
  |  Branch (1577:7): [True: 266, False: 15.3k]
  ------------------
 1578|    266|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1579|    266|        break;
 1580|    266|      case PreviewDuration:
  ------------------
  |  Branch (1580:7): [True: 266, False: 15.3k]
  ------------------
 1581|    266|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1582|    266|        break;
 1583|    266|      case PosterTime:
  ------------------
  |  Branch (1583:7): [True: 266, False: 15.3k]
  ------------------
 1584|    266|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1585|    266|        break;
 1586|    263|      case SelectionTime:
  ------------------
  |  Branch (1586:7): [True: 263, False: 15.3k]
  ------------------
 1587|    263|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1588|    263|        break;
 1589|    263|      case SelectionDuration:
  ------------------
  |  Branch (1589:7): [True: 263, False: 15.3k]
  ------------------
 1590|    263|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1591|    263|        break;
 1592|    263|      case CurrentTime:
  ------------------
  |  Branch (1592:7): [True: 263, False: 15.3k]
  ------------------
 1593|    263|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1594|    263|        break;
 1595|    262|      case NextTrackID:
  ------------------
  |  Branch (1595:7): [True: 262, False: 15.3k]
  ------------------
 1596|    262|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1597|    262|        break;
 1598|  9.51k|      default:
  ------------------
  |  Branch (1598:7): [True: 9.51k, False: 6.11k]
  ------------------
 1599|  9.51k|        break;
 1600|  15.6k|    }
 1601|  15.6k|  }
 1602|    664|  io_->readOrThrow(buf.data(), size % 4);
 1603|    664|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1605|  4.62k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool /*create*/) {
 1606|  4.62k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io));
 1607|  4.62k|  if (!image->good()) {
  ------------------
  |  Branch (1607:7): [True: 12, False: 4.60k]
  ------------------
 1608|     12|    return nullptr;
 1609|     12|  }
 1610|  4.60k|  return image;
 1611|  4.62k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1613|  23.4k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1614|  23.4k|  auto buf = DataBuf(12);
 1615|  23.4k|  iIo.read(buf.data(), 12);
 1616|       |
 1617|  23.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 23.4k]
  |  Branch (1617:22): [True: 353, False: 23.1k]
  ------------------
 1618|    353|    return false;
 1619|    353|  }
 1620|  23.1k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1621|       |
 1622|  23.1k|  bool matched = false;
 1623|       |
 1624|   117k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1624:24): [True: 117k, False: 5.68k]
  ------------------
 1625|   117k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1626|   117k|    if (tmp == 0) {
  ------------------
  |  Branch (1626:9): [True: 17.4k, False: 100k]
  ------------------
 1627|       |      // we only match if we actually know the video type. This is done
 1628|       |      // to avoid matching just on ftyp because bmffimage also has that
 1629|       |      // header.
 1630|  17.4k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1630:11): [True: 13.8k, False: 3.58k]
  ------------------
 1631|  13.8k|        matched = true;
 1632|  13.8k|      }
 1633|  17.4k|      break;
 1634|  17.4k|    }
 1635|   117k|  }
 1636|       |
 1637|  23.1k|  if (!advance || !matched) {
  ------------------
  |  Branch (1637:7): [True: 23.1k, False: 0]
  |  Branch (1637:19): [True: 0, False: 0]
  ------------------
 1638|  23.1k|    iIo.seek(0L, BasicIo::beg);
 1639|  23.1k|  }
 1640|       |
 1641|  23.1k|  return matched;
 1642|  23.4k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|  1.81M|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|  1.81M|  const char ignoreList[13][5] = {
  505|  1.81M|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|  1.81M|  };
  507|       |
  508|  1.81M|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 23.5M, False: 1.81M]
  ------------------
  509|  23.5M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 1.27k, False: 23.5M]
  ------------------
  510|  1.27k|      return true;
  511|       |
  512|  1.81M|  return false;
  513|  1.81M|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  1.18M|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  1.18M|  const char ignoreList[8][5] = {
  524|  1.18M|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  1.18M|  };
  526|       |
  527|  1.18M|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 9.46M, False: 587k]
  ------------------
  528|  9.46M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 596k, False: 8.86M]
  ------------------
  529|   596k|      return true;
  530|       |
  531|   587k|  return false;
  532|  1.18M|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  45.2M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  45.2M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  45.2M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  45.2M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  51.5M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  4.00k|static std::string readString(BasicIo& io, size_t size) {
  628|  4.00k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  4.00k|  Exiv2::DataBuf str(size + 1);
  630|  4.00k|  io.readOrThrow(str.data(), size);
  631|  4.00k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  4.00k|  return Exiv2::toString(str.data());
  633|  4.00k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  364|    885|RiffVideo::RiffVideo(BasicIo::UniquePtr io) : Image(ImageType::riff, mdNone, std::move(io)) {
  365|    885|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  367|    972|std::string RiffVideo::mimeType() const {
  368|    972|  return "video/riff";
  369|    972|}
_ZN5Exiv29RiffVideo12readMetadataEv:
  374|    885|void RiffVideo::readMetadata() {
  375|    885|  if (io_->open() != 0)
  ------------------
  |  Branch (375:7): [True: 0, False: 885]
  ------------------
  376|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  377|       |
  378|       |  // Ensure that this is the correct image type
  379|    885|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (379:7): [True: 0, False: 885]
  ------------------
  380|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  |  Branch (380:25): [True: 0, False: 0]
  ------------------
  381|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  382|      0|    throw Error(ErrorCode::kerNotAnImage, "RIFF");
  383|      0|  }
  384|       |
  385|    885|  IoCloser closer(*io_);
  386|    885|  clearMetadata();
  387|       |
  388|    885|  xmpData_["Xmp.video.FileSize"] = io_->size();
  389|    885|  xmpData_["Xmp.video.MimeType"] = mimeType();
  390|       |
  391|    885|  HeaderReader header(io_);
  392|    885|  xmpData_["Xmp.video.Container"] = header.getId();
  393|       |
  394|    885|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  395|       |
  396|    885|  decodeBlocks();
  397|    885|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  399|  10.5k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  400|  10.5k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  401|  10.5k|  id_ = readStringTag(io);
  402|  10.5k|  size_ = readDWORDTag(io);
  403|  10.5k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  405|  66.5k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  406|  66.5k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (406:7): [True: 25.3k, False: 41.2k]
  ------------------
  407|  25.3k|    return false;
  408|       |
  409|  41.2k|  return Internal::upper(str1) == str2;
  410|  66.5k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  412|    975|void RiffVideo::readList(const HeaderReader& header_) {
  413|    975|  std::string chunk_type = readStringTag(io_);
  414|       |
  415|       |#ifdef EXIV2_DEBUG_MESSAGES
  416|       |  EXV_INFO << "-> Reading list : id= " << header_.getId() << "  type= " << chunk_type << " size= " << header_.getSize()
  417|       |           << "(" << io_->tell() << "/" << io_->size() << ")" << '\n';
  418|       |#endif
  419|       |
  420|    975|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (420:7): [True: 360, False: 615]
  ------------------
  421|    360|    readInfoListChunk(header_.getSize());
  422|    615|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (422:12): [True: 153, False: 462]
  ------------------
  423|    153|    readMoviList(header_.getSize());
  424|    153|  }
  425|    975|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  427|  8.50k|void RiffVideo::readChunk(const HeaderReader& header_) {
  428|       |#ifdef EXIV2_DEBUG_MESSAGES
  429|       |  if (header_.getSize())
  430|       |    EXV_INFO << "--> Reading Chunk : [" << header_.getId() << "] size= " << header_.getSize() << "(" << io_->tell()
  431|       |             << "/" << io_->size() << ")" << '\n';
  432|       |#endif
  433|       |
  434|  8.50k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (434:7): [True: 590, False: 7.91k]
  ------------------
  435|    590|    readAviHeader();
  436|  7.91k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (436:12): [True: 886, False: 7.02k]
  ------------------
  437|    886|    readStreamHeader();
  438|  7.02k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (438:12): [True: 964, False: 6.06k]
  ------------------
  439|    964|    readStreamFormat(header_.getSize());
  440|  6.06k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (440:12): [True: 853, False: 5.21k]
  ------------------
  441|    853|    streamType_ = Audio;
  442|    853|    readStreamFormat(header_.getSize());
  443|  5.21k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (443:14): [True: 763, False: 4.44k]
  ------------------
  444|    763|    readStreamData(header_.getSize());
  445|  4.44k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (445:12): [True: 201, False: 4.24k]
  ------------------
  446|    201|    StreamName(header_.getSize());
  447|  4.24k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (447:12): [True: 204, False: 4.04k]
  ------------------
  448|    204|    readVPRPChunk(header_.getSize());
  449|  4.04k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (449:12): [True: 424, False: 3.62k]
  ------------------
  450|    424|    readIndexChunk(header_.getSize());
  451|  3.62k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (451:12): [True: 104, False: 3.51k]
  ------------------
  452|    104|    readDataChunk(header_.getSize());
  453|  3.51k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (453:12): [True: 194, False: 3.32k]
  ------------------
  454|    194|    readJunk(header_.getSize());
  455|  3.32k|  else {
  456|       |#ifdef EXIV2_DEBUG_MESSAGES
  457|       |    if (header_.getSize())
  458|       |      EXV_WARNING << "--> Ignoring Chunk : " << header_.getId() << "] size= " << header_.getSize() << "(" << io_->tell()
  459|       |                  << "/" << io_->size() << ")" << '\n';
  460|       |#endif
  461|  3.32k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  462|  3.32k|  }
  463|  8.50k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  465|    885|void RiffVideo::decodeBlocks() {
  466|  9.67k|  do {
  467|  9.67k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (467:35): [True: 975, False: 8.69k]
  ------------------
  468|    975|      readList(header);
  469|  8.69k|    } else {
  470|  8.69k|      readChunk(header);
  471|  8.69k|    }
  472|  9.67k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (472:12): [True: 8.82k, False: 847]
  |  Branch (472:27): [True: 8.78k, False: 38]
  ------------------
  473|    885|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  475|    590|void RiffVideo::readAviHeader() {
  476|       |#ifdef EXIV2_DEBUG_MESSAGES
  477|       |  EXV_INFO << "--> dwMicroSecPerFrame    = " << readDWORDTag(io_) << '\n';
  478|       |  EXV_INFO << "--> dwMaxBytesPerSec      = " << readDWORDTag(io_) << '\n';
  479|       |  EXV_INFO << "--> dwPaddingGranularity  = " << readDWORDTag(io_) << '\n';
  480|       |  EXV_INFO << "--> dwFlags               = " << readDWORDTag(io_) << '\n';
  481|       |  EXV_INFO << "--> dwTotalFrames         = " << readDWORDTag(io_) << '\n';
  482|       |  EXV_INFO << "--> dwInitialFrames       = " << readDWORDTag(io_) << '\n';
  483|       |  EXV_INFO << "--> dwStreams             = " << readDWORDTag(io_) << '\n';
  484|       |  EXV_INFO << "--> dwSuggestedBufferSize = " << readDWORDTag(io_) << '\n';
  485|       |  EXV_INFO << "--> dwWidth               = " << readDWORDTag(io_) << '\n';
  486|       |  EXV_INFO << "--> dwHeight              = " << readDWORDTag(io_) << '\n';
  487|       |  EXV_INFO << "--> dwReserved1           = " << readDWORDTag(io_) << '\n';
  488|       |  EXV_INFO << "--> dwReserved2           = " << readDWORDTag(io_) << '\n';
  489|       |  EXV_INFO << "--> dwReserved3           = " << readDWORDTag(io_) << '\n';
  490|       |  EXV_INFO << "--> dwReserved4           = " << readDWORDTag(io_) << '\n';
  491|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  492|       |    io_->seekOrThrow(io_->tell() - DWORD * 14, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  493|       |#endif
  494|       |
  495|    590|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  496|    590|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  497|    590|  double frame_rate = 1000000. / TimeBetweenFrames;
  498|       |
  499|    590|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  500|       |
  501|    590|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  502|    590|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  503|       |
  504|    590|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  505|    590|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  506|       |
  507|    590|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  508|    590|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  509|       |
  510|    590|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  511|       |
  512|    590|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  513|       |
  514|    590|  uint32_t width = readDWORDTag(io_);
  515|    590|  xmpData_["Xmp.video.Width"] = width;
  516|       |
  517|    590|  uint32_t height = readDWORDTag(io_);
  518|    590|  xmpData_["Xmp.video.Height"] = height;
  519|       |
  520|    590|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  521|    590|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  522|       |
  523|    590|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  524|       |
  525|    590|  fillDuration(frame_rate, frame_count);
  526|    590|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  528|    886|void RiffVideo::readStreamHeader() {
  529|    886|  std::string stream = readStringTag(io_);
  530|    886|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (530:17): [True: 197, False: 689]
  ------------------
  531|       |
  532|       |#ifdef EXIV2_DEBUG_MESSAGES
  533|       |  EXV_INFO << "--> fccType                = " << stream << '\n';
  534|       |  EXV_INFO << "--> fccHandler             = " << readStringTag(io_) << '\n';
  535|       |  EXV_INFO << "--> dwFlags                = " << readDWORDTag(io_) << '\n';
  536|       |  EXV_INFO << "--> wPriority              = " << readWORDTag(io_) << '\n';
  537|       |  EXV_INFO << "--> wLanguage              = " << readWORDTag(io_) << '\n';
  538|       |  EXV_INFO << "--> dwInitialFrames        = " << readDWORDTag(io_) << '\n';  // 20
  539|       |  EXV_INFO << "--> dwScale                = " << readDWORDTag(io_) << '\n';
  540|       |  EXV_INFO << "--> dwRate                 = " << readDWORDTag(io_) << '\n';
  541|       |  EXV_INFO << "--> dwStart                = " << readDWORDTag(io_) << '\n';
  542|       |  EXV_INFO << "--> dwLength               = " << readDWORDTag(io_) << '\n';
  543|       |  EXV_INFO << "--> dwSuggestedBufferSize  = " << readDWORDTag(io_) << '\n';  // 40
  544|       |  EXV_INFO << "--> dwSampleSize           = " << readDWORDTag(io_) << '\n';
  545|       |  EXV_INFO << "--> Left                   = " << readWORDTag(io_) << '\n';
  546|       |  EXV_INFO << "--> top                    = " << readWORDTag(io_) << '\n';
  547|       |  EXV_INFO << "--> right                  = " << readWORDTag(io_) << '\n';
  548|       |  EXV_INFO << "--> bottom                 = " << readWORDTag(io_) << '\n';
  549|       |  EXV_INFO << "--> XXXXXX                 = " << readDWORDTag(io_) << '\n';  // 56
  550|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  551|       |    io_->seekOrThrow(io_->tell() - DWORD * 13, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  552|       |#endif
  553|       |
  554|    886|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  555|       |
  556|    886|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  557|    886|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  558|       |
  559|    886|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  560|       |
  561|    886|  if (divisor) {
  ------------------
  |  Branch (561:7): [True: 555, False: 331]
  ------------------
  562|    555|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  563|    555|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (563:14): [True: 117, False: 438]
  ------------------
  564|    555|  }
  565|    886|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  566|       |
  567|    886|  if (divisor) {
  ------------------
  |  Branch (567:7): [True: 541, False: 345]
  ------------------
  568|    541|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  569|    541|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (569:14): [True: 117, False: 424]
  ------------------
  570|    541|  }
  571|       |
  572|    886|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  573|       |
  574|    886|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (574:12): [True: 187, False: 699]
  ------------------
  575|       |
  576|    886|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (576:12): [True: 183, False: 703]
  ------------------
  577|    886|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  578|    886|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  580|  1.81k|void RiffVideo::readStreamFormat(uint64_t size_) {
  581|       |  // The structure of the strf chunk depends on the media type. Video streams use the BITMAPINFOHEADER structure,
  582|       |  // whereas audio streams use the WAVEFORMATEX structure.
  583|       |
  584|       |#ifdef EXIV2_DEBUG_MESSAGES
  585|       |  if (streamType_ == Audio) {
  586|       |    EXV_INFO << "--> wFormatTag      = " << readWORDTag(io_) << '\n';
  587|       |    EXV_INFO << "--> nChannels       = " << readWORDTag(io_) << '\n';
  588|       |    EXV_INFO << "--> nSamplesPerSec  = " << readDWORDTag(io_) << '\n';
  589|       |    EXV_INFO << "--> nAvgBytesPerSec = " << readDWORDTag(io_) << '\n';
  590|       |    EXV_INFO << "--> nBlockAlign     = " << readWORDTag(io_) << '\n';
  591|       |    EXV_INFO << "--> wBitsPerSample  = " << readWORDTag(io_) << '\n';
  592|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  593|       |      io_->seekOrThrow(io_->tell() - DWORD * 4, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  594|       |  } else if (streamType_ == Video) {
  595|       |    EXV_INFO << "--> biSize            = " << readDWORDTag(io_) << '\n';
  596|       |    EXV_INFO << "--> biWidth           = " << readDWORDTag(io_) << '\n';
  597|       |    EXV_INFO << "--> biHeight          = " << readDWORDTag(io_) << '\n';
  598|       |    EXV_INFO << "--> biPlanes          = " << readWORDTag(io_) << '\n';
  599|       |    EXV_INFO << "--> biBitCount        = " << readWORDTag(io_) << '\n';
  600|       |    EXV_INFO << "--> biCompression     = " << readDWORDTag(io_) << '\n';
  601|       |    EXV_INFO << "--> biSizeImage       = " << readDWORDTag(io_) << '\n';
  602|       |    EXV_INFO << "--> biXPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  603|       |    EXV_INFO << "--> biYPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  604|       |    EXV_INFO << "--> biClrUsed         = " << readDWORDTag(io_) << '\n';
  605|       |    EXV_INFO << "--> biClrImportant    = " << readDWORDTag(io_) << '\n';
  606|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  607|       |      io_->seekOrThrow(io_->tell() - DWORD * 10, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  608|       |  }
  609|       |#endif
  610|       |
  611|  1.81k|  if (streamType_ == Video) {
  ------------------
  |  Branch (611:7): [True: 922, False: 895]
  ------------------
  612|    922|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  613|    922|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  614|    922|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  615|    922|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  616|    922|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  617|    922|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  618|    922|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  619|    922|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  620|    922|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (620:18): [True: 616, False: 306]
  ------------------
  621|    616|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  622|    306|    else
  623|    306|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  624|    922|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (624:18): [True: 215, False: 707]
  ------------------
  625|    215|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  626|    707|    else
  627|    707|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  628|    922|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (628:14): [True: 861, False: 34]
  ------------------
  629|    861|    uint16_t format_tag = readWORDTag(io_);
  630|    861|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (630:67): [True: 304, False: 557]
  ------------------
  631|    304|      xmpData_["Xmp.audio.Compressor"] = it->second;
  632|    557|    else
  633|    557|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  634|       |
  635|    861|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  636|    861|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  637|    861|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  638|    861|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  639|    861|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  640|    861|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (640:9): [True: 77, False: 784]
  ------------------
  641|     77|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  642|    861|  } else {
  643|     34|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  644|     34|  }
  645|  1.81k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  647|    763|void RiffVideo::readStreamData(uint64_t size_) const {
  648|    763|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  649|    763|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  651|    201|void RiffVideo::StreamName(uint64_t size_) const {
  652|       |  // This element contains a name for the stream. That stream name should only use plain ASCII, especially not UTF-8.
  653|    201|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  654|    201|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  656|    360|void RiffVideo::readInfoListChunk(uint64_t size_) {
  657|    360|  uint64_t current_size = DWORD;
  658|  3.44k|  while (current_size < size_) {
  ------------------
  |  Branch (658:10): [True: 3.08k, False: 360]
  ------------------
  659|  3.08k|    std::string type = readStringTag(io_);
  660|  3.08k|    size_t size = readDWORDTag(io_);
  661|  3.08k|    std::string content = readStringTag(io_, size);
  662|  3.08k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end())
  ------------------
  |  Branch (662:50): [True: 337, False: 2.75k]
  ------------------
  663|    337|      xmpData_[it->second] = content;
  664|  3.08k|    current_size += DWORD * 2;
  665|  3.08k|    current_size += size;
  666|  3.08k|  }
  667|    360|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  669|    153|void RiffVideo::readMoviList(uint64_t size_) const {
  670|    153|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  671|    153|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  673|    204|void RiffVideo::readVPRPChunk(uint64_t size_) const {
  674|       |#ifdef EXIV2_DEBUG_MESSAGES
  675|       |  EXV_INFO << "--> VideoFormatToken         = " << readDWORDTag(io_) << '\n';
  676|       |  EXV_INFO << "--> VideoStandard            = " << readDWORDTag(io_) << '\n';
  677|       |  EXV_INFO << "--> VerticalRefreshRate      = " << readDWORDTag(io_) << '\n';
  678|       |  EXV_INFO << "--> HTotalInT                = " << readDWORDTag(io_) << '\n';
  679|       |  EXV_INFO << "--> VTotalInLines            = " << readDWORDTag(io_) << '\n';
  680|       |  EXV_INFO << "--> FrameAspectRatio Height  = " << readWORDTag(io_) << '\n';
  681|       |  EXV_INFO << "--> FrameAspectRatio Width   = " << readWORDTag(io_) << '\n';
  682|       |  EXV_INFO << "--> FrameWidthInPixels       = " << readDWORDTag(io_) << '\n';
  683|       |  EXV_INFO << "--> FrameHeightInLines       = " << readDWORDTag(io_) << '\n';
  684|       |  EXV_INFO << "--> CompressedBMHeight       = " << readDWORDTag(io_) << '\n';
  685|       |  EXV_INFO << "--> FieldPerFrame            = " << readDWORDTag(io_) << '\n';
  686|       |  EXV_INFO << "--> CompressedBMWidth        = " << readDWORDTag(io_) << '\n';
  687|       |  EXV_INFO << "--> ValidBMHeight            = " << readDWORDTag(io_) << '\n';
  688|       |  EXV_INFO << "--> ValidBMWidth             = " << readDWORDTag(io_) << '\n';
  689|       |  EXV_INFO << "--> ValidBMXOffset           = " << readDWORDTag(io_) << '\n';
  690|       |  EXV_INFO << "--> ValidBMYOffset           = " << readDWORDTag(io_) << '\n';
  691|       |  EXV_INFO << "--> VideoXOffsetInT          = " << readDWORDTag(io_) << '\n';
  692|       |  EXV_INFO << "--> VideoYValidStartLine     = " << readDWORDTag(io_) << '\n';
  693|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  694|       |    io_->seekOrThrow(io_->tell() - DWORD * 17, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  695|       |#endif
  696|    204|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  697|    204|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  699|    424|void RiffVideo::readIndexChunk(uint64_t size_) const {
  700|       |#ifdef EXIV2_DEBUG_MESSAGES
  701|       |  uint64_t current_size = 0;
  702|       |  while (current_size < size_) {
  703|       |    EXV_DEBUG << "--> Identifier               = " << readStringTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  704|       |              << '\n';
  705|       |    EXV_DEBUG << "--> Flags                    = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  706|       |              << '\n';
  707|       |    EXV_DEBUG << "--> Offset                   = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  708|       |              << '\n';
  709|       |    EXV_DEBUG << "--> Length                   = " << readDWORDTag(io_) << "\t(" << current_size << "/" << size_ << ")"
  710|       |              << '\n';
  711|       |    current_size += DWORD * 4;
  712|       |  }
  713|       |  if (LogMsg::debug >= LogMsg::level() && LogMsg::handler())
  714|       |    io_->seekOrThrow(io_->tell() - size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  715|       |#endif
  716|    424|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  717|    424|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  719|    104|void RiffVideo::readDataChunk(uint64_t size_) const {
  720|       |#ifdef EXIV2_DEBUG_MESSAGES
  721|       |  EXV_INFO << "--> Data               = " << readStringTag(io_, static_cast<size_t>(size_)) << '\n';
  722|       |  uint64_t readed_size = size_;
  723|       |  if (size_ % 2 != 0) {
  724|       |    EXV_INFO << "--> pad byte          = " << readStringTag(io_, 1) << '\n';
  725|       |    readed_size += 1;
  726|       |  }
  727|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  728|       |    io_->seekOrThrow(io_->tell() - readed_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|       |#endif
  730|    104|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  731|    104|  if (size_ % 2 != 0)
  ------------------
  |  Branch (731:7): [True: 67, False: 37]
  ------------------
  732|     67|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  733|    104|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  735|    194|void RiffVideo::readJunk(uint64_t size_) const {
  736|    194|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  737|    194|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  739|  1.43k|std::string RiffVideo::getStreamType(uint32_t stream) {
  740|  1.43k|  if (stream == 1)
  ------------------
  |  Branch (740:7): [True: 95, False: 1.33k]
  ------------------
  741|     95|    return "Mono";
  742|  1.33k|  if (stream == 2)
  ------------------
  |  Branch (742:7): [True: 111, False: 1.22k]
  ------------------
  743|    111|    return "Stereo";
  744|  1.22k|  if (stream == 5)
  ------------------
  |  Branch (744:7): [True: 134, False: 1.09k]
  ------------------
  745|    134|    return "5.1 Surround Sound";
  746|  1.09k|  if (stream == 7)
  ------------------
  |  Branch (746:7): [True: 202, False: 889]
  ------------------
  747|    202|    return "7.1 Surround Sound";
  748|    889|  return "Mono";
  749|  1.09k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  751|    550|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  752|    550|  if (frame_rate == 0)
  ------------------
  |  Branch (752:7): [True: 0, False: 550]
  ------------------
  753|      0|    return;
  754|       |
  755|    550|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  756|    550|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  757|    550|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  758|    550|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  760|    885|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, bool /*create*/) {
  761|    885|  auto image = std::make_unique<RiffVideo>(std::move(io));
  762|    885|  if (!image->good()) {
  ------------------
  |  Branch (762:7): [True: 0, False: 885]
  ------------------
  763|      0|    return nullptr;
  764|      0|  }
  765|    885|  return image;
  766|    885|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  768|  10.6k|bool isRiffType(BasicIo& iIo, bool advance) {
  769|  10.6k|  constexpr int len = 4;
  770|  10.6k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  771|  10.6k|  std::array<byte, len> buf;
  772|  10.6k|  iIo.read(buf.data(), len);
  773|  10.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (773:7): [True: 0, False: 10.6k]
  |  Branch (773:22): [True: 353, False: 10.2k]
  ------------------
  774|    353|    return false;
  775|    353|  }
  776|  10.2k|  bool matched = buf == RiffVideoId;
  777|  10.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (777:7): [True: 10.2k, False: 0]
  |  Branch (777:19): [True: 0, False: 0]
  ------------------
  778|  10.2k|    iIo.seek(-1 * len, BasicIo::cur);
  779|  10.2k|  }
  780|  10.2k|  return matched;
  781|  10.6k|}

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  6.32k|  static constexpr auto tagList() {
   30|  6.32k|    return tagInfo_;
   31|  6.32k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    602|  static constexpr auto tagListCs() {
   34|    602|    return tagInfoCs_;
   35|    602|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    241|  static constexpr auto tagListCs2() {
   38|    241|    return tagInfoCs2_;
   39|    241|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  2.74k|  static constexpr auto tagListFp() {
   42|  2.74k|    return tagInfoFp_;
   43|  2.74k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  1.68k|  static constexpr auto tagListSonyMisc1() {
   46|  1.68k|    return tagInfoSonyMisc1_;
   47|  1.68k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  1.35k|  static constexpr auto tagListSonyMisc2b() {
   50|  1.35k|    return tagInfoSonyMisc2b_;
   51|  1.35k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  15.5k|  static constexpr auto tagListSonyMisc3c() {
   54|  15.5k|    return tagInfoSonyMisc3c_;
   55|  15.5k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|  4.58k|  static constexpr auto tagListSonySInfo1() {
   58|  4.58k|    return tagInfoSonySInfo1_;
   59|  4.58k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.92M|const TagInfo* ifdTagList() {
 1779|  1.92M|  return ifdTagInfo;
 1780|  1.92M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|  13.6k|const TagInfo* exifTagList() {
 2217|  13.6k|  return exifTagInfo;
 2218|  13.6k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|  2.24k|const TagInfo* gpsTagList() {
 2433|  2.24k|  return gpsTagInfo;
 2434|  2.24k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|    342|const TagInfo* iopTagList() {
 2508|    342|  return iopTagInfo;
 2509|    342|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  10.6k|const TagInfo* mnTagList() {
 2524|  10.6k|  return mnTagInfo;
 2525|  10.6k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.16M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.16M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.16M, False: 0]
  ------------------
 2529|  1.16M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.16M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  2.43M|bool isExifIfd(IfdId ifdId) {
 2534|  2.43M|  switch (ifdId) {
 2535|   470k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 470k, False: 1.96M]
  ------------------
 2536|   479k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 8.67k, False: 2.42M]
  ------------------
 2537|   481k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 1.63k, False: 2.42M]
  ------------------
 2538|   481k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 342, False: 2.43M]
  ------------------
 2539|   577k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 95.7k, False: 2.33M]
  ------------------
 2540|   614k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 37.0k, False: 2.39M]
  ------------------
 2541|   614k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 683, False: 2.43M]
  ------------------
 2542|   614k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 2.43M]
  ------------------
 2543|   799k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 184k, False: 2.24M]
  ------------------
 2544|   871k|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 71.4k, False: 2.35M]
  ------------------
 2545|  1.00M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 130k, False: 2.30M]
  ------------------
 2546|  1.14M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 140k, False: 2.29M]
  ------------------
 2547|  1.15M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 15.7k, False: 2.41M]
  ------------------
 2548|  1.17M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 14.4k, False: 2.41M]
  ------------------
 2549|  1.18M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 12.7k, False: 2.41M]
  ------------------
 2550|  1.19M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 11.1k, False: 2.41M]
  ------------------
 2551|  1.20M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 12.0k, False: 2.41M]
  ------------------
 2552|  1.26M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 55.2k, False: 2.37M]
  ------------------
 2553|  1.26M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 776, False: 2.43M]
  ------------------
 2554|  1.26M|      return true;
 2555|  1.16M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.16M, False: 1.26M]
  ------------------
 2556|  1.16M|      return false;
 2557|  2.43M|  }
 2558|  2.43M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  3.26M|const TagInfo* tagList(IfdId ifdId) {
 2569|  3.26M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 3.26M, False: 0]
  ------------------
 2570|  3.26M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 3.26M, False: 0]
  ------------------
 2571|  3.26M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  3.26M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  2.43M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  2.43M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 2.43M, False: 0]
  ------------------
 2577|  2.43M|    int idx = 0;
 2578|   120M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 119M, False: 1.14M]
  ------------------
 2579|   119M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.28M, False: 118M]
  ------------------
 2580|  1.28M|        break;
 2581|   119M|    }
 2582|  2.43M|    return ti + idx;
 2583|  2.43M|  }
 2584|      0|  return nullptr;
 2585|  2.43M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   832k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   832k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 832k]
  ------------------
 2589|      0|    return nullptr;
 2590|   832k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 832k, False: 0]
  ------------------
 2591|  26.8M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 26.8M, False: 0]
  ------------------
 2592|  26.8M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 832k, False: 26.0M]
  ------------------
 2593|   832k|        return ti + idx;
 2594|   832k|      }
 2595|  26.8M|    }
 2596|   832k|  }
 2597|      0|  return nullptr;
 2598|   832k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  2.58M|IfdId groupId(const std::string& groupName) {
 2601|  2.58M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 2.58M, False: 0]
  ------------------
 2602|  2.58M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  2.58M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  1.44M|const char* groupName(IfdId ifdId) {
 2613|  1.44M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 1.44M, False: 0]
  ------------------
 2614|  1.44M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  1.44M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|     35|float fnumber(float apertureValue) {
 2648|     35|  float result = std::exp2(apertureValue / 2.F);
 2649|     35|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 35]
  ------------------
 2650|      0|    result = 3.5F;
 2651|      0|  }
 2652|     35|  return result;
 2653|     35|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|     35|URational exposureTime(float shutterSpeedValue) {
 2656|     35|  URational ur(1, 1);
 2657|     35|  const double tmp = std::exp2(shutterSpeedValue);
 2658|     35|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 0, False: 35]
  ------------------
 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|     35|  } else {
 2665|     35|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     35|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 35, False: 0]
  |  Branch (2667:19): [True: 35, False: 0]
  ------------------
 2668|     35|      ur.first = static_cast<uint32_t>(x);
 2669|     35|    }
 2670|     35|  }
 2671|     35|  return ur;
 2672|     35|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   832k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   832k|  auto ti = tagInfo(tagName, ifdId);
 2676|   832k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 832k, False: 0]
  |  Branch (2676:13): [True: 832k, False: 0]
  ------------------
 2677|   832k|    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|  10.5k|const TagInfo* tagList(const std::string& groupName) {
 3295|  10.5k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  10.5k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 10.5k]
  |  Branch (3296:14): [True: 0, False: 10.5k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  10.5k|  return ii->tagList_();
 3300|  10.5k|}

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

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

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

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|   301k|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|   301k|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|   452k|  [[nodiscard]] uint32_t extendedTag() const {
   86|   452k|    return extendedTag_;
   87|   452k|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|   150k|  [[nodiscard]] IfdId group() const {
   90|   150k|    return group_;
   91|   150k|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  2.00M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  2.00M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  1.84M|  void setStart(const byte* pStart) {
  217|  1.84M|    pStart_ = const_cast<byte*>(pStart);
  218|  1.84M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|  29.2M|  [[nodiscard]] uint16_t tag() const {
  241|  29.2M|    return tag_;
  242|  29.2M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  8.01M|  [[nodiscard]] IfdId group() const {
  245|  8.01M|    return group_;
  246|  8.01M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  1.89M|  [[nodiscard]] byte* start() const {
  249|  1.89M|    return pStart_;
  250|  1.89M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  1.43M|  void setOffset(size_t offset) {
  417|  1.43M|    offset_ = offset;
  418|  1.43M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|   225k|  [[nodiscard]] TiffType tiffType() const {
  459|   225k|    return tiffType_;
  460|   225k|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  10.6k|  [[nodiscard]] size_t offset() const {
  466|  10.6k|    return offset_;
  467|  10.6k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  1.82M|  [[nodiscard]] const byte* pData() const {
  477|  1.82M|    return pData_;
  478|  1.82M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  4.92M|  [[nodiscard]] const Value* pValue() const {
  481|  4.92M|    return pValue_.get();
  482|  4.92M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  1.42M|  void setIdx(int idx) {
  502|  1.42M|    idx_ = idx;
  503|  1.42M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|   887k|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|   887k|    return storage_;
  542|   887k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  49.4k|  [[nodiscard]] uint16_t szTag() const {
  624|  49.4k|    return szTag_;
  625|  49.4k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  49.4k|  [[nodiscard]] IfdId szGroup() const {
  628|  49.4k|    return szGroup_;
  629|  49.4k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  56.6k|  [[nodiscard]] uint16_t dtTag() const {
  790|  56.6k|    return dtTag_;
  791|  56.6k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  56.6k|  [[nodiscard]] IfdId dtGroup() const {
  794|  56.6k|    return dtGroup_;
  795|  56.6k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  16.1k|  [[nodiscard]] bool hasNext() const {
  843|  16.1k|    return hasNext_;
  844|  16.1k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  3.10k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  3.10k|    imageByteOrder_ = byteOrder;
 1108|  3.10k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  1.43M|  bool operator==(size_t idx) const {
 1218|  1.43M|    return idx_ == idx;
 1219|  1.43M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|   887k|  [[nodiscard]] size_t tagStep() const {
 1235|   887k|    return elDefaultDef_.size(0, group_);
 1236|   887k|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|   890k|  void setDecoded(bool decoded) {
 1311|   890k|    decoded_ = decoded;
 1312|   890k|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  3.55M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  3.55M|    return arrayCfg_;
 1320|  3.55M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|  1.05k|  [[nodiscard]] const ArrayDef* def() const {
 1323|  1.05k|    return arrayDef_;
 1324|  1.05k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  1.05k|  [[nodiscard]] size_t defSize() const {
 1327|  1.05k|    return defSize_;
 1328|  1.05k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|  5.13k|  [[nodiscard]] bool decoded() const {
 1331|  5.13k|    return decoded_;
 1332|  5.13k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|   887k|  void setElDef(const ArrayDef& def) {
 1405|   887k|    elDef_ = def;
 1406|   887k|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|   887k|  void setElByteOrder(ByteOrder byteOrder) {
 1411|   887k|    elByteOrder_ = byteOrder;
 1412|   887k|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|   891k|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|   891k|    return &elDef_;
 1422|   891k|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|   891k|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|   891k|    return elByteOrder_;
 1428|   891k|  }
_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|     36|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     36|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     36|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     81|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     81|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     81|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    625|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    625|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    625|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    161|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    161|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    161|}
_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|    283|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    283|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    283|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  10.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  10.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  10.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.79k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.79k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.79k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.54k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.54k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.54k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    990|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    990|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    990|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  14.1k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  14.1k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  14.1k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  22.8k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  22.8k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  22.8k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.78k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.78k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.78k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.89k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.89k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.89k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.03k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.03k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.03k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.45k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.45k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.45k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.60k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.60k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.60k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    491|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    491|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    491|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.54k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.54k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.54k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.02k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.02k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.02k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    779|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    779|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    779|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    481|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    481|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    481|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    298|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    298|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    298|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     97|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     97|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     97|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    597|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    597|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    597|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    430|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    430|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    430|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.64k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.64k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.64k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.94k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.94k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.94k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    634|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    634|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    634|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    473|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    473|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    473|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.11k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.11k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.11k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.52k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.52k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.52k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.86k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.86k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.86k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.27k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.27k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.27k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.14k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.14k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.14k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    461|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    461|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    461|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.83k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.83k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.83k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.74k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.74k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.74k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    467|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    467|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    467|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    328|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    328|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    328|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    396|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    396|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    396|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    242|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    242|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    242|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    374|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    374|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    374|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    889|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    889|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    889|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    267|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    267|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    267|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    398|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    398|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    398|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    188|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    188|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    188|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    373|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    373|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    373|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.04k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.04k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.04k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    384|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    384|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    384|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    167|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    167|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    167|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    222|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    222|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    222|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__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_5IfdIdE15EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    710|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    710|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    710|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    280|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    280|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    280|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     86|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     86|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     86|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    211|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    211|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    211|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    212|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    212|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    212|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    226|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    226|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    226|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    305|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    305|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    305|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     75|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     75|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     75|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    225|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    225|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    225|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    149|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    149|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    149|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    144|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    144|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    144|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    164|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    164|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    164|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    514|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    514|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    514|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     64|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     64|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     64|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  2.83k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  2.83k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  2.83k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.87k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.87k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.87k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    554|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    554|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    554|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    417|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    417|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    417|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    333|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    333|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    333|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  2.35k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  2.35k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  2.35k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  7.36k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  7.36k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  7.36k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    339|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    339|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    339|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     98|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     98|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     98|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     89|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     89|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     89|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    216|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    216|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    216|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     66|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     66|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     66|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     80|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     80|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     80|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    261|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    261|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    261|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     75|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     75|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     75|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    207|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    207|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    207|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     80|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     80|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     80|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    209|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    209|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    209|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     56|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     56|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     56|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     74|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     74|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     74|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    195|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    195|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    195|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     66|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     66|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     66|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    197|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    197|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    197|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    316|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    316|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    316|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    387|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    387|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    387|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     33|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     33|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     33|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    297|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    297|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    297|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     77|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     77|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     77|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     76|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     76|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     76|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     77|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     77|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     77|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_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|     87|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     87|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     87|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     70|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     70|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     70|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    102|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    102|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    102|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    253|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    253|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    253|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     90|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     90|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     90|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__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_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     68|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     68|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     68|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    184|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    184|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    184|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__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_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     85|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     85|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     85|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    515|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    515|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    515|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    102|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    102|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    628|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    628|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    628|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    628|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    329|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    329|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    329|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    697|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    697|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    697|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     57|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     57|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     57|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     97|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     97|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     97|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     80|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     80|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    139|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    139|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    139|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    139|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    147|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    147|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    147|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    283|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    283|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    283|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     71|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     71|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     71|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     92|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     92|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     92|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    112|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    112|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    112|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    110|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    110|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    110|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    106|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    106|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    106|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__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|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     80|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     80|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     80|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    125|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    125|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    125|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     52|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     52|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     52|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     52|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     43|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     43|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     43|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     43|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     73|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     73|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     73|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     73|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    130|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    130|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    130|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    130|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    183|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    183|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    183|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    183|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    168|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    168|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    168|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    168|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    121|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    121|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    121|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    121|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     39|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     39|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     39|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     39|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     37|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     37|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     37|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     37|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     40|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     40|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     40|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     40|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     23|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     23|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     23|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     23|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     38|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     38|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     38|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     38|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     45|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     45|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     45|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    146|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    146|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    146|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    109|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    109|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    109|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     82|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     82|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     82|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     68|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     68|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     68|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     75|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     75|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     75|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     38|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     38|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     38|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     38|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     36|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     36|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     36|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     33|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     33|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     33|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     33|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    139|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    139|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    139|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    139|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    130|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    130|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    130|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    130|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    362|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    362|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    362|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    362|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     44|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     44|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     44|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     44|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    102|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    102|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     55|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     55|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     55|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     55|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     38|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     38|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     38|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     88|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     88|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     88|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    100|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    100|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    100|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    100|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     38|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     38|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     38|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     66|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     66|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     66|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     41|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     41|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     41|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     41|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    113|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    113|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    113|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  2.00M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  51.0k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  9.68k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  6.11k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|   150k|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|   150k|  return ifdId_ == md.ifdId();
   31|   150k|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.42M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.42M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.42M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 10.4k, False: 1.41M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  10.4k|    decoderFct = td->decoderFct_;
 1996|  10.4k|  }
 1997|  1.42M|  return decoderFct;
 1998|  1.42M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|   150k|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|   150k|  EncoderFct encoderFct = nullptr;
 2002|   150k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 150k]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|      0|    encoderFct = td->encoderFct_;
 2005|      0|  }
 2006|   150k|  return encoderFct;
 2007|   150k|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  1.98M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  1.98M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  1.98M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  1.98M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 1.77M, False: 205k]
  ------------------
 2014|  1.77M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  1.77M|  }
 2016|  1.98M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 1.98M, False: 259]
  |  Branch (2016:7): [True: 1.97M, False: 9.13k]
  |  Branch (2016:37): [True: 1.97M, False: 8.87k]
  ------------------
 2017|  1.97M|    return i->second(tag, group);
 2018|  1.97M|  }
 2019|       |#ifdef EXIV2_DEBUG_MESSAGES
 2020|       |  if (i == tiffGroupTable_.end())
 2021|       |    std::cerr << "Warning: No TIFF structure entry found for ";
 2022|       |  else
 2023|       |    std::cerr << "Warning: No TIFF component creator found for ";
 2024|       |  std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0') << std::hex << std::right << extendedTag
 2025|       |            << ", group " << groupName(group) << "\n";
 2026|       |#endif
 2027|  9.13k|  return nullptr;
 2028|  1.98M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|   150k|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|   150k|  TiffPath ret;
 2032|   301k|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 301k, Folded]
  ------------------
 2033|   301k|    ret.emplace(extendedTag, group);
 2034|   301k|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|   301k|    assert(ts != tiffTreeTable_.end());
 2036|   301k|    extendedTag = ts->second.second;
 2037|   301k|    group = ts->second.first;
 2038|   301k|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 150k, False: 150k]
  ------------------
 2039|   150k|      break;
 2040|   150k|    }
 2041|   301k|  }
 2042|   150k|  return ret;
 2043|   150k|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  12.6k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  12.6k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  12.6k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 12.3k, False: 293]
  ------------------
 2050|  12.3k|    ph = std::make_unique<TiffHeader>();
 2051|  12.3k|    pHeader = ph.get();
 2052|  12.3k|  }
 2053|       |
 2054|  12.6k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 12.0k, False: 601]
  ------------------
 2055|  12.0k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  12.0k|    rootDir->accept(decoder);
 2057|  12.0k|  }
 2058|  12.6k|  return pHeader->byteOrder();
 2059|       |
 2060|  12.6k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  4.73k|                                     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.73k|  WriteMethod writeMethod = wmIntrusive;
 2074|  4.73k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  4.73k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  4.73k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 0, False: 4.73k]
  ------------------
 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.73k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 4.73k, False: 0]
  ------------------
 2084|  4.73k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  4.73k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 0, False: 4.73k]
  ------------------
 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.73k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  4.73k|                        findEncoderFct);
 2093|  4.73k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  4.73k|    DataBuf header = pHeader->write();
 2096|  4.73k|    auto tempIo = MemIo();
 2097|  4.73k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  4.73k|    auto imageIdx(std::string::npos);
 2099|  4.73k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  4.73k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 0, False: 4.73k]
  ------------------
 2101|      0|      pOffsetWriter->writeOffsets(tempIo);
 2102|  4.73k|    io.transfer(tempIo);  // may throw
 2103|  4.73k|#ifndef SUPPRESS_WARNINGS
 2104|  4.73k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  4.73k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.73k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.73k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  4.73k|#endif
 2106|  4.73k|  }
 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.73k|#endif
 2112|  4.73k|  return writeMethod;
 2113|  4.73k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  17.3k|                                                 TiffHeaderBase* pHeader) {
 2117|  17.3k|  TiffComponent::UniquePtr rootDir;
 2118|  17.3k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 5.07k, False: 12.3k]
  |  Branch (2118:17): [True: 0, False: 12.3k]
  ------------------
 2119|  5.07k|    return rootDir;
 2120|  12.3k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 141, False: 12.1k]
  |  Branch (2120:38): [True: 123, False: 12.0k]
  ------------------
 2121|    264|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    264|  }
 2123|  12.0k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  12.0k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 12.0k, False: 0]
  ------------------
 2125|  12.0k|    rootDir->setStart(pData + pHeader->offset());
 2126|  12.0k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  12.0k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  12.0k|    rootDir->accept(reader);
 2129|  12.0k|    reader.postProcess();
 2130|  12.0k|  }
 2131|  12.0k|  return rootDir;
 2132|       |
 2133|  12.3k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  4.73k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  4.73k|  PrimaryGroups ret;
 2137|  4.73k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 4.73k, False: 0]
  ------------------
 2138|  4.73k|    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.73k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   306k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   306k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   240k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   240k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 240k]
  |  Branch (2165:17): [True: 45, False: 240k]
  ------------------
 2166|     45|    return false;
 2167|       |
 2168|   240k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 16.2k, False: 223k]
  |  Branch (2168:26): [True: 15.9k, False: 233]
  ------------------
 2169|  15.9k|    byteOrder_ = littleEndian;
 2170|   224k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 29.0k, False: 195k]
  |  Branch (2170:33): [True: 28.7k, False: 317]
  ------------------
 2171|  28.7k|    byteOrder_ = bigEndian;
 2172|   195k|  } else {
 2173|   195k|    return false;
 2174|   195k|  }
 2175|  44.7k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|  44.7k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 44.7k, False: 33]
  |  Branch (2176:19): [True: 44.6k, False: 100]
  |  Branch (2176:33): [True: 1.99k, False: 42.6k]
  ------------------
 2177|  1.99k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  42.7k|  tag_ = t;
 2179|  42.7k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  42.7k|  return true;
 2182|  44.7k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  4.73k|DataBuf TiffHeaderBase::write() const {
 2185|  4.73k|  DataBuf buf(8);
 2186|  4.73k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 4.73k, False: 0]
  ------------------
 2187|  4.73k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 4.73k, False: 0]
  ------------------
 2188|  4.73k|      buf.write_uint8(0, 'I');
 2189|  4.73k|      break;
 2190|      0|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 0, False: 4.73k]
  ------------------
 2191|      0|      buf.write_uint8(0, 'M');
 2192|      0|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 4.73k]
  ------------------
 2194|      0|      break;
 2195|  4.73k|  }
 2196|  4.73k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  4.73k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  4.73k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  4.73k|  return buf;
 2200|  4.73k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|  56.6k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|  56.6k|  return byteOrder_;
 2220|  56.6k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  11.4k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  11.4k|  byteOrder_ = byteOrder;
 2224|  11.4k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  24.5k|uint32_t TiffHeaderBase::offset() const {
 2227|  24.5k|  return offset_;
 2228|  24.5k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  10.5k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  10.5k|  offset_ = offset;
 2232|  10.5k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  11.8k|uint16_t TiffHeaderBase::tag() const {
 2239|  11.8k|  return tag_;
 2240|  11.8k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|   235k|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|   235k|  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|   235k|  return result;
 2335|   235k|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   220k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   220k|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|   235k|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|   235k|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 0, False: 235k]
  ------------------
 2248|      0|    return false;
 2249|      0|  }
 2250|       |  //! List of TIFF image tags
 2251|   235k|  switch (tag) {
 2252|      0|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 0, False: 235k]
  ------------------
 2253|      0|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 0, False: 235k]
  ------------------
 2254|  10.0k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 10.0k, False: 225k]
  ------------------
 2255|  89.8k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 79.7k, False: 156k]
  ------------------
 2256|  96.6k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 6.82k, False: 228k]
  ------------------
 2257|  96.9k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 228, False: 235k]
  ------------------
 2258|  97.4k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 501, False: 235k]
  ------------------
 2259|  97.6k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 201, False: 235k]
  ------------------
 2260|   107k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 9.57k, False: 226k]
  ------------------
 2261|   107k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 52, False: 235k]
  ------------------
 2262|   107k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 113, False: 235k]
  ------------------
 2263|   115k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 7.92k, False: 227k]
  ------------------
 2264|   115k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 228, False: 235k]
  ------------------
 2265|   115k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 101, False: 235k]
  ------------------
 2266|   115k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 256, False: 235k]
  ------------------
 2267|   115k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 97, False: 235k]
  ------------------
 2268|   116k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 144, False: 235k]
  ------------------
 2269|   116k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 110, False: 235k]
  ------------------
 2270|   116k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 91, False: 235k]
  ------------------
 2271|   116k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 182, False: 235k]
  ------------------
 2272|   116k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 94, False: 235k]
  ------------------
 2273|   116k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 125, False: 235k]
  ------------------
 2274|   116k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 74, False: 235k]
  ------------------
 2275|   116k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 85, False: 235k]
  ------------------
 2276|   117k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 233, False: 235k]
  ------------------
 2277|   117k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 106, False: 235k]
  ------------------
 2278|   117k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 124, False: 235k]
  ------------------
 2279|   117k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 79, False: 235k]
  ------------------
 2280|   117k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 138, False: 235k]
  ------------------
 2281|   119k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 1.67k, False: 234k]
  ------------------
 2282|   119k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 753, False: 235k]
  ------------------
 2283|   120k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 79, False: 235k]
  ------------------
 2284|   123k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 3.01k, False: 232k]
  ------------------
 2285|   123k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 316, False: 235k]
  ------------------
 2286|   123k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 74, False: 235k]
  ------------------
 2287|   123k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 366, False: 235k]
  ------------------
 2288|   123k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 155, False: 235k]
  ------------------
 2289|   124k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 103, False: 235k]
  ------------------
 2290|   124k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 316, False: 235k]
  ------------------
 2291|   124k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 113, False: 235k]
  ------------------
 2292|   124k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 78, False: 235k]
  ------------------
 2293|   124k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 115, False: 235k]
  ------------------
 2294|   124k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 265, False: 235k]
  ------------------
 2295|   125k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 119, False: 235k]
  ------------------
 2296|   125k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 258, False: 235k]
  ------------------
 2297|   125k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 452, False: 235k]
  ------------------
 2298|   128k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 2.71k, False: 233k]
  ------------------
 2299|   136k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 8.22k, False: 227k]
  ------------------
 2300|   149k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 12.6k, False: 223k]
  ------------------
 2301|   149k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 105, False: 235k]
  ------------------
 2302|   149k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 109, False: 235k]
  ------------------
 2303|   149k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 266, False: 235k]
  ------------------
 2304|   149k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 142, False: 235k]
  ------------------
 2305|   150k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 196, False: 235k]
  ------------------
 2306|   150k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 67, False: 235k]
  ------------------
 2307|   150k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 235, False: 235k]
  ------------------
 2308|   150k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 101, False: 235k]
  ------------------
 2309|   150k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 102, False: 235k]
  ------------------
 2310|   150k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 59, False: 235k]
  ------------------
 2311|   150k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 75, False: 235k]
  ------------------
 2312|   150k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 69, False: 235k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|   150k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 35, False: 235k]
  ------------------
 2315|   150k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 66, False: 235k]
  ------------------
 2316|   151k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 44, False: 235k]
  ------------------
 2317|   151k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 18, False: 235k]
  ------------------
 2318|   151k|      return true;
 2319|  84.7k|    default:
  ------------------
  |  Branch (2319:5): [True: 84.7k, False: 151k]
  ------------------
 2320|  84.7k|      return false;
 2321|   235k|  }
 2322|   235k|}

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

_ZN5Exiv28Internal11TiffVisitor5setGoENS1_7GoEventEb:
   61|   129k|void TiffVisitor::setGo(GoEvent event, bool go) {
   62|   129k|  go_[event] = go;
   63|   129k|}
_ZNK5Exiv28Internal11TiffVisitor2goENS1_7GoEventE:
   65|  47.9M|bool TiffVisitor::go(GoEvent event) const {
   66|  47.9M|  return go_[event];
   67|  47.9M|}
_ZN5Exiv28Internal11TiffVisitor18visitDirectoryNextEPNS0_13TiffDirectoryE:
   69|   496k|void TiffVisitor::visitDirectoryNext(TiffDirectory* /*object*/) {
   70|   496k|}
_ZN5Exiv28Internal11TiffVisitor17visitDirectoryEndEPNS0_13TiffDirectoryE:
   72|   483k|void TiffVisitor::visitDirectoryEnd(TiffDirectory* /*object*/) {
   73|   483k|}
_ZN5Exiv28Internal11TiffVisitor20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
   75|  4.79k|void TiffVisitor::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
   76|  4.79k|}
_ZN5Exiv28Internal11TiffVisitor19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
   78|  31.5k|void TiffVisitor::visitBinaryArrayEnd(TiffBinaryArray* /*object*/) {
   79|  31.5k|}
_ZN5Exiv28Internal10TiffFinder4initEtNS_5IfdIdE:
   81|     41|void TiffFinder::init(uint16_t tag, IfdId group) {
   82|     41|  tag_ = tag;
   83|     41|  group_ = group;
   84|     41|  tiffComponent_ = nullptr;
   85|     41|  setGo(geTraverse, true);
   86|     41|}
_ZN5Exiv28Internal10TiffFinder10findObjectEPNS0_13TiffComponentE:
   88|  19.5M|void TiffFinder::findObject(TiffComponent* object) {
   89|  19.5M|  if (object->tag() == tag_ && object->group() == group_) {
  ------------------
  |  Branch (89:7): [True: 451k, False: 19.1M]
  |  Branch (89:32): [True: 91.7k, False: 360k]
  ------------------
   90|  91.7k|    tiffComponent_ = object;
   91|  91.7k|    setGo(geTraverse, false);
   92|  91.7k|  }
   93|  19.5M|}
_ZN5Exiv28Internal10TiffFinder10visitEntryEPNS0_9TiffEntryE:
   95|  11.6M|void TiffFinder::visitEntry(TiffEntry* object) {
   96|  11.6M|  findObject(object);
   97|  11.6M|}
_ZN5Exiv28Internal10TiffFinder14visitDataEntryEPNS0_13TiffDataEntryE:
   99|   121k|void TiffFinder::visitDataEntry(TiffDataEntry* object) {
  100|   121k|  findObject(object);
  101|   121k|}
_ZN5Exiv28Internal10TiffFinder15visitImageEntryEPNS0_14TiffImageEntryE:
  103|  2.27M|void TiffFinder::visitImageEntry(TiffImageEntry* object) {
  104|  2.27M|  findObject(object);
  105|  2.27M|}
_ZN5Exiv28Internal10TiffFinder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  107|  2.62M|void TiffFinder::visitSizeEntry(TiffSizeEntry* object) {
  108|  2.62M|  findObject(object);
  109|  2.62M|}
_ZN5Exiv28Internal10TiffFinder14visitDirectoryEPNS0_13TiffDirectoryE:
  111|   554k|void TiffFinder::visitDirectory(TiffDirectory* object) {
  112|   554k|  findObject(object);
  113|   554k|}
_ZN5Exiv28Internal10TiffFinder11visitSubIfdEPNS0_10TiffSubIfdE:
  115|   122k|void TiffFinder::visitSubIfd(TiffSubIfd* object) {
  116|   122k|  findObject(object);
  117|   122k|}
_ZN5Exiv28Internal10TiffFinder12visitMnEntryEPNS0_11TiffMnEntryE:
  119|  35.1k|void TiffFinder::visitMnEntry(TiffMnEntry* object) {
  120|  35.1k|  findObject(object);
  121|  35.1k|}
_ZN5Exiv28Internal10TiffFinder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  123|  6.04k|void TiffFinder::visitIfdMakernote(TiffIfdMakernote* object) {
  124|  6.04k|  findObject(object);
  125|  6.04k|}
_ZN5Exiv28Internal10TiffFinder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  127|  19.5k|void TiffFinder::visitBinaryArray(TiffBinaryArray* object) {
  128|  19.5k|  findObject(object);
  129|  19.5k|}
_ZN5Exiv28Internal10TiffFinder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  131|  2.21M|void TiffFinder::visitBinaryElement(TiffBinaryElement* object) {
  132|  2.21M|  findObject(object);
  133|  2.21M|}
_ZN5Exiv28Internal11TiffDecoderC2ERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPNS0_13TiffComponentEPFMS1_FvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSF_11char_traitsIcEEEEjNS_5IfdIdEE:
  195|  12.0k|    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.0k|  ExifKey key("Exif.Image.Make");
  199|  12.0k|  if (exifData_.findKey(key) != exifData_.end()) {
  ------------------
  |  Branch (199:7): [True: 124, False: 11.9k]
  ------------------
  200|    124|    make_ = exifData_.findKey(key)->toString();
  201|  11.9k|  } else {
  202|       |    // Find camera make by looking for tag 0x010f in IFD0
  203|  11.9k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  204|  11.9k|    pRoot_->accept(finder);
  205|  11.9k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  206|  11.9k|    if (te && te->pValue()) {
  ------------------
  |  Branch (206:9): [True: 1.96k, False: 9.96k]
  |  Branch (206:15): [True: 1.92k, False: 40]
  ------------------
  207|  1.92k|      make_ = te->pValue()->toString();
  208|  1.92k|    }
  209|  11.9k|  }
  210|  12.0k|}
_ZN5Exiv28Internal11TiffDecoder10visitEntryEPNS0_9TiffEntryE:
  212|   776k|void TiffDecoder::visitEntry(TiffEntry* object) {
  213|   776k|  decodeTiffEntry(object);
  214|   776k|}
_ZN5Exiv28Internal11TiffDecoder14visitDataEntryEPNS0_13TiffDataEntryE:
  216|  5.43k|void TiffDecoder::visitDataEntry(TiffDataEntry* object) {
  217|  5.43k|  decodeTiffEntry(object);
  218|  5.43k|}
_ZN5Exiv28Internal11TiffDecoder15visitImageEntryEPNS0_14TiffImageEntryE:
  220|  41.9k|void TiffDecoder::visitImageEntry(TiffImageEntry* object) {
  221|  41.9k|  decodeTiffEntry(object);
  222|  41.9k|}
_ZN5Exiv28Internal11TiffDecoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  224|  56.6k|void TiffDecoder::visitSizeEntry(TiffSizeEntry* object) {
  225|  56.6k|  decodeTiffEntry(object);
  226|  56.6k|}
_ZN5Exiv28Internal11TiffDecoder14visitDirectoryEPNS0_13TiffDirectoryE:
  228|  41.8k|void TiffDecoder::visitDirectory(TiffDirectory* /* object */) {
  229|       |  // Nothing to do
  230|  41.8k|}
_ZN5Exiv28Internal11TiffDecoder11visitSubIfdEPNS0_10TiffSubIfdE:
  232|  9.67k|void TiffDecoder::visitSubIfd(TiffSubIfd* object) {
  233|  9.67k|  decodeTiffEntry(object);
  234|  9.67k|}
_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.66k|void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
  242|  2.66k|  exifData_["Exif.MakerNote.Offset"] = static_cast<uint32_t>(object->mnOffset());
  243|  2.66k|  switch (object->byteOrder()) {
  ------------------
  |  Branch (243:11): [True: 2.66k, False: 0]
  ------------------
  244|  2.53k|    case littleEndian:
  ------------------
  |  Branch (244:5): [True: 2.53k, False: 133]
  ------------------
  245|  2.53k|      exifData_["Exif.MakerNote.ByteOrder"] = "II";
  246|  2.53k|      break;
  247|    133|    case bigEndian:
  ------------------
  |  Branch (247:5): [True: 133, False: 2.53k]
  ------------------
  248|    133|      exifData_["Exif.MakerNote.ByteOrder"] = "MM";
  249|    133|      break;
  250|      0|    case invalidByteOrder:
  ------------------
  |  Branch (250:5): [True: 0, False: 2.66k]
  ------------------
  251|      0|      break;
  252|  2.66k|  }
  253|  2.66k|}
_ZN5Exiv28Internal11TiffDecoder10getObjDataERPKhRmtNS_5IfdIdEPKNS0_13TiffEntryBaseE:
  255|  8.54k|void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
  256|  8.54k|  if (object && object->tag() == tag && object->group() == group) {
  ------------------
  |  Branch (256:7): [True: 8.54k, False: 0]
  |  Branch (256:17): [True: 8.43k, False: 102]
  |  Branch (256:41): [True: 8.43k, False: 0]
  ------------------
  257|  8.43k|    pData = object->pData();
  258|  8.43k|    size = object->size();
  259|  8.43k|    return;
  260|  8.43k|  }
  261|    102|  TiffFinder finder(tag, group);
  262|    102|  pRoot_->accept(finder);
  263|    102|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (263:12): [True: 25, False: 77]
  ------------------
  264|     25|    pData = te->pData();
  265|     25|    size = te->size();
  266|     25|    return;
  267|     25|  }
  268|    102|}
_ZN5Exiv28Internal11TiffDecoder9decodeXmpEPKNS0_13TiffEntryBaseE:
  270|  8.28k|void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
  271|       |  // add Exif tag anyway
  272|  8.28k|  decodeStdTiffEntry(object);
  273|       |
  274|  8.28k|  const byte* pData = nullptr;
  275|  8.28k|  size_t size = 0;
  276|  8.28k|  getObjData(pData, size, 0x02bc, IfdId::ifd0Id, object);
  277|  8.28k|  if (pData) {
  ------------------
  |  Branch (277:7): [True: 8.28k, False: 0]
  ------------------
  278|  8.28k|    std::string xmpPacket;
  279|  8.28k|    xmpPacket.assign(reinterpret_cast<const char*>(pData), size);
  280|  8.28k|    std::string::size_type idx = xmpPacket.find_first_of('<');
  281|  8.28k|    if (idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (281:9): [True: 7.22k, False: 1.06k]
  |  Branch (281:37): [True: 7.18k, False: 43]
  ------------------
  282|  7.18k|#ifndef SUPPRESS_WARNINGS
  283|  7.18k|      EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|  7.18k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.18k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.18k|  LogMsg(LogMsg::warn).os()
  ------------------
  284|  7.18k|#endif
  285|  7.18k|      xmpPacket = xmpPacket.substr(idx);
  286|  7.18k|    }
  287|  8.28k|    if (XmpParser::decode(xmpData_, xmpPacket)) {
  ------------------
  |  Branch (287:9): [True: 2.21k, False: 6.07k]
  ------------------
  288|  2.21k|#ifndef SUPPRESS_WARNINGS
  289|  2.21k|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  2.21k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.21k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.21k|  LogMsg(LogMsg::warn).os()
  ------------------
  290|  2.21k|#endif
  291|  2.21k|    }
  292|  8.28k|  }
  293|  8.28k|}  // TiffDecoder::decodeXmp
_ZN5Exiv28Internal11TiffDecoder10decodeIptcEPKNS0_13TiffEntryBaseE:
  295|    276|void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
  296|       |  // add Exif tag anyway
  297|    276|  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|    276|  if (decodedIptc_) {
  ------------------
  |  Branch (301:7): [True: 121, False: 155]
  ------------------
  302|    121|    return;
  303|    121|  }
  304|    155|  decodedIptc_ = true;
  305|       |  // 1st choice: IPTCNAA
  306|    155|  const byte* pData = nullptr;
  307|    155|  size_t size = 0;
  308|    155|  getObjData(pData, size, 0x83bb, IfdId::ifd0Id, object);
  309|    155|  if (pData) {
  ------------------
  |  Branch (309:7): [True: 101, False: 54]
  ------------------
  310|    101|    if (0 == IptcParser::decode(iptcData_, pData, size)) {
  ------------------
  |  Branch (310:9): [True: 58, False: 43]
  ------------------
  311|     58|      return;
  312|     58|    }
  313|     43|#ifndef SUPPRESS_WARNINGS
  314|     43|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x83bb\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()
  ------------------
  315|       |
  316|     43|#endif
  317|     43|  }
  318|       |
  319|       |  // 2nd choice if no IPTCNAA record found or failed to decode it:
  320|       |  // ImageResources
  321|     97|  pData = nullptr;
  322|     97|  size = 0;
  323|     97|  getObjData(pData, size, 0x8649, IfdId::ifd0Id, object);
  324|     97|  if (pData) {
  ------------------
  |  Branch (324:7): [True: 62, False: 35]
  ------------------
  325|     62|    const byte* record = nullptr;
  326|     62|    uint32_t sizeHdr = 0;
  327|     62|    uint32_t sizeData = 0;
  328|     62|    if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {
  ------------------
  |  Branch (328:9): [True: 62, False: 0]
  ------------------
  329|     62|      return;
  330|     62|    }
  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|     97|}  // TiffMetadataDecoder::decodeIptc
_ZN5Exiv28Internal11TiffDecoder17decodeCanonAFInfoEPKNS0_13TiffEntryBaseE:
  347|  1.91k|void TiffDecoder::decodeCanonAFInfo(const TiffEntryBase* object) {
  348|       |  // report Exif.Canon.AFInfo as usual
  349|  1.91k|  TiffDecoder::decodeStdTiffEntry(object);
  350|  1.91k|  if (object->pValue()->count() < 3 || object->pValue()->typeId() != unsignedShort)
  ------------------
  |  Branch (350:7): [True: 295, False: 1.62k]
  |  Branch (350:40): [True: 129, False: 1.49k]
  ------------------
  351|    424|    return;  // insufficient data
  352|       |
  353|       |  // create vector of signedShorts from unsignedShorts in Exif.Canon.AFInfo
  354|  1.49k|  std::vector<int16_t> ints;
  355|  1.49k|  std::vector<uint16_t> uint;
  356|   359k|  for (size_t i = 0; i < object->pValue()->count(); i++) {
  ------------------
  |  Branch (356:22): [True: 357k, False: 1.49k]
  ------------------
  357|   357k|    ints.push_back(object->pValue()->toInt64(i));
  358|   357k|    uint.push_back(object->pValue()->toUint32(i));
  359|   357k|  }
  360|       |  // Check this is AFInfo2 (ints[0] = bytes in object)
  361|  1.49k|  if (ints.front() != static_cast<int16_t>(object->pValue()->count()) * 2)
  ------------------
  |  Branch (361:7): [True: 122, False: 1.37k]
  ------------------
  362|    122|    return;
  363|       |
  364|  1.37k|  std::string familyGroup(std::string("Exif.") + groupName(object->group()) + ".");
  365|       |
  366|  1.37k|  const uint16_t nPoints = uint.at(2);
  367|  1.37k|  const uint16_t nMasks = (nPoints + 15) / (sizeof(uint16_t) * 8);
  368|  1.37k|  int nStart = 0;
  369|       |
  370|  1.37k|  const std::tuple<uint16_t, uint16_t, bool> records[] = {
  371|  1.37k|      {0x2600, 1, true},        // AFInfoSize
  372|  1.37k|      {0x2601, 1, true},        // AFAreaMode
  373|  1.37k|      {0x2602, 1, true},        // AFNumPoints
  374|  1.37k|      {0x2603, 1, true},        // AFValidPoints
  375|  1.37k|      {0x2604, 1, true},        // AFCanonImageWidth
  376|  1.37k|      {0x2605, 1, true},        // AFCanonImageHeight
  377|  1.37k|      {0x2606, 1, true},        // AFImageWidth"
  378|  1.37k|      {0x2607, 1, true},        // AFImageHeight
  379|  1.37k|      {0x2608, nPoints, true},  // AFAreaWidths
  380|  1.37k|      {0x2609, nPoints, true},  // AFAreaHeights
  381|  1.37k|      {0x260a, nPoints, true},  // AFXPositions
  382|  1.37k|      {0x260b, nPoints, true},  // AFYPositions
  383|  1.37k|      {0x260c, nMasks, false},  // AFPointsInFocus
  384|  1.37k|      {0x260d, nMasks, false},  // AFPointsSelected
  385|  1.37k|      {0x260e, nMasks, false},  // AFPointsUnusable
  386|  1.37k|  };
  387|       |  // check we have enough data!
  388|  1.37k|  uint16_t count = 0;
  389|  17.3k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (389:41): [True: 17.3k, False: 707]
  ------------------
  390|  17.3k|    count += size;
  391|  17.3k|    if (count > ints.size())
  ------------------
  |  Branch (391:9): [True: 663, False: 16.7k]
  ------------------
  392|    663|      return;
  393|  17.3k|  }
  394|       |
  395|  10.5k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (395:41): [True: 10.5k, False: 707]
  ------------------
  396|  10.5k|    auto pTags = ExifTags::tagList("Canon");
  397|  10.5k|    if (auto pTag = findTag(pTags, tag)) {
  ------------------
  |  Branch (397:14): [True: 10.5k, False: 0]
  ------------------
  398|  10.5k|      auto v = Exiv2::Value::create(bSigned ? Exiv2::signedShort : Exiv2::unsignedShort);
  ------------------
  |  Branch (398:37): [True: 8.48k, False: 2.11k]
  ------------------
  399|  10.5k|      std::string s;
  400|  10.5k|      if (bSigned) {
  ------------------
  |  Branch (400:11): [True: 8.48k, False: 2.11k]
  ------------------
  401|   173k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (401:30): [True: 164k, False: 8.48k]
  ------------------
  402|   164k|          s += stringFormat(" {}", ints.at(nStart++));
  ------------------
  |  |   18|   164k|#define stringFormat std::format
  ------------------
  403|  8.48k|      } else {
  404|  3.77k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (404:30): [True: 1.65k, False: 2.11k]
  ------------------
  405|  1.65k|          s += stringFormat(" {}", uint.at(nStart++));
  ------------------
  |  |   18|  1.65k|#define stringFormat std::format
  ------------------
  406|  2.11k|      }
  407|       |
  408|  10.5k|      v->read(s);
  409|  10.5k|      exifData_[familyGroup + pTag->name_] = *v;
  410|  10.5k|    }
  411|  10.5k|  }
  412|    707|}
_ZN5Exiv28Internal11TiffDecoder15decodeTiffEntryEPKNS0_13TiffEntryBaseE:
  414|  1.79M|void TiffDecoder::decodeTiffEntry(const TiffEntryBase* object) {
  415|       |  // Don't decode the entry if value is not set
  416|  1.79M|  if (!object->pValue())
  ------------------
  |  Branch (416:7): [True: 372k, False: 1.42M]
  ------------------
  417|   372k|    return;
  418|       |
  419|       |  // skip decoding if decoderFct == 0
  420|  1.42M|  if (auto decoderFct = findDecoderFct_(make_, object->tag(), object->group()))
  ------------------
  |  Branch (420:12): [True: 1.42M, False: 0]
  ------------------
  421|  1.42M|    std::invoke(decoderFct, *this, object);
  422|  1.42M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder18decodeStdTiffEntryEPKNS0_13TiffEntryBaseE:
  424|  1.42M|void TiffDecoder::decodeStdTiffEntry(const TiffEntryBase* object) {
  425|  1.42M|  ExifKey key(object->tag(), groupName(object->group()));
  426|  1.42M|  key.setIdx(object->idx());
  427|  1.42M|  exifData_.add(key, object->pValue());
  428|       |
  429|  1.42M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  431|  6.11k|void TiffDecoder::visitBinaryArray(TiffBinaryArray* object) {
  432|  6.11k|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (432:7): [True: 980, False: 5.13k]
  |  Branch (432:25): [True: 4.08k, False: 1.05k]
  ------------------
  433|  5.06k|    decodeTiffEntry(object);
  434|  5.06k|  }
  435|  6.11k|}
_ZN5Exiv28Internal11TiffDecoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  437|   891k|void TiffDecoder::visitBinaryElement(TiffBinaryElement* object) {
  438|   891k|  decodeTiffEntry(object);
  439|   891k|}
_ZN5Exiv28Internal11TiffEncoderC2ENS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEPNS0_13TiffComponentEbNSt3__16vectorINS_5IfdIdENSB_9allocatorISD_EEEEPKNS0_14TiffHeaderBaseEPFMS1_FvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSB_17basic_string_viewIcNSB_11char_traitsIcEEEEjSD_E:
  444|  4.73k|    exifData_(std::move(exifData)),
  445|  4.73k|    iptcData_(iptcData),
  446|  4.73k|    xmpData_(xmpData),
  447|  4.73k|    pHeader_(pHeader),
  448|  4.73k|    pRoot_(pRoot),
  449|  4.73k|    isNewImage_(isNewImage),
  450|  4.73k|    pPrimaryGroups_(std::move(pPrimaryGroups)),
  451|  4.73k|    byteOrder_(pHeader->byteOrder()),
  452|  4.73k|    origByteOrder_(byteOrder_),
  453|  4.73k|    findEncoderFct_(findEncoderFct) {
  454|  4.73k|  encodeIptc();
  455|  4.73k|  encodeXmp();
  456|       |
  457|       |  // Find camera make
  458|  4.73k|  ExifKey key("Exif.Image.Make");
  459|  4.73k|  if (auto pos = exifData_.findKey(key); pos != exifData_.end()) {
  ------------------
  |  Branch (459:42): [True: 0, False: 4.73k]
  ------------------
  460|      0|    make_ = pos->toString();
  461|      0|  }
  462|  4.73k|  if (make_.empty() && pRoot_) {
  ------------------
  |  Branch (462:7): [True: 4.73k, False: 0]
  |  Branch (462:24): [True: 4.73k, False: 0]
  ------------------
  463|  4.73k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  464|  4.73k|    pRoot_->accept(finder);
  465|  4.73k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  466|  4.73k|    if (te && te->pValue()) {
  ------------------
  |  Branch (466:9): [True: 0, False: 4.73k]
  |  Branch (466:15): [True: 0, False: 0]
  ------------------
  467|      0|      make_ = te->pValue()->toString();
  468|      0|    }
  469|  4.73k|  }
  470|  4.73k|}
_ZN5Exiv28Internal11TiffEncoder10encodeIptcEv:
  472|  4.73k|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.73k|  bool del = false;
  478|  4.73k|  ExifKey iptcNaaKey("Exif.Image.IPTCNAA");
  479|  4.73k|  auto pos = exifData_.findKey(iptcNaaKey);
  480|  4.73k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (480:7): [True: 0, False: 4.73k]
  ------------------
  481|      0|    iptcNaaKey.setIdx(pos->idx());
  482|      0|    exifData_.erase(pos);
  483|      0|    del = true;
  484|      0|  }
  485|  4.73k|  DataBuf rawIptc = IptcParser::encode(iptcData_);
  486|  4.73k|  ExifKey irbKey("Exif.Image.ImageResources");
  487|  4.73k|  pos = exifData_.findKey(irbKey);
  488|  4.73k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (488:7): [True: 0, False: 4.73k]
  ------------------
  489|      0|    irbKey.setIdx(pos->idx());
  490|      0|  }
  491|  4.73k|  if (!rawIptc.empty() && (del || pos == exifData_.end())) {
  ------------------
  |  Branch (491:7): [True: 0, False: 4.73k]
  |  Branch (491:7): [True: 0, False: 4.73k]
  |  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.73k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (508:7): [True: 0, False: 4.73k]
  ------------------
  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.73k|}  // TiffEncoder::encodeIptc
_ZN5Exiv28Internal11TiffEncoder9encodeXmpEv:
  522|  4.73k|void TiffEncoder::encodeXmp() {
  523|  4.73k|#ifdef EXV_HAVE_XMP_TOOLKIT
  524|  4.73k|  ExifKey xmpKey("Exif.Image.XMLPacket");
  525|       |  // Remove any existing XMP Exif tag
  526|  4.73k|  if (auto pos = exifData_.findKey(xmpKey); pos != exifData_.end()) {
  ------------------
  |  Branch (526:45): [True: 0, False: 4.73k]
  ------------------
  527|      0|    xmpKey.setIdx(pos->idx());
  528|      0|    exifData_.erase(pos);
  529|      0|  }
  530|  4.73k|  std::string xmpPacket;
  531|  4.73k|  if (xmpData_.usePacket()) {
  ------------------
  |  Branch (531:7): [True: 0, False: 4.73k]
  ------------------
  532|      0|    xmpPacket = xmpData_.xmpPacket();
  533|  4.73k|  } else {
  534|  4.73k|    if (XmpParser::encode(xmpPacket, xmpData_) > 1) {
  ------------------
  |  Branch (534:9): [True: 0, False: 4.73k]
  ------------------
  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.73k|  }
  540|  4.73k|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (540:7): [True: 0, False: 4.73k]
  ------------------
  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.73k|#endif
  548|  4.73k|}  // TiffEncoder::encodeXmp
_ZN5Exiv28Internal11TiffEncoder8setDirtyEb:
  550|  37.0k|void TiffEncoder::setDirty(bool flag) {
  551|  37.0k|  dirty_ = flag;
  552|  37.0k|  setGo(geTraverse, !flag);
  553|  37.0k|}
_ZNK5Exiv28Internal11TiffEncoder10isImageTagEtNS_5IfdIdE:
  697|   301k|bool TiffEncoder::isImageTag(uint16_t tag, IfdId group) const {
  698|   301k|  return !isNewImage_ && pHeader_->isImageTag(tag, group, pPrimaryGroups_);
  ------------------
  |  Branch (698:10): [True: 0, False: 301k]
  |  Branch (698:26): [True: 0, False: 0]
  ------------------
  699|   301k|}
_ZN5Exiv28Internal11TiffEncoder19encodeTiffComponentEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  701|   150k|void TiffEncoder::encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum) {
  702|   150k|  auto pos = exifData_.end();
  703|   150k|  const Exifdatum* ed = datum;
  704|   150k|  if (!ed) {
  ------------------
  |  Branch (704:7): [True: 0, False: 150k]
  ------------------
  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|   150k|  } else {
  725|       |    // For intrusive writing, the index is used to preserve the order of
  726|       |    // duplicate tags
  727|   150k|    object->idx_ = ed->idx();
  728|   150k|  }
  729|       |  // Skip encoding image tags of existing TIFF image - they were copied earlier -
  730|       |  // but encode image tags of new images (creation)
  731|   150k|  if (ed && !isImageTag(object->tag(), object->group())) {
  ------------------
  |  Branch (731:7): [True: 150k, False: 0]
  |  Branch (731:13): [True: 150k, False: 0]
  ------------------
  732|   150k|    if (auto fct = findEncoderFct_(make_, object->tag(), object->group())) {
  ------------------
  |  Branch (732:14): [True: 0, False: 150k]
  ------------------
  733|       |      // If an encoding function is registered for the tag, use it
  734|      0|      std::invoke(fct, *this, object, ed);
  735|   150k|    } 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|   150k|      object->encode(*this, ed);
  739|   150k|    }
  740|   150k|  }
  741|   150k|  if (del_ && pos != exifData_.end()) {
  ------------------
  |  Branch (741:7): [True: 0, False: 150k]
  |  Branch (741:7): [True: 0, False: 150k]
  |  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|   150k|}  // TiffEncoder::encodeTiffComponent
_ZN5Exiv28Internal11TiffEncoder15encodeTiffEntryEPNS0_9TiffEntryEPKNS_9ExifdatumE:
  785|   110k|void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) {
  786|   110k|  encodeTiffEntryBase(object, datum);
  787|   110k|}  // TiffEncoder::encodeTiffEntry
_ZN5Exiv28Internal11TiffEncoder16encodeImageEntryEPNS0_14TiffImageEntryEPKNS_9ExifdatumE:
  789|  19.4k|void TiffEncoder::encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum) {
  790|  19.4k|  encodeOffsetEntry(object, datum);
  791|       |
  792|  19.4k|  size_t sizeDataArea = object->pValue()->sizeDataArea();
  793|       |
  794|  19.4k|  if (sizeDataArea > 0 && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (794:7): [True: 2.10k, False: 17.3k]
  |  Branch (794:27): [True: 0, False: 2.10k]
  ------------------
  795|       |#ifdef EXIV2_DEBUG_MESSAGES
  796|       |    std::cerr << "\t DATAAREA IS SET (NON-INTRUSIVE WRITING)";
  797|       |#endif
  798|      0|    setDirty();
  799|      0|  }
  800|       |
  801|  19.4k|  if (sizeDataArea > 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (801:7): [True: 2.10k, False: 17.3k]
  |  Branch (801:27): [True: 2.10k, 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.10k|    ExifKey key(object->szTag(), groupName(object->szGroup()));
  807|  2.10k|    auto pos = exifData_.findKey(key);
  808|  2.10k|    const byte* zero = nullptr;
  809|  2.10k|    if (pos == exifData_.end()) {
  ------------------
  |  Branch (809:9): [True: 0, False: 2.10k]
  ------------------
  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.10k|    } else {
  816|  2.10k|      size_t sizeTotal = 0;
  817|  2.10k|      object->strips_.clear();
  818|  72.6k|      for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (818:26): [True: 70.5k, False: 2.10k]
  ------------------
  819|  70.5k|        uint32_t len = pos->toUint32(i);
  820|  70.5k|        object->strips_.emplace_back(zero, len);
  821|  70.5k|        sizeTotal += len;
  822|  70.5k|      }
  823|  2.10k|      if (sizeTotal != sizeDataArea) {
  ------------------
  |  Branch (823:11): [True: 123, False: 1.98k]
  ------------------
  824|    123|#ifndef SUPPRESS_WARNINGS
  825|    123|        ExifKey key2(object->tag(), groupName(object->group()));
  826|    123|        EXV_ERROR << "Sum of all sizes of " << key << " != data size of " << key2 << ". "
  ------------------
  |  |  142|    123|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 123]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    123|  LogMsg(LogMsg::error).os()
  ------------------
  827|      0|                  << "This results in an invalid image.\n";
  828|    123|#endif
  829|       |        // Todo: How to fix? Write only one strip?
  830|    123|      }
  831|  2.10k|    }
  832|  2.10k|  }
  833|       |
  834|  19.4k|  if (sizeDataArea == 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (834:7): [True: 17.3k, False: 2.10k]
  |  Branch (834:28): [True: 17.3k, 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|  17.3k|    if (pSourceTree_) {
  ------------------
  |  Branch (839:9): [True: 0, False: 17.3k]
  ------------------
  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|  17.3k|#ifndef SUPPRESS_WARNINGS
  847|  17.3k|    else {
  848|  17.3k|      ExifKey key2(object->tag(), groupName(object->group()));
  849|  17.3k|      EXV_WARNING << "No image data to encode " << key2 << ".\n";
  ------------------
  |  |  138|  17.3k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 17.3k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  17.3k|  LogMsg(LogMsg::warn).os()
  ------------------
  850|  17.3k|    }
  851|  17.3k|#endif
  852|  17.3k|  }
  853|       |
  854|  19.4k|}  // TiffEncoder::encodeImageEntry
_ZN5Exiv28Internal11TiffEncoder15encodeSizeEntryEPNS0_13TiffSizeEntryEPKNS_9ExifdatumE:
  862|  21.2k|void TiffEncoder::encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum) {
  863|  21.2k|  encodeTiffEntryBase(object, datum);
  864|  21.2k|}  // TiffEncoder::encodeSizeEntry
_ZN5Exiv28Internal11TiffEncoder19encodeTiffEntryBaseEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  870|   131k|void TiffEncoder::encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum) {
  871|       |#ifdef EXIV2_DEBUG_MESSAGES
  872|       |  bool tooLarge = false;
  873|       |#endif
  874|   131k|  if (datum->size() > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (874:7): [True: 27.0k, False: 104k]
  ------------------
  875|  27.0k|    setDirty();
  876|       |#ifdef EXIV2_DEBUG_MESSAGES
  877|       |    tooLarge = true;
  878|       |#endif
  879|  27.0k|  }
  880|   131k|  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|   131k|}
_ZN5Exiv28Internal11TiffEncoder17encodeOffsetEntryEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  890|  19.4k|void TiffEncoder::encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum) {
  891|  19.4k|  size_t newSize = datum->size();
  892|  19.4k|  if (newSize > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (892:7): [True: 10.0k, False: 9.35k]
  ------------------
  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|  9.35k|    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|  9.35k|  }
  908|  19.4k|}
_ZN5Exiv28Internal11TiffEncoder3addEPNS0_13TiffComponentENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEEj:
  910|  4.73k|void TiffEncoder::add(TiffComponent* pRootDir, TiffComponent::UniquePtr pSourceDir, uint32_t root) {
  911|  4.73k|  writeMethod_ = wmIntrusive;
  912|  4.73k|  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.73k|  del_ = false;
  917|       |
  918|  4.73k|  auto posBo = exifData_.end();
  919|   155k|  for (auto i = exifData_.begin(); i != exifData_.end(); ++i) {
  ------------------
  |  Branch (919:36): [True: 150k, False: 4.73k]
  ------------------
  920|   150k|    IfdId group = groupId(i->groupName());
  921|       |    // Skip synthesized info tags
  922|   150k|    if (group == IfdId::mnId) {
  ------------------
  |  Branch (922:9): [True: 0, False: 150k]
  ------------------
  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|   150k|    if (isImageTag(i->tag(), group))
  ------------------
  |  Branch (931:9): [True: 0, False: 150k]
  ------------------
  932|      0|      continue;
  933|       |
  934|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  935|   150k|    auto tiffPath = TiffCreator::getPath(i->tag(), group, root);
  936|   150k|    TiffComponent* tc = pRootDir->addPath(i->tag(), tiffPath, pRootDir);
  937|   150k|    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|   150k|    if (object) {
  ------------------
  |  Branch (944:9): [True: 150k, False: 0]
  ------------------
  945|   150k|      encodeTiffComponent(object, &(*i));
  946|   150k|    }
  947|   150k|  }
  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.73k|  if (posBo == exifData_.end())
  ------------------
  |  Branch (956:7): [True: 4.73k, False: 0]
  ------------------
  957|  4.73k|    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.0k|    pData_(pData), size_(size), pLast_(pData + size), pRoot_(pRoot), origState_(state), mnState_(state) {
  974|  12.0k|  pState_ = &origState_;
  975|       |
  976|  12.0k|}  // TiffReader::TiffReader
_ZN5Exiv28Internal10TiffReader12setOrigStateEv:
  978|  14.7k|void TiffReader::setOrigState() {
  979|  14.7k|  pState_ = &origState_;
  980|  14.7k|}
_ZN5Exiv28Internal10TiffReader10setMnStateEPKNS0_11TiffRwStateE:
  982|  14.7k|void TiffReader::setMnState(const TiffRwState* state) {
  983|  14.7k|  if (state) {
  ------------------
  |  Branch (983:7): [True: 2.71k, False: 12.0k]
  ------------------
  984|       |    // invalidByteOrder indicates 'no change'
  985|  2.71k|    if (state->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (985:9): [True: 0, False: 2.71k]
  ------------------
  986|      0|      mnState_ = TiffRwState{origState_.byteOrder(), state->baseOffset()};
  987|  2.71k|    } else {
  988|  2.71k|      mnState_ = *state;
  989|  2.71k|    }
  990|  2.71k|  }
  991|  14.7k|  pState_ = &mnState_;
  992|  14.7k|}
_ZNK5Exiv28Internal10TiffReader9byteOrderEv:
  994|  4.74M|ByteOrder TiffReader::byteOrder() const {
  995|  4.74M|  return pState_->byteOrder();
  996|  4.74M|}
_ZNK5Exiv28Internal10TiffReader10baseOffsetEv:
  998|   710k|size_t TiffReader::baseOffset() const {
  999|   710k|  return pState_->baseOffset();
 1000|   710k|}
_ZN5Exiv28Internal10TiffReader17readDataEntryBaseEPNS0_17TiffDataEntryBaseE:
 1002|  47.3k|void TiffReader::readDataEntryBase(TiffDataEntryBase* object) {
 1003|  47.3k|  readTiffEntry(object);
 1004|  47.3k|  TiffFinder finder(object->szTag(), object->szGroup());
 1005|  47.3k|  pRoot_->accept(finder);
 1006|  47.3k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1007|  47.3k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1007:7): [True: 33.9k, False: 13.4k]
  |  Branch (1007:13): [True: 23.6k, False: 10.2k]
  ------------------
 1008|  23.6k|    object->setStrips(te->pValue(), pData_, size_, baseOffset());
 1009|  23.6k|  }
 1010|  47.3k|}
_ZN5Exiv28Internal10TiffReader10visitEntryEPNS0_9TiffEntryE:
 1012|   777k|void TiffReader::visitEntry(TiffEntry* object) {
 1013|   777k|  readTiffEntry(object);
 1014|   777k|}
_ZN5Exiv28Internal10TiffReader14visitDataEntryEPNS0_13TiffDataEntryE:
 1016|  5.43k|void TiffReader::visitDataEntry(TiffDataEntry* object) {
 1017|  5.43k|  readDataEntryBase(object);
 1018|  5.43k|}
_ZN5Exiv28Internal10TiffReader15visitImageEntryEPNS0_14TiffImageEntryE:
 1020|  41.9k|void TiffReader::visitImageEntry(TiffImageEntry* object) {
 1021|  41.9k|  readDataEntryBase(object);
 1022|  41.9k|}
_ZN5Exiv28Internal10TiffReader14visitSizeEntryEPNS0_13TiffSizeEntryE:
 1024|  56.6k|void TiffReader::visitSizeEntry(TiffSizeEntry* object) {
 1025|  56.6k|  readTiffEntry(object);
 1026|  56.6k|  TiffFinder finder(object->dtTag(), object->dtGroup());
 1027|  56.6k|  pRoot_->accept(finder);
 1028|  56.6k|  auto te = dynamic_cast<TiffDataEntryBase*>(finder.result());
 1029|  56.6k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1029:7): [True: 36.8k, False: 19.8k]
  |  Branch (1029:13): [True: 20.4k, False: 16.3k]
  ------------------
 1030|  20.4k|    te->setStrips(object->pValue(), pData_, size_, baseOffset());
 1031|  20.4k|  }
 1032|  56.6k|}
_ZN5Exiv28Internal10TiffReader17circularReferenceEPKhNS_5IfdIdE:
 1034|  41.8k|bool TiffReader::circularReference(const byte* start, IfdId group) {
 1035|  41.8k|  if (auto pos = dirList_.find(start); pos != dirList_.end()) {
  ------------------
  |  Branch (1035:40): [True: 3.96k, False: 37.8k]
  ------------------
 1036|  3.96k|#ifndef SUPPRESS_WARNINGS
 1037|  3.96k|    EXV_ERROR << groupName(group) << " pointer references previously read " << groupName(pos->second)
  ------------------
  |  |  142|  3.96k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.96k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.96k|  LogMsg(LogMsg::error).os()
  ------------------
 1038|      0|              << " directory; ignored.\n";
 1039|  3.96k|#endif
 1040|  3.96k|    return true;
 1041|  3.96k|  }
 1042|  37.8k|  dirList_[start] = group;
 1043|  37.8k|  return false;
 1044|  41.8k|}
_ZN5Exiv28Internal10TiffReader7nextIdxENS_5IfdIdE:
 1046|  1.42M|int TiffReader::nextIdx(IfdId group) {
 1047|  1.42M|  return ++idxSeq_[group];
 1048|  1.42M|}
_ZN5Exiv28Internal10TiffReader11postProcessEv:
 1050|  12.0k|void TiffReader::postProcess() {
 1051|  12.0k|  setMnState();  // All components to be post-processed must be from the Makernote
 1052|  12.0k|  postProc_ = true;
 1053|  12.0k|  for (auto pos : postList_) {
  ------------------
  |  Branch (1053:17): [True: 6.11k, False: 12.0k]
  ------------------
 1054|  6.11k|    pos->accept(*this);
 1055|  6.11k|  }
 1056|  12.0k|  postProc_ = false;
 1057|  12.0k|  setOrigState();
 1058|  12.0k|}
_ZN5Exiv28Internal10TiffReader14visitDirectoryEPNS0_13TiffDirectoryE:
 1060|  41.8k|void TiffReader::visitDirectory(TiffDirectory* object) {
 1061|  41.8k|  const byte* p = object->start();
 1062|       |
 1063|  41.8k|  if (circularReference(object->start(), object->group()))
  ------------------
  |  Branch (1063:7): [True: 3.96k, False: 37.8k]
  ------------------
 1064|  3.96k|    return;
 1065|       |
 1066|  37.8k|  if (p + 2 > pLast_) {
  ------------------
  |  Branch (1066:7): [True: 78, False: 37.8k]
  ------------------
 1067|     78|#ifndef SUPPRESS_WARNINGS
 1068|     78|    EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD exceeds data buffer, cannot read entry count.\n";
  ------------------
  |  |  142|     78|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 78]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     78|  LogMsg(LogMsg::error).os()
  ------------------
 1069|     78|#endif
 1070|     78|    return;
 1071|     78|  }
 1072|  37.8k|  const uint16_t n = getUShort(p, byteOrder());
 1073|  37.8k|  p += 2;
 1074|       |  // Sanity check with an "unreasonably" large number
 1075|  37.8k|  if (n > 256) {
  ------------------
  |  Branch (1075:7): [True: 3.70k, False: 34.1k]
  ------------------
 1076|  3.70k|#ifndef SUPPRESS_WARNINGS
 1077|  3.70k|    EXV_ERROR << "Directory " << groupName(object->group()) << " with " << n
  ------------------
  |  |  142|  3.70k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.70k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.70k|  LogMsg(LogMsg::error).os()
  ------------------
 1078|      0|              << " entries considered invalid; not read.\n";
 1079|  3.70k|#endif
 1080|  3.70k|    return;
 1081|  3.70k|  }
 1082|   948k|  for (uint16_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (1082:24): [True: 932k, False: 16.1k]
  ------------------
 1083|   932k|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1083:9): [True: 17.9k, False: 914k]
  ------------------
 1084|  17.9k|#ifndef SUPPRESS_WARNINGS
 1085|  17.9k|      EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD entry " << i
  ------------------
  |  |  142|  17.9k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 17.9k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  17.9k|  LogMsg(LogMsg::error).os()
  ------------------
 1086|      0|                << " lies outside of the data buffer.\n";
 1087|  17.9k|#endif
 1088|  17.9k|      return;
 1089|  17.9k|    }
 1090|   914k|    uint16_t tag = getUShort(p, byteOrder());
 1091|   914k|    if (auto tc = TiffCreator::create(tag, object->group())) {
  ------------------
  |  Branch (1091:14): [True: 914k, False: 254]
  ------------------
 1092|   914k|      tc->setStart(p);
 1093|   914k|      object->addChild(std::move(tc));
 1094|   914k|    } else {
 1095|    254|#ifndef SUPPRESS_WARNINGS
 1096|    254|      EXV_WARNING << "Unable to handle tag " << tag << ".\n";
  ------------------
  |  |  138|    254|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 254]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    254|  LogMsg(LogMsg::warn).os()
  ------------------
 1097|    254|#endif
 1098|    254|    }
 1099|   914k|    p += 12;
 1100|   914k|  }
 1101|       |
 1102|  16.1k|  if (object->hasNext()) {
  ------------------
  |  Branch (1102:7): [True: 16.1k, False: 12]
  ------------------
 1103|  16.1k|    if (p + 4 > pLast_) {
  ------------------
  |  Branch (1103:9): [True: 111, False: 16.0k]
  ------------------
 1104|    111|#ifndef SUPPRESS_WARNINGS
 1105|    111|      EXV_ERROR << "Directory " << groupName(object->group())
  ------------------
  |  |  142|    111|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 111]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    111|  LogMsg(LogMsg::error).os()
  ------------------
 1106|      0|                << ": IFD exceeds data buffer, cannot read next pointer.\n";
 1107|    111|#endif
 1108|    111|      return;
 1109|    111|    }
 1110|  16.0k|    TiffComponent::UniquePtr tc;
 1111|  16.0k|    uint32_t next = getULong(p, byteOrder());
 1112|  16.0k|    if (next) {
  ------------------
  |  Branch (1112:9): [True: 15.2k, False: 804]
  ------------------
 1113|  15.2k|      tc = TiffCreator::create(Tag::next, object->group());
 1114|  15.2k|#ifndef SUPPRESS_WARNINGS
 1115|  15.2k|      if (!tc) {
  ------------------
  |  Branch (1115:11): [True: 8.87k, False: 6.38k]
  ------------------
 1116|  8.87k|        EXV_WARNING << "Directory " << groupName(object->group()) << " has an unexpected next pointer; ignored.\n";
  ------------------
  |  |  138|  8.87k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.87k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.87k|  LogMsg(LogMsg::warn).os()
  ------------------
 1117|  8.87k|      }
 1118|  15.2k|#endif
 1119|  15.2k|    }
 1120|  16.0k|    if (tc) {
  ------------------
  |  Branch (1120:9): [True: 6.38k, False: 9.68k]
  ------------------
 1121|  6.38k|      if (baseOffset() + next > size_) {
  ------------------
  |  Branch (1121:11): [True: 4.14k, False: 2.24k]
  ------------------
 1122|  4.14k|#ifndef SUPPRESS_WARNINGS
 1123|  4.14k|        EXV_ERROR << "Directory " << groupName(object->group()) << ": Next pointer is out of bounds; ignored.\n";
  ------------------
  |  |  142|  4.14k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.14k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.14k|  LogMsg(LogMsg::error).os()
  ------------------
 1124|  4.14k|#endif
 1125|  4.14k|        return;
 1126|  4.14k|      }
 1127|  2.24k|      tc->setStart(pData_ + baseOffset() + next);
 1128|  2.24k|      object->addNext(std::move(tc));
 1129|  2.24k|    }
 1130|  16.0k|  }  // object->hasNext()
 1131|       |
 1132|  16.1k|}  // TiffReader::visitDirectory
_ZN5Exiv28Internal10TiffReader11visitSubIfdEPNS0_10TiffSubIfdE:
 1134|  9.68k|void TiffReader::visitSubIfd(TiffSubIfd* object) {
 1135|  9.68k|  readTiffEntry(object);
 1136|  9.68k|  if ((object->tiffType() == ttUnsignedLong || object->tiffType() == ttSignedLong || object->tiffType() == ttTiffIfd) &&
  ------------------
  |  Branch (1136:8): [True: 7.60k, False: 2.07k]
  |  Branch (1136:48): [True: 326, False: 1.74k]
  |  Branch (1136:86): [True: 648, False: 1.09k]
  ------------------
 1137|  8.58k|      object->count() >= 1) {
  ------------------
  |  Branch (1137:7): [True: 6.52k, False: 2.06k]
  ------------------
 1138|       |    // Todo: Fix hack
 1139|  6.52k|    uint32_t maxi = 9;
 1140|  6.52k|    if (object->group() == IfdId::ifd1Id)
  ------------------
  |  Branch (1140:9): [True: 174, False: 6.34k]
  ------------------
 1141|    174|      maxi = 1;
 1142|  31.4k|    for (uint32_t i = 0; i < object->count(); ++i) {
  ------------------
  |  Branch (1142:26): [True: 30.7k, False: 685]
  ------------------
 1143|  30.7k|      uint32_t offset = getULong(object->pData() + (4 * i), byteOrder());
 1144|  30.7k|      if (baseOffset() + offset > size_) {
  ------------------
  |  Branch (1144:11): [True: 5.58k, False: 25.1k]
  ------------------
 1145|  5.58k|#ifndef SUPPRESS_WARNINGS
 1146|  5.58k|        EXV_ERROR << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  142|  5.58k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 5.58k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  5.58k|  LogMsg(LogMsg::error).os()
  ------------------
 1147|      0|                  << std::hex << object->tag() << " Sub-IFD pointer " << i << " is out of bounds; ignoring it.\n";
 1148|  5.58k|#endif
 1149|  5.58k|        return;
 1150|  5.58k|      }
 1151|  25.1k|      if (i >= maxi) {
  ------------------
  |  Branch (1151:11): [True: 257, False: 24.9k]
  ------------------
 1152|    257|#ifndef SUPPRESS_WARNINGS
 1153|    257|        EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|    257|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 257]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    257|  LogMsg(LogMsg::warn).os()
  ------------------
 1154|      0|                    << std::hex << object->tag() << ": Skipping sub-IFDs beyond the first " << i << ".\n";
 1155|    257|#endif
 1156|    257|        break;
 1157|    257|      }
 1158|       |      // If there are multiple dirs, group is incremented for each
 1159|  24.9k|      auto td = std::make_unique<TiffDirectory>(object->tag(),
 1160|  24.9k|                                                static_cast<IfdId>(static_cast<uint32_t>(object->newGroup_) + i));
 1161|  24.9k|      td->setStart(pData_ + baseOffset() + offset);
 1162|  24.9k|      object->addChild(std::move(td));
 1163|  24.9k|    }
 1164|  6.52k|  }
 1165|  3.15k|#ifndef SUPPRESS_WARNINGS
 1166|  3.15k|  else {
 1167|  3.15k|    EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|  3.15k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.15k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.15k|  LogMsg(LogMsg::warn).os()
  ------------------
 1168|      0|                << std::hex << object->tag() << " doesn't look like a sub-IFD.\n";
 1169|  3.15k|  }
 1170|  9.68k|#endif
 1171|       |
 1172|  9.68k|}  // 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: 264]
  |  Branch (1180:13): [True: 12.0k, False: 317]
  ------------------
 1181|  12.0k|    auto make = te->pValue()->toString();
 1182|       |    // create concrete makernote, based on make and makernote contents
 1183|  12.0k|    object->mn_ =
 1184|  12.0k|        TiffMnCreator::create(object->tag(), object->mnGroup_, make, object->pData_, object->size_, byteOrder());
 1185|  12.0k|  }
 1186|  12.6k|  if (object->mn_)
  ------------------
  |  Branch (1186:7): [True: 3.10k, False: 9.52k]
  ------------------
 1187|  3.10k|    object->mn_->setStart(object->pData());
 1188|       |
 1189|  12.6k|}  // TiffReader::visitMnEntry
_ZN5Exiv28Internal10TiffReader17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
 1191|  3.10k|void TiffReader::visitIfdMakernote(TiffIfdMakernote* object) {
 1192|  3.10k|  object->setImageByteOrder(byteOrder());  // set the byte order for the image
 1193|       |
 1194|  3.10k|  if (!object->readHeader(object->start(), pLast_ - object->start(), byteOrder())) {
  ------------------
  |  Branch (1194:7): [True: 384, False: 2.71k]
  ------------------
 1195|    384|#ifndef SUPPRESS_WARNINGS
 1196|    384|    EXV_ERROR << "Failed to read " << groupName(object->ifd_.group()) << " IFD Makernote header.\n";
  ------------------
  |  |  142|    384|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 384]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    384|  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|    384|#endif  // SUPPRESS_WARNINGS
 1203|    384|    setGo(geKnownMakernote, false);
 1204|    384|    return;
 1205|    384|  }
 1206|       |
 1207|  2.71k|  object->ifd_.setStart(object->start() + object->ifdOffset());
 1208|       |
 1209|       |  // Modify reader for Makernote peculiarities, byte order and offset
 1210|  2.71k|  object->mnOffset_ = object->start() - pData_;
 1211|  2.71k|  auto state = TiffRwState{object->byteOrder(), object->baseOffset()};
 1212|  2.71k|  setMnState(&state);
 1213|       |
 1214|  2.71k|}  // TiffReader::visitIfdMakernote
_ZN5Exiv28Internal10TiffReader20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
 1216|  2.67k|void TiffReader::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
 1217|       |  // Reset state (byte order, create function, offset) back to that for the image
 1218|  2.67k|  setOrigState();
 1219|  2.67k|}  // TiffReader::visitIfdMakernoteEnd
_ZN5Exiv28Internal10TiffReader13readTiffEntryEPNS0_13TiffEntryBaseE:
 1221|   910k|void TiffReader::readTiffEntry(TiffEntryBase* object) {
 1222|   910k|  try {
 1223|   910k|    byte* p = object->start();
 1224|       |
 1225|   910k|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1225:9): [True: 3, False: 910k]
  ------------------
 1226|      3|#ifndef SUPPRESS_WARNINGS
 1227|      3|      EXV_ERROR << "Entry in directory " << groupName(object->group())
  ------------------
  |  |  142|      3|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      3|  LogMsg(LogMsg::error).os()
  ------------------
 1228|      0|                << "requests access to memory beyond the data buffer. " << "Skipping entry.\n";
 1229|      3|#endif
 1230|      3|      return;
 1231|      3|    }
 1232|       |    // Component already has tag
 1233|   910k|    p += 2;
 1234|   910k|    auto tiffType = static_cast<TiffType>(getUShort(p, byteOrder()));
 1235|   910k|    TypeId typeId = toTypeId(tiffType, object->tag(), object->group());
 1236|   910k|    size_t typeSize = TypeInfo::typeSize(typeId);
 1237|   910k|    if (0 == typeSize) {
  ------------------
  |  Branch (1237:9): [True: 806k, False: 103k]
  ------------------
 1238|   806k|#ifndef SUPPRESS_WARNINGS
 1239|   806k|      EXV_WARNING << stringFormat(
  ------------------
  |  |  138|   806k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 806k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|   806k|  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|   806k|#endif
 1243|   806k|      typeSize = 1;
 1244|   806k|    }
 1245|   910k|    p += 2;
 1246|   910k|    uint32_t count = getULong(p, byteOrder());
 1247|   910k|    if (count >= 0x10000000) {
  ------------------
  |  Branch (1247:9): [True: 373k, False: 536k]
  ------------------
 1248|   373k|#ifndef SUPPRESS_WARNINGS
 1249|   373k|      EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |  142|   373k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 373k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   373k|  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|   373k|#endif
 1252|   373k|      return;
 1253|   373k|    }
 1254|   536k|    p += 4;
 1255|       |
 1256|   536k|    if (count > std::numeric_limits<size_t>::max() / typeSize) {
  ------------------
  |  Branch (1256:9): [True: 0, False: 536k]
  ------------------
 1257|      0|      throw Error(ErrorCode::kerArithmeticOverflow);
 1258|      0|    }
 1259|   536k|    size_t size = typeSize * count;
 1260|   536k|    size_t offset = getULong(p, byteOrder());
 1261|   536k|    byte* pData = p;
 1262|   536k|    if (size > 4 && Safe::add<size_t>(baseOffset(), offset) >= size_) {
  ------------------
  |  Branch (1262:9): [True: 409k, False: 126k]
  |  Branch (1262:21): [True: 313k, False: 96.2k]
  ------------------
 1263|       |      // #1143
 1264|   313k|      if (object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1") {
  ------------------
  |  Branch (1264:11): [True: 580, False: 312k]
  |  Branch (1264:11): [True: 118, False: 313k]
  |  Branch (1264:38): [True: 118, False: 462]
  ------------------
 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|    118|        typeId = undefined;
 1277|    118|        size = 0;
 1278|   313k|      } else {
 1279|   313k|#ifndef SUPPRESS_WARNINGS
 1280|   313k|        EXV_ERROR << "Offset of directory " << groupName(object->group()) << ", entry 0x" << std::setw(4)
  ------------------
  |  |  142|   313k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 313k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   313k|  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|   313k|#endif
 1284|   313k|      }
 1285|   313k|      size = 0;
 1286|   313k|    }
 1287|   536k|    if (size > 4) {
  ------------------
  |  Branch (1287:9): [True: 96.2k, False: 440k]
  ------------------
 1288|       |      // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
 1289|       |      // as offset can be arbitrarily large
 1290|  96.2k|      if (Safe::add<size_t>(baseOffset(), offset) > static_cast<size_t>(pLast_ - pData_)) {
  ------------------
  |  Branch (1290:11): [True: 0, False: 96.2k]
  ------------------
 1291|      0|        throw Error(ErrorCode::kerCorruptedMetadata);
 1292|      0|      }
 1293|  96.2k|      pData = const_cast<byte*>(pData_) + baseOffset() + offset;
 1294|       |
 1295|       |      // check for size being invalid
 1296|  96.2k|      if (size > static_cast<size_t>(pLast_ - pData)) {
  ------------------
  |  Branch (1296:11): [True: 36.0k, False: 60.1k]
  ------------------
 1297|  36.0k|#ifndef SUPPRESS_WARNINGS
 1298|  36.0k|        EXV_ERROR << "Upper boundary of data for " << "directory " << groupName(object->group()) << ", entry 0x"
  ------------------
  |  |  142|  36.0k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 36.0k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  36.0k|  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|  36.0k|#endif
 1306|  36.0k|        size = 0;
 1307|  36.0k|      }
 1308|  96.2k|    }
 1309|   536k|    auto v = Value::create(typeId);
 1310|   536k|    enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1311|   536k|    v->read(pData, size, byteOrder());
 1312|       |
 1313|   536k|    object->setValue(std::move(v));
 1314|   536k|    auto d = std::make_shared<DataBuf>();
 1315|   536k|    object->setData(pData, size, std::move(d));
 1316|   536k|    object->setOffset(offset);
 1317|   536k|    object->setIdx(nextIdx(object->group()));
 1318|   536k|  } catch (std::overflow_error&) {
 1319|      0|    throw Error(ErrorCode::kerCorruptedMetadata);  // #562 don't throw std::overflow_error
 1320|      0|  }
 1321|   910k|}  // TiffReader::readTiffEntry
_ZN5Exiv28Internal10TiffReader16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
 1323|  12.2k|void TiffReader::visitBinaryArray(TiffBinaryArray* object) {
 1324|  12.2k|  if (!postProc_) {
  ------------------
  |  Branch (1324:7): [True: 6.11k, False: 6.11k]
  ------------------
 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.11k|    readTiffEntry(object);
 1328|  6.11k|    object->iniOrigDataBuf();
 1329|  6.11k|    postList_.push_back(object);
 1330|  6.11k|    return;
 1331|  6.11k|  }
 1332|       |  // Check duplicates
 1333|  6.11k|  TiffFinder finder(object->tag(), object->group());
 1334|  6.11k|  pRoot_->accept(finder);
 1335|  6.11k|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (1335:12): [True: 6.11k, False: 0]
  ------------------
 1336|  6.11k|    if (te->idx() != object->idx()) {
  ------------------
  |  Branch (1336:9): [True: 3.07k, False: 3.04k]
  ------------------
 1337|  3.07k|#ifndef SUPPRESS_WARNINGS
 1338|  3.07k|      EXV_WARNING << "Not decoding duplicate binary array tag 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  3.07k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.07k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.07k|  LogMsg(LogMsg::warn).os()
  ------------------
 1339|      0|                  << object->tag() << std::dec << ", group " << groupName(object->group()) << ", idx " << object->idx()
 1340|      0|                  << "\n";
 1341|  3.07k|#endif
 1342|  3.07k|      object->setDecoded(false);
 1343|  3.07k|      return;
 1344|  3.07k|    }
 1345|  6.11k|  }
 1346|       |
 1347|  3.04k|  if (object->TiffEntryBase::doSize() == 0)
  ------------------
  |  Branch (1347:7): [True: 1.65k, False: 1.39k]
  ------------------
 1348|  1.65k|    return;
 1349|  1.39k|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (1349:7): [True: 335, False: 1.05k]
  ------------------
 1350|    335|    return;
 1351|  1.05k|  const ArrayCfg* cfg = object->cfg();
 1352|  1.05k|  if (!cfg)
  ------------------
  |  Branch (1352:7): [True: 0, False: 1.05k]
  ------------------
 1353|      0|    return;
 1354|       |
 1355|  1.05k|  if (auto cryptFct = cfg->cryptFct_) {
  ------------------
  |  Branch (1355:12): [True: 306, False: 749]
  ------------------
 1356|    306|    const byte* pData = object->pData();
 1357|    306|    size_t size = object->TiffEntryBase::doSize();
 1358|    306|    auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
 1359|    306|    if (!buf->empty())
  ------------------
  |  Branch (1359:9): [True: 216, False: 90]
  ------------------
 1360|    216|      object->setData(std::move(buf));
 1361|    306|  }
 1362|       |
 1363|  1.05k|  const ArrayDef* defs = object->def();
 1364|  1.05k|  const ArrayDef* defsEnd = defs + object->defSize();
 1365|  1.05k|  const ArrayDef* def = &cfg->elDefaultDef_;
 1366|  1.05k|  ArrayDef gap = *def;
 1367|       |
 1368|   888k|  for (size_t idx = 0; idx < object->TiffEntryBase::doSize();) {
  ------------------
  |  Branch (1368:24): [True: 887k, False: 1.05k]
  ------------------
 1369|   887k|    if (defs) {
  ------------------
  |  Branch (1369:9): [True: 837k, False: 50.1k]
  ------------------
 1370|   837k|      def = std::find(defs, defsEnd, idx);
 1371|   837k|      if (def == defsEnd) {
  ------------------
  |  Branch (1371:11): [True: 835k, False: 1.92k]
  ------------------
 1372|   835k|        if (cfg->concat_) {
  ------------------
  |  Branch (1372:13): [True: 363, False: 834k]
  ------------------
 1373|       |          // Determine gap-size
 1374|    363|          const ArrayDef* xdef = defs;
 1375|  1.97k|          for (; xdef != defsEnd && xdef->idx_ <= idx; ++xdef) {
  ------------------
  |  Branch (1375:18): [True: 1.89k, False: 80]
  |  Branch (1375:37): [True: 1.61k, False: 283]
  ------------------
 1376|  1.61k|          }
 1377|    363|          size_t gapSize = 0;
 1378|    363|          if (xdef != defsEnd && xdef->idx_ > idx) {
  ------------------
  |  Branch (1378:15): [True: 283, False: 80]
  |  Branch (1378:34): [True: 283, False: 0]
  ------------------
 1379|    283|            gapSize = xdef->idx_ - idx;
 1380|    283|          } else {
 1381|     80|            gapSize = object->TiffEntryBase::doSize() - idx;
 1382|     80|          }
 1383|    363|          gap.idx_ = idx;
 1384|    363|          gap.tiffType_ = cfg->elDefaultDef_.tiffType_;
 1385|    363|          gap.count_ = gapSize / cfg->tagStep();
 1386|    363|          if (gap.count_ * cfg->tagStep() != gapSize) {
  ------------------
  |  Branch (1386:15): [True: 21, False: 342]
  ------------------
 1387|     21|            gap.tiffType_ = ttUndefined;
 1388|     21|            gap.count_ = gapSize;
 1389|     21|          }
 1390|    363|          def = &gap;
 1391|   834k|        } else {
 1392|   834k|          def = &cfg->elDefaultDef_;
 1393|   834k|        }
 1394|   835k|      }
 1395|   837k|    }
 1396|   887k|    idx += object->addElement(idx, *def);  // idx may be different from def->idx_
 1397|   887k|  }
 1398|       |
 1399|  1.05k|}  // TiffReader::visitBinaryArray
_ZN5Exiv28Internal10TiffReader18visitBinaryElementEPNS0_17TiffBinaryElementE:
 1401|   891k|void TiffReader::visitBinaryElement(TiffBinaryElement* object) {
 1402|   891k|  auto pData = object->start();
 1403|   891k|  size_t size = object->TiffEntryBase::doSize();
 1404|   891k|  ByteOrder bo = object->elByteOrder();
 1405|   891k|  if (bo == invalidByteOrder)
  ------------------
  |  Branch (1405:7): [True: 834k, False: 57.4k]
  ------------------
 1406|   834k|    bo = byteOrder();
 1407|   891k|  TypeId typeId = toTypeId(object->elDef()->tiffType_, object->tag(), object->group());
 1408|   891k|  auto v = Value::create(typeId);
 1409|   891k|  enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1410|   891k|  v->read(pData, size, bo);
 1411|       |
 1412|   891k|  object->setValue(std::move(v));
 1413|   891k|  object->setOffset(0);
 1414|   891k|  object->setIdx(nextIdx(object->group()));
 1415|   891k|}
tiffvisitor_int.cpp:_ZN5Exiv28InternalL7findTagEPKNS_7TagInfoEt:
  341|  10.5k|static const TagInfo* findTag(const TagInfo* pList, uint16_t tag) {
  342|   741k|  while (pList->tag_ != 0xffff && pList->tag_ != tag)
  ------------------
  |  Branch (342:10): [True: 741k, False: 0]
  |  Branch (342:35): [True: 731k, False: 10.5k]
  ------------------
  343|   731k|    pList++;
  344|  10.5k|  return pList->tag_ != 0xffff ? pList : nullptr;
  ------------------
  |  Branch (344:10): [True: 10.5k, False: 0]
  ------------------
  345|  10.5k|}

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  3.26M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  3.26M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 2.45M, False: 806k]
  ------------------
   88|  2.45M|    return tit->size_;
   89|   806k|  return 0;
   90|  3.26M|}
_ZN5Exiv27DataBufC2Em:
   92|  1.55M|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|  1.55M|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  55.1k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  55.1k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  11.3k|void DataBuf::alloc(size_t size) {
   99|  11.3k|  pData_.resize(size);
  100|  11.3k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   674k|void DataBuf::resize(size_t size) {
  103|   674k|  pData_.resize(size);
  104|   674k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  31.6k|void DataBuf::reset() {
  107|  31.6k|  pData_.clear();
  108|  31.6k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|  3.21M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|  3.21M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 3.21M]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|  3.21M|  return pData_[offset];
  115|  3.21M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|  4.62M|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|  4.62M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 4.62M]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|  4.62M|  pData_[offset] = x;
  122|  4.62M|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   977k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   977k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 977k]
  |  Branch (125:28): [True: 4, False: 977k]
  ------------------
  126|      4|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      4|  }
  128|   977k|  return getUShort(&pData_[offset], byteOrder);
  129|   977k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  4.73k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  4.73k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 4.73k]
  |  Branch (132:28): [True: 0, False: 4.73k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  4.73k|  us2Data(&pData_[offset], x, byteOrder);
  136|  4.73k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  138|  2.71M|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  139|  2.71M|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 2.71M]
  |  Branch (139:28): [True: 2, False: 2.71M]
  ------------------
  140|      3|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      3|  }
  142|  2.71M|  return getULong(&pData_[offset], byteOrder);
  143|  2.71M|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  4.73k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  4.73k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 4.73k]
  |  Branch (146:28): [True: 0, False: 4.73k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  4.73k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  4.73k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  4.46k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  4.46k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 4.46k]
  |  Branch (153:28): [True: 0, False: 4.46k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  4.46k|  return getULongLong(&pData_[offset], byteOrder);
  157|  4.46k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   353k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   353k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 353k]
  |  Branch (167:34): [True: 0, False: 353k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   353k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   353k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  13.5M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  13.5M|  return const_cast<byte*>(c_data(offset));
  175|  13.5M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  13.7M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  13.7M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 20.1k, False: 13.6M]
  |  Branch (178:25): [True: 1.17k, False: 13.6M]
  ------------------
  179|  21.3k|    return nullptr;
  180|  21.3k|  }
  181|  13.6M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 13.6M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  13.6M|  return &pData_[offset];
  185|  13.6M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  69.6k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  69.6k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  69.6k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|  5.37k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|  5.37k|  return os << r.first << "/" << r.second;
  212|  5.37k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|  9.84k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|  9.84k|  return os << r.first << "/" << r.second;
  241|  9.84k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  5.19M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  5.19M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  5.19M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  7.43M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  7.43M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 2.86M, False: 4.57M]
  ------------------
  253|  2.86M|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|  2.86M|  }
  255|  4.57M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  7.43M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  39.0k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  39.0k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 4.17k, False: 34.8k]
  ------------------
  260|  4.17k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  4.17k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  4.17k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  4.17k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  4.17k|  }
  265|  34.8k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  34.8k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  34.8k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  34.8k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  39.0k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|  1.18M|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|  1.18M|  uint32_t nominator = getULong(buf, byteOrder);
  273|  1.18M|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|  1.18M|  return {nominator, denominator};
  275|  1.18M|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|   215k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|   215k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 204k, False: 10.0k]
  ------------------
  279|   204k|    return buf[1] << 8 | buf[0];
  280|   204k|  }
  281|  10.0k|  return buf[0] << 8 | buf[1];
  282|   215k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|  1.04M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|  1.04M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 366k, False: 676k]
  ------------------
  286|   366k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|   366k|  }
  288|   676k|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|  1.04M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|   185k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|   185k|  int32_t nominator = getLong(buf, byteOrder);
  293|   185k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|   185k|  return {nominator, denominator};
  295|   185k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  26.7k|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|  26.7k|#ifdef __cpp_lib_bit_cast
  302|  26.7k|  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|  26.7k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|  92.8k|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|  92.8k|#ifdef __cpp_lib_bit_cast
  318|  92.8k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 3.59k, False: 89.2k]
  ------------------
  319|  3.59k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  3.59k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  3.59k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  3.59k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|  89.2k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|  89.2k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|  89.2k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|  89.2k|                               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|  92.8k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|   613k|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|   613k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 613k, False: 358]
  ------------------
  350|   613k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|   613k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|   613k|  } else {
  353|    358|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|    358|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|    358|  }
  356|   613k|  return 2;
  357|   613k|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|  2.61M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|  2.61M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 2.61M, False: 902]
  ------------------
  361|  2.61M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|  2.61M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|  2.61M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|  2.61M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|  2.61M|  } else {
  366|    902|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|    902|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|    902|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|    902|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|    902|  }
  371|  2.61M|  return 4;
  372|  2.61M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|  1.18M|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|  1.18M|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|  1.18M|  o += ul2Data(buf + o, l.second, byteOrder);
  392|  1.18M|  return o;
  393|  1.18M|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|  3.93k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|  3.93k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 3.68k, False: 243]
  ------------------
  397|  3.68k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|  3.68k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|  3.68k|  } else {
  400|    243|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|    243|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|    243|  }
  403|  3.93k|  return 2;
  404|  3.93k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|   361k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|   361k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 360k, False: 737]
  ------------------
  408|   360k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|   360k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|   360k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|   360k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|   360k|  } else {
  413|    737|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  414|    737|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  415|    737|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  416|    737|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  417|    737|  }
  418|   361k|  return 4;
  419|   361k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|  29.5k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|  29.5k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|  29.5k|  o += l2Data(buf + o, l.second, byteOrder);
  424|  29.5k|  return o;
  425|  29.5k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|  15.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|  15.6k|#ifdef __cpp_lib_bit_cast
  432|  15.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|  15.6k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|  3.85k|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|  3.85k|  union {
  448|  3.85k|    uint64_t ull_;
  449|  3.85k|    double d_;
  450|  3.85k|  } u;
  451|  3.85k|  u.d_ = d;
  452|  3.85k|  uint64_t m = 0xff;
  453|  3.85k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 3.63k, False: 225]
  ------------------
  454|  3.63k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|  3.63k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|  3.63k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|  3.63k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|  3.63k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|  3.63k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|  3.63k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|  3.63k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|  3.63k|  } else {
  463|    225|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|    225|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|    225|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|    225|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|    225|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|    225|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|    225|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|    225|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|    225|  }
  472|  3.85k|  return 8;
  473|  3.85k|}
_ZN5Exiv219floatToRationalCastEf:
  651|     35|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|     35|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|     35|  int32_t den;
  658|     35|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 35, False: 0]
  ------------------
  659|     35|    den = 1000000;
  660|     35|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (660:14): [True: 0, False: 0]
  ------------------
  661|      0|    den = 10000;
  662|      0|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (662:14): [True: 0, False: 0]
  ------------------
  663|      0|    den = 100;
  664|      0|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (664:14): [True: 0, False: 0]
  ------------------
  665|      0|    den = 1;
  666|      0|  } else {
  667|      0|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (667:13): [True: 0, False: 0]
  ------------------
  668|      0|  }
  669|     35|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|     35|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|     35|  return {nom / g, den / g};
  673|     35|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|  29.1M|  bool operator==(Exiv2::TypeId typeId) const {
   35|  29.1M|    return typeId_ == typeId;
   36|  29.1M|  }

_ZN5Exiv28Internal5upperENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
    8|  41.2k|std::string upper(std::string_view str) {
    9|  41.2k|  std::string result;
   10|  41.2k|  result.reserve(str.size());
   11|  41.2k|  for (auto c : str)
  ------------------
  |  Branch (11:15): [True: 164k, False: 41.2k]
  ------------------
   12|   164k|    result.push_back(std::toupper(static_cast<unsigned char>(c)));
   13|  41.2k|  return result;
   14|  41.2k|}

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  2.86M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  2.86M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  1.57M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  1.57M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 1.57M]
  ------------------
   25|  3.21k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 3.21k, False: 1.57M]
  ------------------
   26|   464k|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 461k, False: 1.11M]
  ------------------
   27|   464k|      return std::make_unique<DataValue>(typeId);
   28|  14.2k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 14.2k, False: 1.56M]
  ------------------
   29|  14.2k|      return std::make_unique<AsciiValue>();
   30|   347k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 347k, False: 1.22M]
  ------------------
   31|   347k|      return std::make_unique<ValueType<uint16_t>>();
   32|  57.6k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 57.6k, False: 1.51M]
  ------------------
   33|  60.2k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 2.67k, False: 1.57M]
  ------------------
   34|  60.2k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  7.52k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 7.52k, False: 1.56M]
  ------------------
   36|  7.52k|      return std::make_unique<ValueType<URational>>();
   37|  7.08k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 7.08k, False: 1.56M]
  ------------------
   38|  7.08k|      return std::make_unique<DataValue>();
   39|  78.2k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 78.2k, False: 1.49M]
  ------------------
   40|  78.2k|      return std::make_unique<ValueType<int16_t>>();
   41|  9.36k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 9.36k, False: 1.56M]
  ------------------
   42|  9.36k|      return std::make_unique<ValueType<int32_t>>();
   43|  2.48k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 2.48k, False: 1.57M]
  ------------------
   44|  2.48k|      return std::make_unique<ValueType<Rational>>();
   45|  2.15k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 2.15k, False: 1.57M]
  ------------------
   46|  2.15k|      return std::make_unique<ValueType<float>>();
   47|  5.32k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 5.32k, False: 1.56M]
  ------------------
   48|  5.32k|      return std::make_unique<ValueType<double>>();
   49|  48.3k|    case string:
  ------------------
  |  Branch (49:5): [True: 48.3k, False: 1.52M]
  ------------------
   50|  48.3k|      return std::make_unique<StringValue>();
   51|  8.13k|    case date:
  ------------------
  |  Branch (51:5): [True: 8.13k, False: 1.56M]
  ------------------
   52|  8.13k|      return std::make_unique<DateValue>();
   53|  17.5k|    case time:
  ------------------
  |  Branch (53:5): [True: 17.5k, False: 1.55M]
  ------------------
   54|  17.5k|      return std::make_unique<TimeValue>();
   55|    359|    case comment:
  ------------------
  |  Branch (55:5): [True: 359, False: 1.57M]
  ------------------
   56|    359|      return std::make_unique<CommentValue>();
   57|  50.0k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 50.0k, False: 1.52M]
  ------------------
   58|  50.0k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 1.57M]
  ------------------
   60|  8.92k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 8.92k, False: 1.56M]
  ------------------
   61|  8.92k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 1.57M]
  ------------------
   62|  8.92k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 1.57M]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|   443k|    default:
  ------------------
  |  Branch (65:5): [True: 443k, False: 1.13M]
  ------------------
   66|   443k|      return std::make_unique<DataValue>(typeId);
   67|  1.57M|  }
   68|  1.57M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|  2.55k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|  2.55k|  return -1;
   72|  2.55k|}
_ZNK5Exiv25Value8toStringEv:
   74|  21.1k|std::string Value::toString() const {
   75|  21.1k|  std::ostringstream os;
   76|  21.1k|  write(os);
   77|  21.1k|  ok_ = !os.fail();
   78|  21.1k|  return os.str();
   79|  21.1k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  24.6k|size_t Value::sizeDataArea() const {
   86|  24.6k|  return 0;
   87|  24.6k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|     56|DataBuf Value::dataArea() const {
   90|     56|  return {nullptr, 0};
   91|     56|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|   914k|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|   914k|}
_ZNK5Exiv29DataValue5countEv:
  100|  1.31M|size_t DataValue::count() const {
  101|  1.31M|  return size();
  102|  1.31M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|   914k|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|   914k|  value_.assign(buf, buf + len);
  107|   914k|  return 0;
  108|   914k|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|   130k|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|   130k|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|   130k|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  1.67M|size_t DataValue::size() const {
  128|  1.67M|  return value_.size();
  129|  1.67M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  2.32M|DataValue* DataValue::clone_() const {
  132|  2.32M|  return new DataValue(*this);
  133|  2.32M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.40k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.40k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 2.05k, False: 347]
  ------------------
  137|  2.05k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  2.05k|    os << static_cast<int>(value_.back());
  139|  2.05k|  }
  140|  2.40k|  return os;
  141|  2.40k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  51.7k|int64_t DataValue::toInt64(size_t n) const {
  149|  51.7k|  ok_ = true;
  150|  51.7k|  return value_.at(n);
  151|  51.7k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|   179k|uint32_t DataValue::toUint32(size_t n) const {
  154|   179k|  ok_ = true;
  155|   179k|  return value_.at(n);
  156|   179k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  13.5k|int StringValueBase::read(const std::string& buf) {
  173|  13.5k|  value_ = buf;
  174|  13.5k|  return 0;
  175|  13.5k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  48.0k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  48.0k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 48.0k, False: 0]
  ------------------
  180|  48.0k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  48.0k|  return 0;
  182|  48.0k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  2.75k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  2.75k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 1.37k, False: 1.38k]
  ------------------
  186|  1.37k|    return 0;
  187|       |  // byteOrder not needed
  188|  1.38k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  2.75k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|  72.9k|size_t StringValueBase::count() const {
  192|  72.9k|  return size();
  193|  72.9k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|  79.9k|size_t StringValueBase::size() const {
  196|  79.9k|  return value_.size();
  197|  79.9k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  52.9k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  52.9k|  ok_ = true;
  205|  52.9k|  return value_.at(n);
  206|  52.9k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  8.69k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  8.69k|  ok_ = true;
  210|  8.69k|  return value_.at(n);
  211|  8.69k|}
_ZN5Exiv211StringValueC2Ev:
  223|  48.3k|StringValue::StringValue() : StringValueBase(string) {
  224|  48.3k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|  99.6k|StringValue* StringValue::clone_() const {
  230|  99.6k|  return new StringValue(*this);
  231|  99.6k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  14.2k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  14.2k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  2.91k|int AsciiValue::read(const std::string& buf) {
  240|  2.91k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  2.91k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 9, False: 2.90k]
  |  Branch (242:25): [True: 2.90k, False: 0]
  ------------------
  243|  2.91k|    value_ += '\0';
  244|  2.91k|  }
  245|  2.91k|  return 0;
  246|  2.91k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|  34.9k|AsciiValue* AsciiValue::clone_() const {
  249|  34.9k|  return new AsciiValue(*this);
  250|  34.9k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  8.58k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  8.58k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  8.58k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 1.38k, False: 7.20k]
  ------------------
  256|  1.38k|    pos = value_.size();
  257|  8.58k|  return os << value_.substr(0, pos);
  258|  8.58k|}
_ZN5Exiv212CommentValueC2Ev:
  292|    359|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|    359|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|    359|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|    359|  byteOrder_ = byteOrder;
  331|    359|  return StringValueBase::read(buf, len, byteOrder);
  332|    359|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|    719|CommentValue* CommentValue::clone_() const {
  411|    719|  return new CommentValue(*this);
  412|    719|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  18.8k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  18.8k|  xmpArrayType_ = xmpArrayType;
  416|  18.8k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  6.42k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  6.42k|  xmpStruct_ = xmpStruct;
  420|  6.42k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|  1.22k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|  1.22k|  return xmpArrayType_;
  424|  1.22k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  18.0k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  18.0k|  XmpArrayType xa = xaNone;
  428|  18.0k|  switch (typeId) {
  429|    169|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 169, False: 17.8k]
  ------------------
  430|    169|      xa = xaAlt;
  431|    169|      break;
  432|    692|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 692, False: 17.3k]
  ------------------
  433|    692|      xa = xaBag;
  434|    692|      break;
  435|  11.9k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 11.9k, False: 6.05k]
  ------------------
  436|  11.9k|      xa = xaSeq;
  437|  11.9k|      break;
  438|  5.19k|    default:
  ------------------
  |  Branch (438:5): [True: 5.19k, False: 12.8k]
  ------------------
  439|  5.19k|      break;
  440|  18.0k|  }
  441|  18.0k|  return xa;
  442|  18.0k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|  1.17k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|  1.17k|  return xmpStruct_;
  446|  1.17k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   217k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   217k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   627k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   627k|  std::string b = buf;
  478|   627k|  std::string type;
  479|   627k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 2.99k, False: 624k]
  ------------------
  480|  2.99k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  2.99k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  2.99k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 2.57k, False: 414]
  |  Branch (483:26): [True: 1.89k, False: 683]
  ------------------
  484|  1.89k|      type = type.substr(1);
  485|  2.99k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 2.22k, False: 763]
  |  Branch (485:26): [True: 560, False: 1.66k]
  ------------------
  486|    560|      type.pop_back();
  487|  2.99k|    b.clear();
  488|  2.99k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 1.63k, False: 1.36k]
  ------------------
  489|  1.63k|      b = buf.substr(pos + 1);
  490|  2.99k|  }
  491|   627k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 2.22k, False: 624k]
  ------------------
  492|  2.22k|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 219, False: 2.00k]
  ------------------
  493|    219|      setXmpArrayType(XmpValue::xaAlt);
  494|  2.00k|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 199, False: 1.81k]
  ------------------
  495|    199|      setXmpArrayType(XmpValue::xaBag);
  496|  1.81k|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 358, False: 1.45k]
  ------------------
  497|    358|      setXmpArrayType(XmpValue::xaSeq);
  498|  1.45k|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 887, False: 565]
  ------------------
  499|    887|      setXmpStruct();
  500|    887|    } else {
  501|    565|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    565|    }
  503|  2.22k|  }
  504|   626k|  value_ = std::move(b);
  505|   626k|  return 0;
  506|   627k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|  1.20k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|  1.20k|  bool del = false;
  524|  1.20k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 23, False: 1.17k]
  ------------------
  525|     23|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 23, False: 0]
  ------------------
  526|     21|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 21, False: 2]
  ------------------
  527|     21|        os << "type=\"Alt\"";
  528|     21|        break;
  529|      0|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 0, False: 23]
  ------------------
  530|      0|        os << "type=\"Bag\"";
  531|      0|        break;
  532|      2|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 2, False: 21]
  ------------------
  533|      2|        os << "type=\"Seq\"";
  534|      2|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 23]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|     23|    }
  538|     23|    del = true;
  539|  1.17k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 0, False: 1.17k]
  ------------------
  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|  1.20k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 23, False: 1.17k]
  |  Branch (549:14): [True: 0, False: 23]
  ------------------
  550|      0|    os << " ";
  551|  1.20k|  return os << value_;
  552|  1.20k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   461k|XmpTextValue* XmpTextValue::clone_() const {
  571|   461k|  return new XmpTextValue(*this);
  572|   461k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  12.4k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  12.4k|  setXmpArrayType(xmpArrayType(typeId));
  576|  12.4k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   128k|int XmpArrayValue::read(const std::string& buf) {
  579|   128k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 107k, False: 21.0k]
  ------------------
  580|   107k|    value_.push_back(buf);
  581|   128k|  return 0;
  582|   128k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|    127|size_t XmpArrayValue::count() const {
  589|    127|  return value_.size();
  590|    127|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    119|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    119|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 114, False: 5]
  ------------------
  594|    114|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    114|    os << value_.back();
  596|    114|  }
  597|    119|  return os;
  598|    119|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|  13.1k|std::string XmpArrayValue::toString(size_t n) const {
  601|  13.1k|  ok_ = true;
  602|  13.1k|  return value_.at(n);
  603|  13.1k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  23.7k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  23.7k|  return new XmpArrayValue(*this);
  623|  23.7k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|  1.07k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|  1.07k|}
_ZNK5Exiv212LangAltValue5countEv:
  679|     61|size_t LangAltValue::count() const {
  680|     61|  return value_.size();
  681|     61|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|     12|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|     12|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|     12|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 12]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|     12|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 12, False: 12]
  ------------------
  694|     12|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 12, False: 0]
  ------------------
  695|     12|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 12]
  ------------------
  696|      0|        os << ", ";
  697|     12|      os << "lang=\"" << lang << "\" " << s;
  698|     12|      first = false;
  699|     12|    }
  700|     12|  }
  701|     12|  return os;
  702|     12|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    121|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    121|  return toString("x-default");
  706|    121|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    121|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    121|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 60, False: 61]
  ------------------
  710|     60|    ok_ = true;
  711|     60|    return i->second;
  712|     60|  }
  713|     61|  ok_ = false;
  714|     61|  return "";
  715|    121|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  2.20k|LangAltValue* LangAltValue::clone_() const {
  738|  2.20k|  return new LangAltValue(*this);
  739|  2.20k|}
_ZN5Exiv29DateValueC2Ev:
  741|  8.13k|DateValue::DateValue() : Value(date) {
  742|  8.13k|  date_ = {};
  743|  8.13k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  8.13k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  8.13k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  8.13k|  return read(str);
  752|  8.13k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  8.13k|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|  8.13k|  size_t monthPos = 0;
  758|  8.13k|  size_t dayPos = 0;
  759|       |
  760|  8.13k|  auto printWarning = [] {
  761|  8.13k|#ifndef SUPPRESS_WARNINGS
  762|  8.13k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  8.13k|#endif
  764|  8.13k|  };
  765|       |
  766|  8.13k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 357, False: 7.78k]
  ------------------
  767|    357|    printWarning();
  768|    357|    return 1;
  769|    357|  }
  770|       |
  771|  7.78k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 2.96k, False: 4.81k]
  |  Branch (771:28): [True: 1.79k, False: 1.17k]
  |  Branch (771:45): [True: 836, False: 954]
  |  Branch (771:63): [True: 4.80k, False: 2.13k]
  ------------------
  772|  5.64k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 836, False: 4.80k]
  ------------------
  773|    836|      monthPos = 5;
  774|    836|      dayPos = 8;
  775|  4.80k|    } else {
  776|  4.80k|      monthPos = 4;
  777|  4.80k|      dayPos = 6;
  778|  4.80k|    }
  779|       |
  780|  5.64k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  5.64k|      for (size_t i = start; i < start + count; ++i) {
  782|  5.64k|        if (!std::isdigit(buf[i])) {
  783|  5.64k|          printWarning();
  784|  5.64k|          return 1;
  785|  5.64k|        }
  786|  5.64k|      }
  787|  5.64k|      dest = std::stoul(buf.substr(start, count));
  788|  5.64k|      return 0;
  789|  5.64k|    };
  790|       |
  791|  5.64k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 1.30k, False: 4.34k]
  |  Branch (791:42): [True: 1.63k, False: 2.70k]
  |  Branch (791:83): [True: 664, False: 2.03k]
  ------------------
  792|  3.60k|      printWarning();
  793|  3.60k|      return 1;
  794|  3.60k|    }
  795|       |
  796|  2.03k|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 674, False: 1.36k]
  |  Branch (796:29): [True: 457, False: 906]
  ------------------
  797|  1.13k|      date_.month = 0;
  798|  1.13k|      date_.day = 0;
  799|  1.13k|      printWarning();
  800|  1.13k|      return 1;
  801|  1.13k|    }
  802|    906|    return 0;
  803|  2.03k|  }
  804|  2.13k|  printWarning();
  805|  2.13k|  return 1;
  806|  7.78k|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|  1.00k|DateValue* DateValue::clone_() const {
  835|  1.00k|  return new DateValue(*this);
  836|  1.00k|}
_ZN5Exiv29TimeValueC2Ev:
  877|  17.5k|TimeValue::TimeValue() : Value(time) {
  878|  17.5k|  time_ = {};
  879|  17.5k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  17.5k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  17.5k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  17.5k|  return read(str);
  888|  17.5k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  17.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|  17.5k|  auto printWarning = [] {
  896|  17.5k|#ifndef SUPPRESS_WARNINGS
  897|  17.5k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  17.5k|#endif
  899|  17.5k|    return 1;
  900|  17.5k|  };
  901|       |
  902|  17.5k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 716, False: 16.7k]
  ------------------
  903|    716|    return printWarning();
  904|       |
  905|  16.7k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 228k, False: 10.9k]
  ------------------
  906|   228k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 222k, False: 5.67k]
  |  Branch (906:21): [True: 218k, False: 4.36k]
  |  Branch (906:33): [True: 204k, False: 13.5k]
  |  Branch (906:45): [True: 203k, False: 1.57k]
  |  Branch (906:57): [True: 5.87k, False: 197k]
  ------------------
  907|  5.87k|      return printWarning();
  908|       |
  909|  10.9k|  size_t mpos;
  910|  10.9k|  size_t spos;
  911|  10.9k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 3.90k, False: 7.01k]
  ------------------
  912|  3.90k|    mpos = 3;
  913|  3.90k|    spos = 6;
  914|  7.01k|  } else {
  915|  7.01k|    mpos = 2;
  916|  7.01k|    spos = 4;
  917|  7.01k|  }
  918|       |
  919|  10.9k|  try {
  920|  10.9k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  10.9k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 551, False: 10.3k]
  |  Branch (921:19): [True: 142, False: 10.2k]
  ------------------
  922|    665|      return printWarning();
  923|  10.2k|    time_.hour = hi;
  924|  10.2k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 9.86k, False: 394]
  ------------------
  925|  9.86k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  9.86k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 82, False: 9.78k]
  |  Branch (926:21): [True: 386, False: 9.39k]
  ------------------
  927|    417|        return printWarning();
  928|  9.44k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  9.44k|    } else {
  930|    394|      time_.minute = 0;
  931|    394|    }
  932|  9.84k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 7.45k, False: 2.39k]
  ------------------
  933|  7.45k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  7.45k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 486, False: 6.96k]
  |  Branch (934:21): [True: 660, False: 6.30k]
  ------------------
  935|  1.10k|        return printWarning();
  936|  6.35k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  6.35k|    } else {
  938|  2.39k|      time_.second = 0;
  939|  2.39k|    }
  940|       |
  941|  8.74k|    auto fpos = buf.find('+');
  942|  8.74k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 6.51k, False: 2.22k]
  ------------------
  943|  6.51k|      fpos = buf.find('-');
  944|       |
  945|  8.74k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 7.41k, False: 1.32k]
  ------------------
  946|  7.41k|      auto format = buf.substr(fpos, buf.size());
  947|  7.41k|      auto posColon = format.find(':');
  948|  7.41k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (948:11): [True: 4.34k, False: 3.07k]
  ------------------
  949|       |        // Extended format
  950|  4.34k|        auto tzhi = std::stoi(format.substr(0, 3));
  951|  4.34k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (951:13): [True: 96, False: 4.24k]
  |  Branch (951:27): [True: 239, False: 4.00k]
  ------------------
  952|    308|          return printWarning();
  953|  4.03k|        time_.tzHour = tzhi;
  954|  4.03k|        if (format.size() > 3) {
  ------------------
  |  Branch (954:13): [True: 3.69k, False: 340]
  ------------------
  955|  3.69k|          int minute = std::stoi(format.substr(3));
  956|  3.69k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (956:15): [True: 2.12k, False: 1.56k]
  |  Branch (956:29): [True: 419, False: 1.15k]
  ------------------
  957|    632|            return printWarning();
  958|  3.06k|          time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (958:28): [True: 248, False: 2.81k]
  ------------------
  959|  3.06k|        }
  960|  4.03k|      } else {
  961|       |        // Basic format
  962|  3.07k|        auto tzhi = std::stoi(format.substr(0, posColon));
  963|  3.07k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (963:13): [True: 497, False: 2.57k]
  |  Branch (963:27): [True: 135, False: 2.44k]
  ------------------
  964|    429|          return printWarning();
  965|  2.64k|        time_.tzHour = tzhi;
  966|  2.64k|        int minute = std::stoi(format.substr(posColon + 1));
  967|  2.64k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (967:13): [True: 734, False: 1.91k]
  |  Branch (967:27): [True: 206, False: 1.70k]
  ------------------
  968|    480|          return printWarning();
  969|  2.16k|        time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (969:26): [True: 1.29k, False: 866]
  ------------------
  970|  2.16k|      }
  971|  7.41k|    }
  972|  8.74k|  } catch (std::exception&) {
  973|       |    // std::stoi might throw an exception if the syntax is invalid.
  974|  2.52k|    return printWarning();
  975|  2.52k|  }
  976|  4.36k|  return 0;
  977|  10.9k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1012|  5.13k|TimeValue* TimeValue::clone_() const {
 1013|  5.13k|  return new TimeValue(*this);
 1014|  5.13k|}
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.4k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 32.3k, False: 9.07k]
  ------------------
  782|  32.3k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 3.60k, False: 28.7k]
  ------------------
  783|  3.60k|          printWarning();
  784|  3.60k|          return 1;
  785|  3.60k|        }
  786|  32.3k|      }
  787|  9.07k|      dest = std::stoul(buf.substr(start, count));
  788|  9.07k|      return 0;
  789|  12.6k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  13.1k|  auto printWarning = [] {
  896|  13.1k|#ifndef SUPPRESS_WARNINGS
  897|  13.1k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  13.1k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13.1k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  13.1k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  13.1k|#endif
  899|  13.1k|    return 1;
  900|  13.1k|  };

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   230k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   230k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 180k, False: 50.0k]
  ------------------
  253|   180k|    value_ = pValue->clone();
  254|   230k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   306k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   306k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 306k, False: 0]
  ------------------
  258|   306k|    key_ = rhs.key_->clone();  // deep copy
  259|   306k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 306k, False: 0]
  ------------------
  260|   306k|    value_ = rhs.value_->clone();  // deep copy
  261|   306k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   230k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   230k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   306k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   306k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   536k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  14.5M|std::string Xmpdatum::key() const {
  291|  14.5M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 14.5M, False: 0]
  ------------------
  292|  14.5M|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|    951|TypeId Xmpdatum::typeId() const {
  319|    951|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 951, False: 0]
  ------------------
  320|    951|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|    188|size_t Xmpdatum::count() const {
  331|    188|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 188, False: 0]
  ------------------
  332|    188|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  338|  1.13k|std::string Xmpdatum::toString() const {
  339|  1.13k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (339:10): [True: 1.13k, False: 0]
  ------------------
  340|  1.13k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  342|  13.2k|std::string Xmpdatum::toString(size_t n) const {
  343|  13.2k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 13.2k, False: 0]
  ------------------
  344|  13.2k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|  13.8k|const Value& Xmpdatum::value() const {
  363|  13.8k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 13.8k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|  13.8k|  return *p_->value_;
  366|  13.8k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   465k|int Xmpdatum::setValue(const std::string& value) {
  383|   465k|  XmpProperties::XmpLock lock;
  384|   465k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 50.0k, False: 415k]
  ------------------
  385|  50.0k|    TypeId type = xmpText;
  386|  50.0k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 50.0k, False: 0]
  ------------------
  387|  50.0k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  50.0k|    }
  389|  50.0k|    p_->value_ = Value::create(type);
  390|  50.0k|  }
  391|   465k|  return p_->value_->read(value);
  392|   465k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   466k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   466k|  XmpProperties::XmpLock lock;
  396|   466k|  XmpKey xmpKey(key, lock);
  397|   466k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   466k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 50.0k, False: 416k]
  ------------------
  399|  50.0k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  50.0k|  }
  401|   416k|  return *pos;
  402|   466k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  8.92k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  8.92k|  XmpProperties::XmpLock lock;
  406|  8.92k|  return addUnlocked(key, value, lock);
  407|  8.92k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   180k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   180k|  xmpMetadata_.emplace_back(key, value);
  411|   180k|  return 0;
  412|   180k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  35.7k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  35.7k|  XmpProperties::XmpLock lock;
  426|  35.7k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  35.7k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   219k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   219k|  XmpProperties::XmpLock lock;
  431|   219k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   219k|}
_ZN5Exiv27XmpData5clearEv:
  434|  37.0k|void XmpData::clear() {
  435|  37.0k|  XmpProperties::XmpLock lock;
  436|  37.0k|  clearUnlocked(lock);
  437|  37.0k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  49.9k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  49.9k|  xmpMetadata_.clear();
  441|  49.9k|  nsBindings_.clear();
  442|  49.9k|}
_ZNK5Exiv27XmpData3endEv:
  457|  35.7k|XmpData::const_iterator XmpData::end() const {
  458|  35.7k|  return xmpMetadata_.end();
  459|  35.7k|}
_ZNK5Exiv27XmpData5emptyEv:
  461|  5.79k|bool XmpData::empty() const {
  462|  5.79k|  XmpProperties::XmpLock lock;
  463|  5.79k|  return emptyUnlocked(lock);
  464|  5.79k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  466|  10.5k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  467|  10.5k|  return xmpMetadata_.empty();
  468|  10.5k|}
_ZN5Exiv27XmpData5beginEv:
  479|  1.74k|XmpData::iterator XmpData::begin() {
  480|  1.74k|  return xmpMetadata_.begin();
  481|  1.74k|}
_ZN5Exiv27XmpData3endEv:
  483|   221k|XmpData::iterator XmpData::end() {
  484|   221k|  return xmpMetadata_.end();
  485|   221k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  536|  17.6k|void xmpToolkitEnsureInitialized() {
  537|  17.6k|  static XmpToolkitLifetimeManager instance;
  538|  17.6k|  (void)instance;
  539|  17.6k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  661|  14.3k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  662|  14.3k|  try {
  663|  14.3k|    xmpData.setPacket(xmpPacket);
  664|  14.3k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (664:9): [True: 1.41k, False: 12.9k]
  ------------------
  665|  1.41k|      xmpData.clear();
  666|  1.41k|      return 0;
  667|  1.41k|    }
  668|       |
  669|       |    // Acquire Giant Lock
  670|  12.9k|    XmpProperties::XmpLock lock;
  671|  12.9k|    try {
  672|  12.9k|      xmpToolkitEnsureInitialized();
  673|  12.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|  12.9k|    xmpData.clearUnlocked(lock);
  681|       |
  682|       |    // Make sure the unterminated substring is used
  683|  12.9k|    size_t len = xmpPacket.size();
  684|   147k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (684:12): [True: 147k, False: 35]
  |  Branch (684:23): [True: 134k, False: 12.9k]
  ------------------
  685|   134k|      --len;
  686|       |
  687|  12.9k|    XMLValidator::check(xmpPacket.data(), len);
  688|  12.9k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  689|  12.9k|    SXMPIterator iter(meta);
  690|  12.9k|    std::string schemaNs;
  691|  12.9k|    std::string propPath;
  692|  12.9k|    std::string propValue;
  693|  12.9k|    XMP_OptionBits opt = 0;
  694|   196k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (694:12): [True: 183k, False: 12.9k]
  ------------------
  695|   183k|      printNode(schemaNs, propPath, propValue, opt);
  696|   183k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (696:11): [True: 0, False: 183k]
  ------------------
  697|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  698|      0|      }
  699|   183k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (699:11): [True: 12.1k, False: 171k]
  ------------------
  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.43k, False: 3.71k]
  ------------------
  704|  8.43k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (704:15): [True: 0, False: 8.43k]
  ------------------
  705|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  706|  8.43k|          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.43k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (714:15): [True: 22, False: 8.40k]
  ------------------
  715|     22|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  716|  8.43k|        }
  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|   171k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  725|   171k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (725:11): [True: 1.07k, False: 170k]
  ------------------
  726|       |        // Read Lang Alt property
  727|  1.07k|        auto val = std::make_unique<LangAltValue>();
  728|  1.07k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  729|  27.7k|        while (count-- > 0) {
  ------------------
  |  Branch (729:16): [True: 26.6k, False: 1.06k]
  ------------------
  730|       |          // Get the text
  731|  26.6k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  732|  26.6k|          printNode(schemaNs, propPath, propValue, opt);
  733|  26.6k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (733:15): [True: 0, False: 26.6k]
  |  Branch (733:28): [True: 0, False: 26.6k]
  |  Branch (733:54): [True: 7, False: 26.6k]
  ------------------
  734|      7|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  735|      7|          }
  736|  26.6k|          std::string text = propValue;
  737|       |          // Get the language qualifier
  738|  26.6k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  739|  26.6k|          printNode(schemaNs, propPath, propValue, opt);
  740|  26.6k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (740:15): [True: 0, False: 26.6k]
  |  Branch (740:15): [True: 0, False: 26.6k]
  |  Branch (740:28): [True: 0, False: 26.6k]
  |  Branch (740:54): [True: 0, False: 26.6k]
  ------------------
  741|  26.6k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (741:15): [True: 0, False: 26.6k]
  ------------------
  742|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  743|      0|          }
  744|  26.6k|          val->value_[propValue] = std::move(text);
  745|  26.6k|        }
  746|  1.06k|        xmpData.addUnlocked(*key, val.get(), lock);
  747|  1.06k|        continue;
  748|  1.07k|      }
  749|   170k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (749:11): [True: 3.91k, False: 166k]
  |  Branch (749:35): [True: 3.91k, False: 0]
  |  Branch (749:66): [True: 3.91k, False: 0]
  ------------------
  750|       |        // Check if all elements are simple
  751|  3.91k|        bool simpleArray = true;
  752|  3.91k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  753|  3.91k|        std::string aSchemaNs;
  754|  3.91k|        std::string aPropPath;
  755|  3.91k|        std::string aPropValue;
  756|  3.91k|        XMP_OptionBits aOpt = 0;
  757|  30.3k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (757:16): [True: 26.7k, False: 3.57k]
  ------------------
  758|  26.7k|          if (propPath == aPropPath)
  ------------------
  |  Branch (758:15): [True: 3.91k, False: 22.8k]
  ------------------
  759|  3.91k|            continue;
  760|  22.8k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (760:15): [True: 204, False: 22.6k]
  |  Branch (760:42): [True: 139, False: 22.5k]
  |  Branch (760:73): [True: 0, False: 22.5k]
  ------------------
  761|  22.8k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (761:15): [True: 0, False: 22.5k]
  |  Branch (761:41): [True: 0, False: 22.5k]
  ------------------
  762|    343|            simpleArray = false;
  763|    343|            break;
  764|    343|          }
  765|  22.8k|        }
  766|  3.91k|        if (simpleArray) {
  ------------------
  |  Branch (766:13): [True: 3.57k, False: 343]
  ------------------
  767|       |          // Read the array into an XmpArrayValue
  768|  3.57k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  769|  3.57k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  770|  26.0k|          while (count-- > 0) {
  ------------------
  |  Branch (770:18): [True: 22.4k, False: 3.57k]
  ------------------
  771|  22.4k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  772|  22.4k|            printNode(schemaNs, propPath, propValue, opt);
  773|  22.4k|            val->read(propValue);
  774|  22.4k|          }
  775|  3.57k|          xmpData.addUnlocked(*key, val.get(), lock);
  776|  3.57k|          continue;
  777|  3.57k|        }
  778|  3.91k|      }
  779|       |
  780|   167k|      auto val = std::make_unique<XmpTextValue>();
  781|   167k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (781:11): [True: 5.19k, False: 161k]
  |  Branch (781:36): [True: 343, False: 161k]
  ------------------
  782|       |        // Create a metadatum with only XMP options
  783|  5.53k|        val->setXmpArrayType(xmpArrayType(opt));
  784|  5.53k|        val->setXmpStruct(xmpStruct(opt));
  785|  5.53k|        xmpData.addUnlocked(*key, val.get(), lock);
  786|  5.53k|        continue;
  787|  5.53k|      }
  788|   161k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (788:11): [True: 161k, False: 0]
  |  Branch (788:36): [True: 0, False: 0]
  ------------------
  789|   161k|        val->read(propValue);
  790|   161k|        xmpData.addUnlocked(*key, val.get(), lock);
  791|   161k|        continue;
  792|   161k|      }
  793|       |      // Don't let any node go by unnoticed
  794|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  795|   161k|    }  // iterate through all XMP nodes
  796|       |
  797|  12.9k|    return 0;
  798|  12.9k|  }
  799|  14.3k|#ifndef SUPPRESS_WARNINGS
  800|  14.3k|  catch (const Error& e) {
  801|     58|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (801:9): [True: 0, False: 58]
  ------------------
  802|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  803|      0|    }
  804|     58|    throw;
  805|  4.37k|  } catch (const XMP_Error& e) {
  806|  4.37k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  4.37k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.37k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.37k|  LogMsg(LogMsg::error).os()
  ------------------
  807|  4.37k|    xmpData.clear();
  808|  4.37k|    return 3;
  809|  4.37k|  }
  810|       |#else
  811|       |  catch (const XMP_Error&) {
  812|       |    xmpData.clear();
  813|       |    return 3;
  814|       |  }
  815|       |#endif  // SUPPRESS_WARNINGS
  816|  14.3k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  830|  4.73k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  831|  4.73k|  try {
  832|       |    // Acquire Giant Lock
  833|  4.73k|    XmpProperties::XmpLock lock;
  834|  4.73k|    try {
  835|  4.73k|      xmpToolkitEnsureInitialized();
  836|  4.73k|    } 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.73k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (843:9): [True: 4.73k, False: 0]
  ------------------
  844|  4.73k|      xmpPacket.clear();
  845|  4.73k|      return 0;
  846|  4.73k|    }  // 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.73k|#ifndef SUPPRESS_WARNINGS
  923|  4.73k|  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.73k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1096|   171k|                                                      const XmpProperties::XmpLock& lock) {
 1097|   171k|  std::string property;
 1098|   171k|  std::string::size_type idx = propPath.find(':');
 1099|   171k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 171k]
  ------------------
 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|   171k|  property = propPath.substr(idx + 1);
 1104|   171k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1105|   171k|  if (prefix.empty()) {
  ------------------
  |  Branch (1105:7): [True: 19.5k, False: 152k]
  ------------------
 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|  19.5k|    std::string toolkitPrefix;
 1111|  19.5k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1111:9): [True: 19.5k, False: 0]
  ------------------
 1112|  19.5k|      toolkitPrefix.pop_back();
 1113|  19.5k|      prefix = std::move(toolkitPrefix);
 1114|  19.5k|    }
 1115|  19.5k|  }
 1116|   171k|  if (prefix.empty()) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 171k]
  ------------------
 1117|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1118|      0|  }
 1119|   171k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1120|   171k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  14.4M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  14.4M|    return key_ == xmpdatum.key();
  203|  14.4M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|   722k|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|   722k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  12.9k|  static void check(const char* buf, size_t buflen) {
   67|  12.9k|    XMLValidator validator;
   68|  12.9k|    validator.check_internal(buf, buflen);
   69|  12.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  12.9k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  12.9k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 12.9k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  12.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  12.9k|  void check_internal(const char* buf, size_t buflen) {
  103|  12.9k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 12.9k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  12.9k|    XML_SetUserData(parser_, this);
  108|  12.9k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  12.9k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  12.9k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  12.9k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 2.20k, False: 10.7k]
  ------------------
  113|  2.20k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  2.20k|    }
  115|       |
  116|  12.9k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 2.20k, False: 10.7k]
  ------------------
  117|  2.20k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  2.20k|    }
  119|  12.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   154k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   154k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   154k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   154k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   154k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 237, False: 153k]
  ------------------
  123|    237|      setError("Too deeply nested");
  124|    237|    }
  125|   154k|    ++element_depth_;
  126|   154k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   141k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   141k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   141k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   141k|  void endElement(const XML_Char*) noexcept {
  129|   141k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 141k, False: 0]
  ------------------
  130|   141k|      --element_depth_;
  131|   141k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   141k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  47.6k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  47.6k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  47.6k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  47.6k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  47.6k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 229, False: 47.4k]
  ------------------
  138|    229|      setError("Too deeply nested");
  139|    229|    }
  140|  47.6k|    ++namespace_depth_;
  141|  47.6k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  39.2k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  39.2k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  39.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  39.2k|  void endNamespace(const XML_Char*) noexcept {
  144|  39.2k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 39.2k, False: 0]
  ------------------
  145|  39.2k|      --namespace_depth_;
  146|  39.2k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  39.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  2.66k|  void setError(const char* msg) {
   88|  2.66k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  2.66k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  2.66k|#ifndef SUPPRESS_WARNINGS
   91|  2.66k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  2.66k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 2.66k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  2.66k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  2.66k|#endif
   93|       |    // If this is the first error, then save it.
   94|  2.66k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 2.20k, False: 466]
  ------------------
   95|  2.20k|      haserror_ = true;
   96|  2.20k|      errmsg_ = msg;
   97|  2.20k|      errlinenum_ = errlinenum;
   98|  2.20k|      errcolnum_ = errcolnum;
   99|  2.20k|    }
  100|  2.66k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  12.9k|  ~XMLValidator() {
   84|  12.9k|    XML_ParserFree(parser_);
   85|  12.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  953|  5.53k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  954|  5.53k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  955|  5.53k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (955:7): [True: 5.19k, False: 343]
  ------------------
  956|  5.19k|    var = Exiv2::XmpValue::xsStruct;
  957|  5.19k|  }
  958|  5.53k|  return var;
  959|  5.53k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  973|  9.10k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  974|  9.10k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  975|  9.10k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (975:7): [True: 3.91k, False: 5.19k]
  ------------------
  976|  3.91k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (976:9): [True: 169, False: 3.74k]
  ------------------
  977|    169|      typeId = Exiv2::xmpAlt;
  978|  3.74k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (978:14): [True: 3.05k, False: 692]
  ------------------
  979|  3.05k|      typeId = Exiv2::xmpSeq;
  980|    692|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (980:14): [True: 692, False: 0]
  ------------------
  981|    692|      typeId = Exiv2::xmpBag;
  982|  3.91k|  }
  983|  9.10k|  return typeId;
  984|  9.10k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  986|  5.53k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  987|  5.53k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  988|  5.53k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1089|   259k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1090|   259k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   536k|  ~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_EEEEb:
   29|  1.78k|XmpSidecar::XmpSidecar(BasicIo::UniquePtr io, bool create) : Image(ImageType::xmp, mdXmp, std::move(io)) {
   30|  1.78k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 1.78k]
  |  Branch (30:17): [True: 0, False: 0]
  ------------------
   31|      0|    IoCloser closer(*io_);
   32|      0|    io_->write(reinterpret_cast<const byte*>(xmlHeader), xmlHdrCnt);
   33|      0|  }
   34|  1.78k|}  // XmpSidecar::XmpSidecar
_ZNK5Exiv210XmpSidecar8mimeTypeEv:
   36|  4.92k|std::string XmpSidecar::mimeType() const {
   37|  4.92k|  return "application/rdf+xml";
   38|  4.92k|}
_ZN5Exiv210XmpSidecar12readMetadataEv:
   45|  1.78k|void XmpSidecar::readMetadata() {
   46|       |#ifdef EXIV2_DEBUG_MESSAGES
   47|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   48|       |#endif
   49|  1.78k|  if (io_->open() != 0) {
  ------------------
  |  Branch (49:7): [True: 0, False: 1.78k]
  ------------------
   50|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   51|      0|  }
   52|  1.78k|  IoCloser closer(*io_);
   53|       |  // Ensure that this is the correct image type
   54|  1.78k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (54:7): [True: 0, False: 1.78k]
  ------------------
   55|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (55:9): [True: 0, False: 0]
  |  Branch (55:25): [True: 0, False: 0]
  ------------------
   56|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   57|      0|    throw Error(ErrorCode::kerNotAnImage, "XMP");
   58|      0|  }
   59|       |  // Read the XMP packet from the IO stream
   60|  1.78k|  std::string xmpPacket;
   61|  1.78k|  const long len = 64 * 1024;
   62|  1.78k|  auto buf = std::make_unique<byte[]>(len);
   63|  4.29k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (63:15): [True: 2.50k, False: 1.78k]
  ------------------
   64|  2.50k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   65|  2.50k|  }
   66|  1.78k|  if (io_->error())
  ------------------
  |  Branch (66:7): [True: 0, False: 1.78k]
  ------------------
   67|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   68|  1.78k|  clearMetadata();
   69|  1.78k|  xmpPacket_ = std::move(xmpPacket);
   70|  1.78k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (70:7): [True: 1.78k, False: 1]
  |  Branch (70:30): [True: 367, False: 1.41k]
  ------------------
   71|    367|#ifndef SUPPRESS_WARNINGS
   72|    367|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    367|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 367]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    367|  LogMsg(LogMsg::warn).os()
  ------------------
   73|    367|#endif
   74|    367|  }
   75|       |
   76|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   77|  79.2k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (77:24): [True: 79.2k, False: 1.78k]
  ------------------
   78|  79.2k|    std::string key(xmp.key());
   79|  79.2k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (79:9): [True: 201, False: 79.0k]
  ------------------
   80|    201|      dates_[key] = xmp.value().toString();
   81|    201|    }
   82|  79.2k|  }
   83|       |
   84|  1.78k|  copyXmpToIptc(xmpData_, iptcData_);
   85|  1.78k|  copyXmpToExif(xmpData_, exifData_);
   86|  1.78k|}  // XmpSidecar::readMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  152|  1.78k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, bool create) {
  153|  1.78k|  auto image = std::make_unique<XmpSidecar>(std::move(io), create);
  154|  1.78k|  if (!image->good()) {
  ------------------
  |  Branch (154:7): [True: 0, False: 1.78k]
  ------------------
  155|      0|    return nullptr;
  156|      0|  }
  157|  1.78k|  return image;
  158|  1.78k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  160|  22.5k|bool isXmpType(BasicIo& iIo, bool advance) {
  161|       |  /*
  162|       |    Check if the file starts with an optional XML declaration followed by
  163|       |    either an XMP header (<?xpacket ... ?>) or an <x:xmpmeta> element.
  164|       |
  165|       |    In addition, in order for empty XmpSidecar objects as created by
  166|       |    Exiv2 to pass the test, just an XML header is also considered ok.
  167|       |   */
  168|  22.5k|  const int32_t len = 80;
  169|  22.5k|  byte buf[len];
  170|  22.5k|  iIo.read(buf, xmlHdrCnt + 1);
  171|  22.5k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (171:7): [True: 346, False: 22.2k]
  |  Branch (171:20): [True: 3, False: 343]
  ------------------
  172|      3|    return true;
  173|      3|  }
  174|  22.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (174:7): [True: 0, False: 22.5k]
  |  Branch (174:22): [True: 343, False: 22.2k]
  ------------------
  175|    343|    return false;
  176|    343|  }
  177|  22.2k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  178|  22.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (178:7): [True: 0, False: 22.2k]
  |  Branch (178:22): [True: 21, False: 22.2k]
  ------------------
  179|     21|    return false;
  180|     21|  }
  181|       |  // Skip leading BOM
  182|  22.2k|  int32_t start = 0;
  183|  22.2k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (183:7): [True: 75, False: 22.1k]
  ------------------
  184|     75|    start = 3;
  185|     75|  }
  186|  22.2k|  bool rc = false;
  187|  22.2k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  188|  22.2k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (188:7): [True: 78, False: 22.1k]
  ------------------
  189|       |    // Forward to the next tag
  190|     78|    auto it = std::find(head.begin() + 5, head.end(), '<');
  191|     78|    if (it != head.end())
  ------------------
  |  Branch (191:9): [True: 68, False: 10]
  ------------------
  192|     68|      head = head.substr(std::distance(head.begin(), it));
  193|     78|  }
  194|  22.2k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (194:7): [True: 3.66k, False: 18.5k]
  |  Branch (194:40): [True: 1.68k, False: 16.8k]
  ------------------
  195|  5.35k|    rc = true;
  196|  5.35k|  }
  197|  22.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (197:7): [True: 22.2k, False: 0]
  |  Branch (197:19): [True: 0, False: 0]
  ------------------
  198|  22.2k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  199|  22.2k|  }
  200|  22.2k|  return rc;
  201|  22.2k|}

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  8.08k|{
  625|  8.08k|	IgnoreParam(options);
  ------------------
  |  |  117|  8.08k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  8.08k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  8.08k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  8.08k|{
  647|       |
  648|  8.08k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     76|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 76, False: 8.00k]
  ------------------
  649|  8.00k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  8.00k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  8.00k|{
  664|  8.00k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  8.00k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  8.00k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  8.00k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  43.3k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 35.3k, False: 8.00k]
  ------------------
  670|  35.3k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 27.2k, False: 8.10k]
  ------------------
  671|  8.10k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  8.10k|	}
  673|       |
  674|  8.00k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  13.0k|{
  695|  13.0k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  13.0k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 5.37k, False: 7.66k]
  |  Branch (696:45): [True: 12, False: 5.36k]
  ------------------
  697|     12|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     12|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  13.0k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 8.09k, False: 4.93k]
  |  Branch (700:21): [True: 452, False: 7.64k]
  ------------------
  701|    452|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    452|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  12.5k|	} else {
  703|  12.5k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  12.5k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  12.5k|	}
  706|       |
  707|  13.0k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   409k|{
  265|   409k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   409k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 408k, False: 579]
  |  Branch (269:28): [True: 121k, False: 286k]
  ------------------
  270|       |
  271|   121k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 98.4k, False: 23.5k]
  ------------------
  272|  98.4k|			term = kRDFTerm_li;
  273|  98.4k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 34, False: 23.4k]
  ------------------
  274|     34|			term = kRDFTerm_parseType;
  275|  23.4k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 7.67k, False: 15.8k]
  ------------------
  276|  7.67k|			term = kRDFTerm_Description;
  277|  15.8k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.56k, False: 14.2k]
  ------------------
  278|  1.56k|			term = kRDFTerm_about;
  279|  14.2k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 69, False: 14.1k]
  ------------------
  280|     69|			term = kRDFTerm_resource;
  281|  14.1k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 42, False: 14.1k]
  ------------------
  282|     42|			term = kRDFTerm_RDF;
  283|  14.1k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 40, False: 14.0k]
  ------------------
  284|     40|			term = kRDFTerm_ID;
  285|  14.0k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 384, False: 13.7k]
  ------------------
  286|    384|			term = kRDFTerm_nodeID;
  287|  13.7k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 85, False: 13.6k]
  ------------------
  288|     85|			term = kRDFTerm_datatype;
  289|  13.6k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 34, False: 13.5k]
  ------------------
  290|     34|			term = kRDFTerm_aboutEach;
  291|  13.5k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 18, False: 13.5k]
  ------------------
  292|     18|			term = kRDFTerm_aboutEachPrefix;
  293|  13.5k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 113, False: 13.4k]
  ------------------
  294|    113|			term = kRDFTerm_bagID;
  295|    113|		}
  296|       |
  297|   121k|	}
  298|       |
  299|   409k|	return term;
  300|       |
  301|   409k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  12.5k|{
  732|  12.5k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  12.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  12.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  38.3k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 26.8k, False: 11.4k]
  ------------------
  738|       |
  739|  26.8k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  26.8k|		switch ( attrTerm ) {
  742|       |
  743|     38|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 38, False: 26.7k]
  ------------------
  744|    112|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 74, False: 26.7k]
  ------------------
  745|  1.67k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.56k, False: 25.2k]
  ------------------
  746|       |
  747|  1.67k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     18|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 18, False: 1.66k]
  ------------------
  748|  1.66k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.66k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.66k, False: 0]
  |  Branch (750:24): [True: 1.54k, False: 112]
  ------------------
  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.54k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.54k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.54k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.54k, False: 6]
  ------------------
  755|  1.54k|						xmpParent->name = (*currAttr)->value;
  756|  1.54k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 6, False: 0]
  ------------------
  757|      6|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 5, False: 1]
  ------------------
  758|      1|					}
  759|  1.54k|				}
  760|       |
  761|  1.65k|				break;
  762|       |
  763|  24.8k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 24.8k, False: 1.99k]
  ------------------
  764|  24.8k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  24.8k|				break;
  766|       |
  767|    321|			default :
  ------------------
  |  Branch (767:4): [True: 321, False: 26.5k]
  ------------------
  768|    321|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|    321|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  26.8k|		}
  771|       |
  772|  26.8k|	}
  773|       |
  774|  12.5k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   186k|{
  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|   186k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 654, False: 185k]
  ------------------
  371|    654|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    654|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   185k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   185k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   185k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   185k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   185k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 29.6k, False: 155k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  29.6k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  29.6k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  29.6k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  29.6k|#define kXMP_CreateNodes	true
  ------------------
  384|  29.6k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  29.6k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  14.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 14.0k, False: 15.5k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  29.6k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  29.6k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 29.6k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  29.6k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   185k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 87.0k, False: 98.4k]
  ------------------
  398|  87.0k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  87.0k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 37, False: 86.9k]
  ------------------
  399|     37|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     37|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  87.0k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   185k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   185k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 185k, False: 87]
  |  Branch (406:26): [True: 18, False: 69]
  ------------------
  407|   185k|		 xmpParent->children.push_back ( newChild );
  408|   185k|	} else {
  409|     72|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     72|	}
  411|   185k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 87, False: 185k]
  ------------------
  412|     87|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     87|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 86, False: 1]
  |  Branch (412:22): [True: 1, False: 0]
  ------------------
  413|      0|		xmpParent->options |= kRDF_HasValueElem;
  414|      0|	}
  415|       |	
  416|   185k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 98.3k, False: 86.9k]
  ------------------
  417|  98.3k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 15, False: 98.3k]
  ------------------
  418|  98.3k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  98.3k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  98.3k|	}
  423|       |	
  424|   185k|	return newChild;
  425|       |
  426|   185k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  11.5k|{
  787|  11.5k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  11.5k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   346k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 335k, False: 11.2k]
  ------------------
  791|   335k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 230k, False: 104k]
  ------------------
  792|   104k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 274, False: 104k]
  ------------------
  793|    274|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    274|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|   104k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|   104k|	}
  797|       |
  798|  11.5k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|   104k|{
  854|   104k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|   104k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     48|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 48, False: 104k]
  ------------------
  856|       |	
  857|   104k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 4.14k, False: 99.9k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  4.14k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  99.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|  99.9k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  99.9k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  99.9k|		XMP_VarString * attrName = 0;
  870|       |
  871|   167k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 70.2k, False: 96.7k]
  ------------------
  872|  70.2k|			attrName = &((*currAttr)->name);
  873|  70.2k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 3.16k, False: 67.0k]
  |  Branch (873:38): [True: 3.16k, False: 1]
  ------------------
  874|  70.2k|		}
  875|       |
  876|  99.9k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 3.16k, False: 96.7k]
  ------------------
  877|       |
  878|  3.16k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  3.16k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  3.16k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  3.16k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 5, False: 3.16k]
  ------------------
  882|      5|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  3.16k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 3.15k, False: 4]
  ------------------
  884|  3.15k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  3.15k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 0, False: 4]
  ------------------
  886|      0|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|      4|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 1, False: 3]
  ------------------
  888|      1|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|      3|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 3]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|      3|			} else {
  892|      3|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|      3|			}
  894|       |
  895|  96.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|  96.7k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 64.9k, False: 31.8k]
  ------------------
  901|       |
  902|  64.9k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  64.9k|			} else {
  905|       |			
  906|  31.8k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  31.8k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  70.2k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 43.4k, False: 26.7k]
  ------------------
  910|  43.4k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 5.03k, False: 38.3k]
  ------------------
  911|  43.4k|				}
  912|       |				
  913|  31.8k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 26.7k, False: 5.03k]
  ------------------
  914|  26.7k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  26.7k|				} else {
  916|  5.03k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  5.03k|				}
  918|       |			
  919|  31.8k|			}
  920|       |
  921|  96.7k|		}
  922|       |		
  923|  99.9k|	}
  924|       |
  925|   104k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|   104k|{
  350|       |
  351|   104k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 10, False: 104k]
  |  Branch (351:42): [True: 0, False: 104k]
  ------------------
  352|   104k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|   104k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|   104k|{
  334|       |
  335|   104k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 104k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|   104k|	return false;
  337|       |
  338|   104k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|   104k|{
  317|       |
  318|   104k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 98.4k, False: 5.70k]
  |  Branch (318:40): [True: 38, False: 98.4k]
  ------------------
  319|   104k|	return false;
  320|       |
  321|   104k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  72.2k|{
 1190|  72.2k|	bool hasPropertyAttrs = false;
 1191|  72.2k|	bool hasResourceAttr  = false;
 1192|  72.2k|	bool hasNodeIDAttr    = false;
 1193|  72.2k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  72.2k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  72.2k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      9|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 9, False: 72.2k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  72.2k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  72.2k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   205k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 133k, False: 72.2k]
  ------------------
 1205|       |
 1206|   133k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|   133k|		switch ( attrTerm ) {
 1209|       |
 1210|      1|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 1, False: 133k]
  ------------------
 1211|       |				// Nothing to do.
 1212|      1|				break;
 1213|       |
 1214|     33|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 33, False: 133k]
  ------------------
 1215|     33|				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: 33]
  ------------------
 1216|     33|				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: 33]
  ------------------
 1217|     33|				hasResourceAttr = true;
 1218|     33|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 33, False: 0]
  ------------------
 1219|     33|				break;
 1220|       |
 1221|    155|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 155, False: 133k]
  ------------------
 1222|    155|				if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1222:10): [True: 0, False: 155]
  ------------------
 1223|    155|				hasNodeIDAttr = true;
 1224|    155|				break;
 1225|       |
 1226|   133k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 133k, False: 190]
  ------------------
 1227|   133k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 1.36k, False: 131k]
  ------------------
 1228|  1.36k|					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: 1.36k]
  ------------------
 1229|  1.36k|					hasValueAttr = true;
 1230|  1.36k|					valueNode = *currAttr;
 1231|   131k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 65.9k, False: 65.7k]
  ------------------
 1232|  65.9k|					hasPropertyAttrs = true;
 1233|  65.9k|				}
 1234|   133k|				break;
 1235|       |
 1236|   133k|			default :
  ------------------
  |  Branch (1236:4): [True: 1, False: 133k]
  ------------------
 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|   133k|		}
 1241|       |
 1242|   133k|	}
 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|  72.2k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  72.2k|	bool childIsStruct = false;
 1250|       |	
 1251|  72.2k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 1.39k, False: 70.8k]
  ------------------
 1252|  1.39k|		childNode->value = valueNode->value;
 1253|  1.39k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 30, False: 1.36k]
  ------------------
 1254|  70.8k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 5.75k, False: 65.1k]
  ------------------
 1255|  5.75k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  5.75k|		childIsStruct = true;
 1257|  5.75k|	}
 1258|       |		
 1259|  72.2k|	currAttr = xmlNode.attrs.begin();
 1260|  72.2k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   205k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 133k, False: 72.2k]
  ------------------
 1263|       |
 1264|   133k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 1.39k, False: 131k]
  ------------------
 1265|   131k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|   131k|		switch ( attrTerm ) {
 1268|       |
 1269|      1|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 1, False: 131k]
  ------------------
 1270|    156|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 155, False: 131k]
  ------------------
 1271|    156|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 131k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|   131k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 131k, False: 156]
  ------------------
 1278|   131k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 73.6k, False: 57.9k]
  |  Branch (1278:31): [True: 694, False: 57.2k]
  ------------------
 1279|  74.3k|					AddQualifierNode ( childNode, **currAttr );
 1280|  74.3k|				} else {
 1281|  57.2k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  57.2k|				}
 1283|   131k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 131k]
  ------------------
 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|   131k|		}
 1290|       |
 1291|   131k|	}
 1292|       |
 1293|  72.2k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  76.1k|{
  484|  76.1k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 4, False: 76.1k]
  ------------------
  485|      4|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      4|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  76.1k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  76.1k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  76.2k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  76.2k|	const bool isLang = (name == "xml:lang");
  443|  76.2k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  76.2k|	XMP_Node * newQual = 0;
  446|       |
  447|  76.2k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  76.2k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 8.66k, False: 67.5k]
  ------------------
  450|  8.66k|			xmpParent->qualifiers.push_back ( newQual );
  451|  67.5k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 67.4k, False: 136]
  ------------------
  452|  67.4k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 67.4k, False: 1]
  ------------------
  453|  67.4k|				xmpParent->qualifiers.push_back ( newQual );
  454|  67.4k|			} else {
  455|      1|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|      1|			}
  457|  67.4k|			xmpParent->options |= kXMP_PropHasLang;
  458|  67.4k|		} else {
  459|    136|			XMP_Assert ( isType );
  ------------------
  |  |  142|    136|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    136|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 133, False: 3]
  ------------------
  461|    133|				xmpParent->qualifiers.push_back ( newQual );
  462|    133|			} else {
  463|      3|				size_t offset = 0;
  464|      3|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 2, False: 1]
  ------------------
  465|      3|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|      3|			}
  467|    136|			xmpParent->options |= kXMP_PropHasType;
  468|    136|		}
  469|       |
  470|  76.2k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  76.2k|	return newQual;
  473|       |
  474|  76.2k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  26.7k|{
 1015|  26.7k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  26.7k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  26.7k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  28.5k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 1.73k, False: 26.7k]
  ------------------
 1021|  1.73k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  1.73k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 1.72k, False: 9]
  ------------------
 1023|  1.72k|			AddQualifierNode ( newChild, **currAttr );
 1024|  1.72k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 0, False: 9]
  |  Branch (1024:41): [True: 5, False: 4]
  ------------------
 1025|      5|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|      5|		} 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|  1.73k|	}
 1030|       |	
 1031|  26.7k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  26.7k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  26.7k|	size_t      textSize  = 0;
 1034|       |
 1035|  54.5k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 27.8k, False: 26.7k]
  ------------------
 1036|  27.8k|		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: 27.8k]
  ------------------
 1037|  27.8k|		textSize += (*currChild)->value.size();
 1038|  27.8k|	}
 1039|       |	
 1040|  26.7k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  54.5k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 27.8k, False: 26.7k]
  ------------------
 1043|  27.8k|		newChild->value += (*currChild)->value;
 1044|  27.8k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  26.7k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|      1|{
 1087|       |
 1088|      1|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|      1|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|      1|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|      1|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|      2|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 1, False: 1]
  ------------------
 1095|      1|		XMP_VarString & attrName = (*currAttr)->name;
 1096|      1|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 1, False: 0]
  ------------------
 1097|      1|			continue;	// ! The caller ensured the value is "Resource".
 1098|      1|		} 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|      1|	}
 1106|       |
 1107|      1|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|      1|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 1]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|      1|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|      3|{
 1147|      3|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      3|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      3|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      3|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|      3|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  5.03k|{
  943|  5.03k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 5.01k, False: 22]
  |  Branch (943:21): [True: 0, False: 5.01k]
  ------------------
  944|       |	
  945|  5.03k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  5.03k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  5.03k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  5.04k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 4, False: 5.03k]
  ------------------
  951|      4|		XMP_VarString & attrName = (*currAttr)->name;
  952|      4|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 4, False: 0]
  ------------------
  953|      4|			AddQualifierNode ( newCompound, **currAttr );
  954|      4|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 0, False: 0]
  ------------------
  955|      0|			continue;	// Ignore all rdf:ID attributes.
  956|      0|		} 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|      4|	}
  960|       |	
  961|  5.03k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  5.03k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  15.2k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 15.2k, False: 37]
  ------------------
  965|  15.2k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 5.00k, False: 10.2k]
  ------------------
  966|  15.2k|	}
  967|  5.03k|	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: 5.03k]
  ------------------
  968|  5.03k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     64|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 64, False: 4.97k]
  ------------------
  969|       |
  970|  4.97k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 352, False: 4.62k]
  ------------------
  971|    352|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.62k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 3.18k, False: 1.43k]
  ------------------
  973|  3.18k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  3.18k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.24k, False: 193]
  ------------------
  975|  1.24k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.24k|	} else {
  977|    193|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    193|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 135, False: 58]
  ------------------
  979|    135|			XMP_VarString typeName ( (*currChild)->ns );
  980|    135|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    135|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 1, False: 134]
  ------------------
  982|    134|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    134|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    134|		}
  985|    193|	}
  986|       |
  987|  4.97k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.97k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 4.97k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  4.97k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.21k, False: 3.75k]
  ------------------
  991|  1.21k|		DetectAltText ( newCompound );
  992|  1.21k|	}
  993|       |
  994|  14.6k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 9.75k, False: 4.93k]
  ------------------
  995|  9.75k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     42|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 42, False: 9.71k]
  ------------------
  996|  9.71k|	}
  997|       |
  998|  4.97k|}	// 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|  3.59k|{
  568|  3.59k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  3.59k|	size_t unitCount = 0;
  570|       |
  571|  3.59k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  3.59k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 3.59k]
  ------------------
  573|  3.59k|	inUnit = *utf8In;
  574|  3.59k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 3.59k, 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|  3.59k|MultiByte:
  584|  3.59k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  3.59k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  3.59k|{
  517|  3.59k|	UTF8Unit  inUnit = *utf8In;
  518|  3.59k|	size_t    unitCount = 0;
  519|  3.59k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  3.59k|	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|  3.59k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  11.2k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 7.70k, False: 3.59k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  3.59k|	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: 3.59k]
  |  Branch (538:28): [True: 0, False: 3.59k]
  ------------------
  539|  3.59k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 3.59k]
  ------------------
  540|  3.59k|	unitCount = bytesNeeded;
  541|       |	
  542|  3.59k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  3.59k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  7.70k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 4.10k, False: 3.59k]
  ------------------
  546|  4.10k|		inUnit = *utf8Pos;
  547|  4.10k|		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: 4.10k]
  ------------------
  548|  4.10k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  4.10k|	}
  550|       |	
  551|  3.59k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 0, False: 3.59k]
  ------------------
  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|  3.59k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  3.59k|Done:	
  559|  3.59k|	*utf8Read = unitCount;
  560|  3.59k|	return;
  561|       |	
  562|  3.59k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   817k|{
   88|       |
   89|   817k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   817k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   817k|	const XMP_Uns8 * namePos   = nameStart;
   92|   817k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   817k|	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: 817k]
  ------------------
   97|       |
   98|   817k|	cp = *namePos;
   99|   817k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 817k, False: 336]
  ------------------
  100|   817k|		++namePos;
  101|   817k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 817k]
  ------------------
  102|   817k|	} else {
  103|    336|		cp = GetCodePoint ( &namePos );
  104|    336|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 336]
  ------------------
  105|    336|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  28.0M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 27.2M, False: 817k]
  ------------------
  110|  27.2M|		cp = *namePos;
  111|  27.2M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 27.2M, False: 1.23k]
  ------------------
  112|  27.2M|			++namePos;
  113|  27.2M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 186k, False: 27.0M]
  |  Branch (113:38): [True: 0, False: 186k]
  ------------------
  114|  27.2M|		} else {
  115|  1.23k|			cp = GetCodePoint ( &namePos );
  116|  1.23k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 317, False: 916]
  |  Branch (116:41): [True: 0, False: 317]
  ------------------
  117|  1.23k|		}
  118|  27.2M|	}
  119|       |
  120|   817k|	return;
  121|       |
  122|   817k|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|  28.0M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  28.0M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 27.3M, False: 692k]
  |  Branch (33:23): [True: 27.3M, False: 0]
  |  Branch (33:40): [True: 505k, False: 186k]
  |  Branch (33:55): [True: 501k, False: 4.52k]
  |  Branch (33:71): [True: 4.52k, False: 186k]
  ------------------
   34|   186k|	return false;
   35|  28.0M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  1.56k|{
   20|  1.56k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  1.56k|	XMP_Uns32 cp;
   22|  1.56k|	size_t u8Len;
   23|  1.56k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  1.56k|	*utf8Str_io = u8Ptr + u8Len;
   25|  1.56k|	return cp;
   26|  1.56k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  1.56k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  1.56k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 1.39k, False: 172]
  |  Branch (43:24): [True: 218, False: 1.17k]
  |  Branch (43:43): [True: 1.17k, False: 172]
  |  Branch (43:59): [True: 195, False: 984]
  ------------------
   44|  1.15k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 984, False: 172]
  |  Branch (44:24): [True: 535, False: 449]
  |  Branch (44:43): [True: 304, False: 317]
  |  Branch (44:60): [True: 0, False: 304]
  ------------------
   45|       |
   46|    621|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 304, False: 317]
  |  Branch (46:25): [True: 204, False: 100]
  |  Branch (46:46): [True: 100, False: 317]
  |  Branch (46:64): [True: 0, False: 100]
  ------------------
   47|    417|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 100, False: 317]
  |  Branch (47:26): [True: 0, False: 100]
  |  Branch (47:46): [True: 100, False: 317]
  |  Branch (47:64): [True: 0, False: 100]
  ------------------
   48|    417|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 100, False: 317]
  |  Branch (48:26): [True: 100, False: 0]
  |  Branch (48:46): [True: 0, False: 317]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    317|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 317]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 317]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    317|	return false;
   52|       |
   53|    317|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   186k|{
   59|       |	// ASCII following characters for an XML name.
   60|   186k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 96.4k, False: 90.3k]
  |  Branch (60:23): [True: 96.4k, False: 0]
  |  Branch (60:39): [True: 71.7k, False: 18.5k]
  |  Branch (60:54): [True: 18.5k, False: 0]
  ------------------
   61|      0|	return false;
   62|   186k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    317|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    317|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 172, False: 145]
  |  Branch (69:24): [True: 145, False: 0]
  |  Branch (69:41): [True: 145, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    317|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  39.1k|{
   88|       |
   89|  39.1k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  39.1k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  39.1k|	const XMP_Uns8 * namePos   = nameStart;
   92|  39.1k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  39.1k|	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: 39.1k]
  ------------------
   97|       |
   98|  39.1k|	cp = *namePos;
   99|  39.1k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 39.0k, False: 96]
  ------------------
  100|  39.0k|		++namePos;
  101|  39.0k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 39.0k]
  ------------------
  102|  39.0k|	} else {
  103|     96|		cp = GetCodePoint ( &namePos );
  104|     96|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 96]
  ------------------
  105|     96|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  11.4M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 11.3M, False: 39.1k]
  ------------------
  110|  11.3M|		cp = *namePos;
  111|  11.3M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 11.3M, False: 1.93k]
  ------------------
  112|  11.3M|			++namePos;
  113|  11.3M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 12.7k, False: 11.3M]
  |  Branch (113:38): [True: 0, False: 12.7k]
  ------------------
  114|  11.3M|		} else {
  115|  1.93k|			cp = GetCodePoint ( &namePos );
  116|  1.93k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 1.00k, False: 930]
  |  Branch (116:41): [True: 0, False: 1.00k]
  ------------------
  117|  1.93k|		}
  118|  11.3M|	}
  119|       |
  120|  39.1k|	return;
  121|       |
  122|  39.1k|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|  11.4M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  11.4M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 11.3M, False: 59.2k]
  |  Branch (33:23): [True: 11.3M, False: 0]
  |  Branch (33:40): [True: 46.4k, False: 12.7k]
  |  Branch (33:55): [True: 44.5k, False: 1.93k]
  |  Branch (33:71): [True: 1.93k, False: 12.7k]
  ------------------
   34|  12.7k|	return false;
   35|  11.4M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  2.02k|{
   20|  2.02k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  2.02k|	XMP_Uns32 cp;
   22|  2.02k|	size_t u8Len;
   23|  2.02k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  2.02k|	*utf8Str_io = u8Ptr + u8Len;
   25|  2.02k|	return cp;
   26|  2.02k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  2.02k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  2.02k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 1.19k, False: 833]
  |  Branch (43:24): [True: 176, False: 1.01k]
  |  Branch (43:43): [True: 1.01k, False: 833]
  |  Branch (43:59): [True: 71, False: 946]
  ------------------
   44|  1.77k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 946, False: 833]
  |  Branch (44:24): [True: 270, False: 676]
  |  Branch (44:43): [True: 509, False: 1.00k]
  |  Branch (44:60): [True: 0, False: 509]
  ------------------
   45|       |
   46|  1.50k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 509, False: 1.00k]
  |  Branch (46:25): [True: 394, False: 115]
  |  Branch (46:46): [True: 115, False: 1.00k]
  |  Branch (46:64): [True: 0, False: 115]
  ------------------
   47|  1.11k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 115, False: 1.00k]
  |  Branch (47:26): [True: 0, False: 115]
  |  Branch (47:46): [True: 115, False: 1.00k]
  |  Branch (47:64): [True: 0, False: 115]
  ------------------
   48|  1.11k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 115, False: 1.00k]
  |  Branch (48:26): [True: 115, False: 0]
  |  Branch (48:46): [True: 0, False: 1.00k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  1.00k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 1.00k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 1.00k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  1.00k|	return false;
   52|       |
   53|  1.00k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  12.7k|{
   59|       |	// ASCII following characters for an XML name.
   60|  12.7k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 5.92k, False: 6.80k]
  |  Branch (60:23): [True: 5.92k, False: 0]
  |  Branch (60:39): [True: 4.38k, False: 2.42k]
  |  Branch (60:54): [True: 2.42k, False: 0]
  ------------------
   61|      0|	return false;
   62|  12.7k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  1.00k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  1.00k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 833, False: 167]
  |  Branch (69:24): [True: 167, False: 0]
  |  Branch (69:41): [True: 167, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  1.00k|}

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

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

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

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

_ZN13XMP_AutoMutexC2Ev:
  222|   388k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   388k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   388k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|  74.0k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 74.0k, False: 314k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   314k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   566k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   369k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|  26.0k|		: options(_options), name(_name), parent(_parent)
  435|  26.0k|	{
  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.0k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   187k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   187k|	{
  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|   187k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  76.2k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  76.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|  76.2k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   303k|	{
  479|   503k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 200k, False: 303k]
  ------------------
  480|   200k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 200k, False: 0]
  ------------------
  481|   200k|		}
  482|   303k|		children.clear();
  483|   303k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   303k|	{
  487|   381k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 78.4k, False: 303k]
  ------------------
  488|  78.4k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 78.4k, False: 0]
  ------------------
  489|  78.4k|		}
  490|   303k|		qualifiers.clear();
  491|   303k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  12.9k|	{
  495|  12.9k|		options = 0;
  496|  12.9k|		name.erase();
  497|  12.9k|		value.erase();
  498|  12.9k|		this->RemoveChildren();
  499|  12.9k|		this->RemoveQualifiers();
  500|  12.9k|	}
_ZN8XMP_NodeD2Ev:
  502|   289k|	virtual ~XMP_Node() { RemoveChildren(); RemoveQualifiers(); };

_ZN11XMPIterator10InitializeEv:
  376|      1|{
  377|      1|	sDummySchema = new XMP_Node ( 0, "dummy:schema/", kXMP_SchemaNode);
  378|      1|	return true;
  379|       |	
  380|      1|}	// Initialize
_ZN11XMPIterator9TerminateEv:
  388|      1|{
  389|      1|	delete ( sDummySchema );
  390|      1|	sDummySchema = 0;
  391|      1|	return;
  392|       |	
  393|      1|}	// Terminate
_ZN11XMPIteratorC2ERK7XMPMetaPKcS4_j:
  427|  12.5k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  12.5k|{
  429|  12.5k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 12.5k]
  ------------------
  430|      0|		XMP_Throw ( "Unsupported iteration kind", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  431|      0|	}
  432|       |	
  433|       |	// *** Lock the XMPMeta object if we ever stop using a full DLL lock.
  434|       |
  435|  12.5k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 3.91k, False: 8.59k]
  ------------------
  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.91k|		XMP_ExpandedXPath propPath;
  445|  3.91k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  3.91k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  3.91k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.91k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  3.91k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 3.91k, False: 0]
  ------------------
  449|       |
  450|  3.91k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  3.91k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 0, False: 3.91k]
  ------------------
  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.91k|			propName = rootName.c_str();
  458|  3.91k|			size_t leafOffset = rootName.size();
  459|  68.7k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 64.7k, False: 3.91k]
  |  Branch (459:32): [True: 64.7k, False: 0]
  |  Branch (459:65): [True: 64.7k, False: 0]
  ------------------
  460|  3.91k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 0, False: 3.91k]
  ------------------
  461|       |
  462|  3.91k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  3.91k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  3.91k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 3.91k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  3.91k|		}
  469|       |	
  470|  8.59k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 8.59k]
  ------------------
  471|       |
  472|       |		// An iterator for all properties in one schema.
  473|       |		
  474|       |		#if TraceIterators
  475|       |			printf ( "\nNew XMP schema iterator for \"%s\", options = %X\n    Schema = %s\n",
  476|       |			         xmpObj.tree.name.c_str(), options, schemaNS );
  477|       |		#endif
  478|       |		
  479|      0|		info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaNS, 0 ) );
  480|      0|		IterNode & iterSchema = info.tree.children.back();
  481|       |		
  482|      0|		XMP_Node * xmpSchema = FindConstSchema ( &xmpObj.tree, schemaNS );
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  483|      0|		if ( xmpSchema != 0 ) AddSchemaProps ( info, iterSchema, xmpSchema );
  ------------------
  |  Branch (483:8): [True: 0, False: 0]
  ------------------
  484|       |		
  485|      0|		if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, schemaNS );
  ------------------
  |  Branch (485:8): [True: 0, False: 0]
  ------------------
  486|       |		
  487|      0|		if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (487:8): [True: 0, False: 0]
  ------------------
  488|      0|			info.tree.children.pop_back();	// No properties, remove the schema node.
  489|      0|		} else {
  490|      0|			SetCurrSchema ( info, schemaNS );
  491|      0|		}
  492|       |	
  493|  8.59k|	} 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|  20.8k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 12.2k, False: 8.59k]
  ------------------
  507|       |
  508|  12.2k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  12.2k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  12.2k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  12.2k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 12.2k, False: 0]
  ------------------
  513|  12.2k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  12.2k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 12.2k]
  ------------------
  515|  12.2k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 12.2k]
  ------------------
  516|  12.2k|			}
  517|       |
  518|  12.2k|		}
  519|       |		
  520|  8.59k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 8.59k]
  ------------------
  521|       |
  522|       |			// Add the schema that only have aliases. The most convenient, and safest way, is to go
  523|       |			// through the registered namespaces, see if it exists, and let AddSchemaAliases do its
  524|       |			// thing if not. Don't combine with the above loop, it is nicer to have the "real" stuff
  525|       |			// be in storage order (not subject to the namespace map order).
  526|       |			
  527|       |			// ! We don't do the kXMP_IterJustChildren handing in the same way here as above. The
  528|       |			// ! existing schema (presumably) have actual children. We need to call AddSchemaAliases
  529|       |			// ! here to determine if the namespace has any aliases to existing properties. We then
  530|       |			// ! strip the children if necessary.
  531|       |
  532|      0|			XMP_cStringMapPos currNS = sNamespaceURIToPrefixMap->begin();
  533|      0|			XMP_cStringMapPos endNS  = sNamespaceURIToPrefixMap->end();
  534|      0|			for ( ; currNS != endNS; ++currNS ) {
  ------------------
  |  Branch (534:12): [True: 0, False: 0]
  ------------------
  535|      0|				XMP_StringPtr schemaName = currNS->first.c_str();
  536|      0|				if ( FindConstSchema ( &xmpObj.tree, schemaName ) != 0 ) continue;
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  |  Branch (536:10): [True: 0, False: 0]
  ------------------
  537|      0|				info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaName, 0 ) );
  538|      0|				IterNode & iterSchema = info.tree.children.back();
  539|      0|				AddSchemaAliases ( info, iterSchema, schemaName );
  540|      0|				if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (540:10): [True: 0, False: 0]
  ------------------
  541|      0|					info.tree.children.pop_back();	// No aliases, remove the schema node.
  542|      0|				} else if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|					iterSchema.children.clear();	// Get rid of the children.
  544|      0|				}
  545|      0|			}
  546|       |
  547|      0|		}
  548|       |
  549|  8.59k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  12.5k|	info.currPos = info.tree.children.begin();
  554|  12.5k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  12.5k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 12.5k]
  |  Branch (556:49): [True: 0, False: 0]
  |  Branch (556:82): [True: 0, False: 0]
  ------------------
  557|      0|		info.currPos->visitStage = kIter_VisitSelf;
  558|      0|	}
  559|       |
  560|       |	#if TraceIterators
  561|       |		if ( info.currPos == info.endPos ) {
  562|       |			printf ( "    ** Empty iteration **\n" );
  563|       |		} else {
  564|       |			printf ( "    Initial node %s, stage = %s, iterator @ %.8X\n",
  565|       |			         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage], this );
  566|       |		}
  567|       |	#endif
  568|       |	
  569|  12.5k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  12.5k|{
  592|  12.5k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  12.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  12.5k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   298k|{
  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|   298k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 3.00k, False: 295k]
  ------------------
  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|   295k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   295k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 9.08k, False: 286k]
  ------------------
  632|   286k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   286k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 286k]
  ------------------
  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|   286k|	*schemaNS = info.currSchema.c_str();
  644|   286k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   286k|	*propOptions = info.currPos->options;
  647|       |
  648|   286k|	*propPath  = "";
  649|   286k|	*pathSize  = 0;
  650|   286k|	*propValue = "";
  651|   286k|	*valueSize = 0;
  652|       |	
  653|   286k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 274k, False: 12.1k]
  ------------------
  654|       |
  655|   274k|		*propPath = info.currPos->fullPath.c_str();
  656|   274k|		*pathSize = info.currPos->fullPath.size();
  657|   274k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 274k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   274k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 260k, False: 14.3k]
  ------------------
  663|   260k|			*propValue = xmpNode->value.c_str();
  664|   260k|			*valueSize = xmpNode->value.size();
  665|   260k|		}
  666|       |
  667|   274k|	}
  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|   286k|	return true;
  675|       |
  676|   286k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   286k|{
  730|   286k|	UNUSED(options);
  731|       |
  732|   286k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   286k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  3.91k|{
  182|       |
  183|  3.91k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  3.91k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   274k|{
  115|   274k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   274k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   274k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 69.4k, False: 204k]
  |  Branch (118:44): [True: 69.4k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  69.4k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  69.4k|		leafOffset += 2;
  126|       |		
  127|   145k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 76.5k, False: 69.4k]
  ------------------
  128|  76.5k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  76.5k|			currPath += xmpQual->name;
  130|  76.5k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  76.5k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  76.5k|		}
  136|       |		
  137|  69.4k|		leafOffset -= 2;
  138|  69.4k|		currPath.erase ( leafOffset );
  139|       |
  140|  69.4k|	}
  141|       |
  142|   274k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 14.2k, False: 260k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  14.2k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  14.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  14.2k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 5.39k, False: 8.85k]
  ------------------
  151|  5.39k|			currPath += '/';
  152|  5.39k|			leafOffset += 1;
  153|  5.39k|		}
  154|       |		
  155|   230k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 215k, False: 14.2k]
  ------------------
  156|   215k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   215k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 50.0k, False: 165k]
  ------------------
  158|  50.0k|				currPath += xmpChild->name;
  159|   165k|			} else {
  160|   165k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|   165k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|   165k|				currPath += buffer;
  163|   165k|			}
  164|   215k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   215k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   215k|		}
  170|       |	
  171|  14.2k|	}
  172|       |
  173|   274k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  12.2k|{
   49|  12.2k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  38.4k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 26.1k, False: 12.2k]
  ------------------
   55|  26.1k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  26.1k|		iterSchema.children.push_back ( IterNode ( xmpProp->options, xmpProp->name, 0 ) );
   58|       |		#if TraceIterators
   59|       |			printf ( "        %s\n", xmpProp->name.c_str() );
   60|       |		#endif
   61|  26.1k|	}
   62|       |
   63|  12.2k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   295k|{
  309|   295k|	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|   295k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 286k, False: 9.50k]
  ------------------
  323|       |	
  324|   295k|	bool isSchemaNode = false;
  325|   295k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   295k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 286k, False: 9.10k]
  ------------------
  328|       |
  329|   286k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   286k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 12.1k, False: 274k]
  ------------------
  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|   274k|		} else {
  335|   274k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   274k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   274k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   274k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   274k|		}
  338|   286k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 286k, False: 20]
  ------------------
  339|       |
  340|     20|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|     20|		info.currPos->children.clear();
  342|     20|		info.currPos->qualifiers.clear();
  343|     20|		AdvanceIterPos ( info );
  344|       |
  345|     20|	}
  346|       |
  347|   295k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 9.08k, False: 286k]
  ------------------
  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|   286k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   286k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   286k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 286k, False: 20]
  ------------------
  356|   286k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 274k, False: 12.1k]
  |  Branch (356:28): [True: 274k, False: 0]
  ------------------
  357|   274k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   274k|		}
  359|   286k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   286k|	}
  361|       |	
  362|   286k|	return xmpNode;
  363|       |
  364|   295k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  18.6k|{
  193|       |
  194|  18.6k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  18.6k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   286k|{
  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|   666k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 666k, Folded]
  ------------------
  221|       |	
  222|   666k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 104k, False: 562k]
  ------------------
  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|   104k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 9.08k, False: 95.0k]
  ------------------
  230|       |
  231|  95.0k|			IterPosPair & parent = info.ancestors.back();
  232|  95.0k|			info.currPos = parent.first;
  233|  95.0k|			info.endPos  = parent.second;
  234|  95.0k|			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|   562k|		} 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|   562k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 181k, False: 381k]
  ------------------
  253|   181k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 6.55k, False: 174k]
  ------------------
  254|   181k|				break;
  255|   181k|			}
  256|       |
  257|   381k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 286k, False: 95.0k]
  ------------------
  258|   286k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   286k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 69.3k, False: 216k]
  ------------------
  260|  69.3k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  69.3k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  69.3k|					info.currPos = info.currPos->qualifiers.begin();
  263|  69.3k|					break;
  264|  69.3k|				}
  265|   286k|			}
  266|       |
  267|   311k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 286k, False: 25.7k]
  ------------------
  268|   286k|				info.currPos->qualifiers.clear();
  269|   286k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   286k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 26.1k, False: 259k]
  ------------------
  271|  26.1k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  26.1k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  26.1k|					info.currPos = info.currPos->children.begin();
  274|  26.1k|					break;
  275|  26.1k|				}
  276|   286k|			}
  277|       |
  278|   285k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 285k, False: 0]
  ------------------
  279|   285k|				info.currPos->children.clear();
  280|   285k|				++info.currPos;											// Move to the next sibling.
  281|   285k|				continue;
  282|   285k|			}
  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|   285k|		}
  292|       |
  293|   666k|	}	// Loop to find the next node.
  294|       |	
  295|   286k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   286k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   286k|}	// AdvanceIterPos

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  10.7k|{
 1097|  10.7k|	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.7k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  10.7k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 10.7k]
  ------------------
 1099|       |	
 1100|  10.7k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  10.7k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  10.7k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 10.7k, False: 0]
  ------------------
 1105|  10.7k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 10.7k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  10.7k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  10.7k|	}
 1108|       |	
 1109|  10.7k|	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.7k|	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.7k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 10.7k, False: 0]
  ------------------
 1127|       |
 1128|  10.7k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 10.7k, False: 0]
  |  Branch (1128:39): [True: 10.7k, False: 24]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  10.7k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  10.7k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     24|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     24|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 24, False: 0]
  ------------------
 1139|       |
 1140|     24|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     24|				buffer += pendingOverlap;
 1142|     24|				xmpSize -= pendingOverlap;
 1143|     24|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     24|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 24]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     24|				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|     24|			}
 1153|       |
 1154|  10.7k|		}
 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.7k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  10.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  10.7k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 10.7k]
  ------------------
 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.7k|		} 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.7k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 24, False: 10.7k]
  ------------------
 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|     24|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     24|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 24, False: 0]
  ------------------
 1190|       |				
 1191|     24|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     24|				parser.pendingCount += pendingOverlap;
 1193|     24|				buffer += pendingOverlap;
 1194|     24|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     24|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 24]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     24|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     24|				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|     24|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 24, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     24|					parser.pendingCount = 0;
 1208|       |
 1209|     24|				} 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|     24|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  10.7k|			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.7k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 10.7k]
  ------------------
 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.7k|		}
 1258|       |		
 1259|  10.7k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 10.7k, False: 24]
  ------------------
 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.7k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  10.7k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 8.08k, False: 2.64k]
  ------------------
 1269|       |
 1270|  8.08k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  8.08k|				NormalizeDCArrays ( &this->tree );
 1272|  8.08k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 8.08k]
  ------------------
 1273|  8.08k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  8.08k|				size_t schemaNum = 0;
 1277|  20.3k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 12.2k, False: 8.08k]
  ------------------
 1278|  12.2k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  12.2k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 12.2k, False: 0]
  ------------------
 1280|  12.2k|						++schemaNum;
 1281|  12.2k|					} 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.2k|				}
 1286|       |				
 1287|  8.08k|			}
 1288|       |
 1289|  10.7k|			delete this->xmlParser;
 1290|  10.7k|			this->xmlParser = 0;
 1291|       |
 1292|  10.7k|		}
 1293|       |		
 1294|  10.7k|	} catch ( ... ) {
 1295|       |
 1296|  2.15k|		delete this->xmlParser;
 1297|  2.15k|		this->xmlParser = 0;
 1298|  2.15k|		prevTkVer = 0;
 1299|  2.15k|		this->tree.ClearNode();
 1300|  2.15k|		throw;
 1301|       |
 1302|  2.15k|	}
 1303|       |	
 1304|  10.7k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  10.7k|{
  811|  10.7k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 10.7k]
  ------------------
  812|       |	
  813|  10.7k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  10.7k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 10.7k]
  ------------------
  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.7k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 10.7k, 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.7k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 10.7k, 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.7k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  10.7k|{
  977|  10.7k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  10.7k|	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.7k|	std::string copy;
  992|       |		
  993|  76.8M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 76.8M, False: 10.7k]
  ------------------
  994|       |
  995|  76.8M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 76.4M, False: 360k]
  |  Branch (995:30): [True: 76.1M, False: 381k]
  |  Branch (995:52): [True: 74.2M, False: 1.90M]
  ------------------
  996|  74.2M|			copy.push_back(*spanEnd);
  997|  74.2M|			continue;	// A regular ASCII character.
  998|  74.2M|		}
  999|       |
 1000|  2.64M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 8.18k, False: 2.63M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  8.18k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  8.18k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 8.18k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  8.18k|				copy.append((const char*)spanEnd, uniLen);
 1010|  8.18k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  8.18k|			} 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|  2.63M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 360k, False: 2.27M]
  |  Branch (1026:36): [True: 373k, False: 1.90M]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   734k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   734k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   730k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   407k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 3.99k, False: 730k]
  |  Branch (1030:31): [True: 322k, False: 407k]
  |  Branch (1030:52): [True: 33.9k, False: 373k]
  ------------------
 1031|   360k|				copy.push_back(*spanEnd);
 1032|   360k|				continue;
 1033|   360k|			}
 1034|       |
 1035|   373k|			copy.push_back(' ');
 1036|       |		
 1037|  1.90M|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|  1.90M|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|  1.90M|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|  1.90M|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|  1.90M|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 99, False: 1.90M]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     99|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 99, False: 0]
  ------------------
 1048|     99|					copy.push_back('&');
 1049|     99|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     99|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|  1.90M|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 69.8k, False: 1.83M]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  69.8k|				copy.push_back(' ');
 1058|  69.8k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|  1.83M|			} else {
 1061|  1.83M|				copy.push_back('&');
 1062|  1.83M|			}
 1063|       |
 1064|  1.90M|		}
 1065|       |		
 1066|  2.64M|	}
 1067|       |	
 1068|  10.7k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  10.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  10.7k|	copy.push_back(' ');
 1070|  10.7k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  10.7k|	return length;
 1072|       |
 1073|  10.7k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  8.18k|{
  868|  8.18k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  8.18k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  8.18k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 8.18k]
  ------------------
  870|  8.18k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 8.18k]
  ------------------
  871|       |	
  872|  8.18k|	int byteCount = 2;
  873|  8.18k|	XMP_Uns8 firstByte = *charStart;
  874|  12.8k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 4.62k, False: 8.18k]
  ------------------
  875|       |	
  876|  8.18k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 8.18k]
  ------------------
  877|       |
  878|  20.9k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 12.8k, False: 8.18k]
  ------------------
  879|  12.8k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 12.8k]
  ------------------
  880|  12.8k|	}
  881|       |	
  882|  8.18k|	return byteCount;
  883|       |	
  884|  8.18k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|  1.90M|{
  898|  1.90M|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|  1.90M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|  1.90M|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 1.90M]
  ------------------
  900|  1.90M|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|  1.90M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|  1.90M|	size_t tailLen = bufEnd - escStart;
  903|  1.90M|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 99, False: 1.90M]
  ------------------
  904|       |	
  905|  1.90M|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 1.40M, False: 499k]
  ------------------
  906|       |	
  907|   499k|	XMP_Uns8 escValue = 0;
  908|   499k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   499k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 461k, False: 38.4k]
  |  Branch (910:27): [True: 1.49k, False: 460k]
  ------------------
  911|  1.49k|		escValue = *escPos - '0';
  912|  1.49k|		++escPos;
  913|   498k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 447k, False: 50.8k]
  |  Branch (913:34): [True: 2.36k, False: 445k]
  ------------------
  914|  2.36k|		escValue = *escPos - 'A' + 10;
  915|  2.36k|		++escPos;
  916|   496k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 436k, False: 59.3k]
  |  Branch (916:34): [True: 328k, False: 108k]
  ------------------
  917|   328k|		escValue = *escPos - 'a' + 10;
  918|   328k|		++escPos;
  919|   328k|	}
  920|       |	
  921|   499k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 381k, False: 118k]
  |  Branch (921:27): [True: 330, False: 381k]
  ------------------
  922|    330|		escValue = (escValue << 4) + (*escPos - '0');
  923|    330|		++escPos;
  924|   499k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 359k, False: 140k]
  |  Branch (924:34): [True: 1.33k, False: 357k]
  ------------------
  925|  1.33k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  1.33k|		++escPos;
  927|   498k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 349k, False: 149k]
  |  Branch (927:34): [True: 207k, False: 141k]
  ------------------
  928|   207k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|   207k|		++escPos;
  930|   207k|	}
  931|       |	
  932|   499k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 499k]
  ------------------
  933|   499k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 415k, False: 84.5k]
  ------------------
  934|       |	
  935|  84.5k|	size_t escLen = escPos - escStart + 1;
  936|  84.5k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 12.0k, False: 72.4k]
  ------------------
  937|       |	
  938|  72.4k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  72.4k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  72.0k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  70.2k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 398, False: 72.0k]
  |  Branch (938:29): [True: 1.86k, False: 70.2k]
  |  Branch (938:50): [True: 404, False: 69.8k]
  ------------------
  939|       |	
  940|  69.8k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  72.4k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  10.7k|{
  152|  10.7k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  10.7k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 190, False: 10.5k]
  ------------------
  155|  10.7k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 2.64k, False: 8.08k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  8.08k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  8.08k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  8.08k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  8.08k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 8.08k]
  ------------------
  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.09k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 2.13k, False: 6.96k]
  ------------------
  168|  2.13k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  2.13k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 949, False: 1.18k]
  |  Branch (169:42): [True: 168, False: 1.01k]
  ------------------
  170|  1.11k|				verStr = currAttr->value.c_str();
  171|  1.11k|				break;
  172|  1.11k|			}
  173|  2.13k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  8.08k|	unsigned long part;
  178|  29.4k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 22.3k, False: 7.08k]
  |  Branch (178:29): [True: 4.83k, False: 17.4k]
  |  Branch (178:48): [True: 16.5k, False: 995]
  ------------------
  179|       |	
  180|  8.08k|	part = 0;
  181|  14.1k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 7.02k, False: 7.08k]
  |  Branch (181:28): [True: 6.21k, False: 813]
  |  Branch (181:48): [True: 6.02k, False: 182]
  ------------------
  182|  6.02k|		part = (part * 10) + (*verStr - '0');
  183|  6.02k|		++verStr;
  184|  6.02k|	}
  185|  8.08k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 210, False: 7.87k]
  ------------------
  186|  8.08k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  8.08k|	part = 0;
  189|  8.08k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 530, False: 7.55k]
  ------------------
  190|  12.9k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 5.83k, False: 7.08k]
  |  Branch (190:28): [True: 5.07k, False: 764]
  |  Branch (190:48): [True: 4.83k, False: 231]
  ------------------
  191|  4.83k|		part = (part * 10) + (*verStr - '0');
  192|  4.83k|		++verStr;
  193|  4.83k|	}
  194|  8.08k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 103, False: 7.97k]
  ------------------
  195|  8.08k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  8.08k|	part = 0;
  198|  8.08k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 132, False: 7.94k]
  ------------------
  199|  10.7k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 3.64k, False: 7.08k]
  |  Branch (199:28): [True: 2.96k, False: 684]
  |  Branch (199:48): [True: 2.65k, False: 307]
  ------------------
  200|  2.65k|		part = (part * 10) + (*verStr - '0');
  201|  2.65k|		++verStr;
  202|  2.65k|	}
  203|  8.08k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 77, False: 8.00k]
  ------------------
  204|  8.08k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  8.08k|	part = 0;
  207|  8.08k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 392, False: 7.68k]
  ------------------
  208|  10.5k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 3.49k, False: 7.08k]
  |  Branch (208:28): [True: 3.08k, False: 411]
  |  Branch (208:48): [True: 2.50k, False: 580]
  ------------------
  209|  2.50k|		part = (part * 10) + (*verStr - '0');
  210|  2.50k|		++verStr;
  211|  2.50k|	}
  212|  8.08k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 96, False: 7.98k]
  ------------------
  213|  8.08k|	thiz->prevTkVer += part;
  214|       |	
  215|  8.08k|	return rootNode;
  216|       |	
  217|  8.08k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  3.73k|{
  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|  11.4k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 8.02k, False: 3.39k]
  ------------------
  116|  8.02k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  8.02k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 6.07k, False: 1.95k]
  ------------------
  118|  1.95k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 340, False: 1.61k]
  |  Branch (118:44): [True: 1, False: 1.60k]
  ------------------
  119|  1.95k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  3.39k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 3.39k, False: 0]
  ------------------
  122|  7.44k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 4.17k, False: 3.26k]
  ------------------
  123|  4.17k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  4.17k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 3.16k, False: 1.01k]
  ------------------
  125|  1.01k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 134, False: 882]
  ------------------
  126|  1.01k|		}
  127|  3.39k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  6.42k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 3.20k, False: 3.22k]
  ------------------
  131|  3.20k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  3.20k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 41, False: 3.16k]
  ------------------
  133|  3.20k|	}
  134|       |	
  135|  3.22k|	return 0;
  136|       |
  137|  3.26k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  5.95k|{
  232|  5.95k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.95k|#define kXMP_ExistingOnly	false
  ------------------
  233|  5.95k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 4.54k, False: 1.40k]
  ------------------
  234|       |	
  235|  5.60k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 4.20k, False: 1.40k]
  ------------------
  236|  4.20k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  4.20k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  4.20k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 642, 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: 166, False: 3.39k]
  ------------------
  242|  3.39k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 34, False: 3.35k]
  ------------------
  243|    200|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  3.35k|		} else if (
  245|  3.35k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 160, False: 3.19k]
  ------------------
  246|  3.19k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 30, False: 3.16k]
  ------------------
  247|  3.16k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 1, False: 3.16k]
  ------------------
  248|    191|			arrayForm = kXMP_PropArrayIsAltText;
  249|  3.16k|		} else if (
  250|  3.16k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 35, False: 3.13k]
  ------------------
  251|  3.13k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 273, False: 2.86k]
  ------------------
  252|  2.86k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 36, False: 2.82k]
  ------------------
  253|  2.82k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 10, False: 2.81k]
  ------------------
  254|  2.81k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 18, False: 2.79k]
  ------------------
  255|  2.79k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 36, False: 2.76k]
  ------------------
  256|    408|			arrayForm = kXMP_PropValueIsArray;
  257|    408|		}
  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: 799]
  ------------------
  259|       |		
  260|    799|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    799|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    799|		dcSchema->children[propNum] = newArray;
  263|    799|		newArray->children.push_back ( currProp );
  264|    799|		currProp->parent = newArray;
  265|    799|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    799|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    799|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 191, False: 608]
  |  Branch (267:44): [True: 191, False: 0]
  ------------------
  268|    191|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    191|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    191|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 191, False: 0]
  ------------------
  271|    191|				currProp->qualifiers.push_back ( newLang );
  272|    191|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    191|		}
  276|       |
  277|    799|	}
  278|       |	
  279|  1.40k|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  5.95k|{
  666|  5.95k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  5.95k|	XMP_Node * currSchema = 0;
  671|       |
  672|  5.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.95k|#define kXMP_ExistingOnly	false
  ------------------
  673|  5.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 24, False: 5.92k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     24|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     24|#define kXMP_ExistingOnly	false
  ------------------
  677|     24|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 24]
  ------------------
  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|     24|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     24|#define kXMP_ExistingOnly	false
  ------------------
  682|     24|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 24]
  |  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|     24|	}
  697|       |
  698|  5.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.95k|#define kXMP_ExistingOnly	false
  ------------------
  699|  5.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 59, False: 5.89k]
  ------------------
  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|     59|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|     59|#define kXMP_ExistingOnly	false
  ------------------
  703|     59|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 59]
  ------------------
  704|     59|	}
  705|       |
  706|  5.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.95k|#define kXMP_ExistingOnly	false
  ------------------
  707|  5.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 1.40k, False: 4.54k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|  1.40k|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.40k|#define kXMP_ExistingOnly	false
  ------------------
  710|  1.40k|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 128, False: 1.28k]
  ------------------
  711|    128|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|    128|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|    128|		}
  714|  1.40k|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  5.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  5.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  5.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  5.95k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  5.95k|	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.95k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 718, False: 5.23k]
  ------------------
  732|       |
  733|    718|		bool nameIsUUID = false;
  734|    718|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    718|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    718|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 197, False: 521]
  |  |  ------------------
  ------------------
  737|       |
  738|    197|			nameIsUUID = true;
  739|       |
  740|    521|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 222, False: 299]
  ------------------
  741|       |
  742|    222|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  2.90k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 2.88k, False: 19]
  ------------------
  744|  2.88k|				char ch = nameStr[i];
  745|  2.88k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 99, False: 2.79k]
  ------------------
  746|     99|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 20, False: 79]
  |  Branch (746:23): [True: 18, False: 61]
  |  Branch (746:36): [True: 18, False: 43]
  |  Branch (746:49): [True: 20, False: 23]
  ------------------
  747|     23|					nameIsUUID = false;
  748|     23|					break;
  749|  2.79k|				} else {
  750|  2.79k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 2.74k, False: 46]
  |  Branch (750:27): [True: 715, False: 2.02k]
  |  Branch (750:44): [True: 1.91k, False: 157]
  |  Branch (750:59): [True: 1.89k, False: 23]
  ------------------
  751|    180|					nameIsUUID = false;
  752|    180|					break;
  753|  2.79k|				}
  754|  2.88k|			}
  755|       |
  756|    222|		}
  757|       |		
  758|    718|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 216, False: 502]
  ------------------
  759|       |
  760|    216|			XMP_ExpandedXPath expPath;
  761|    216|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|    216|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|    216|#define kXMP_CreateNodes	true
  ------------------
  763|    216|			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: 216]
  ------------------
  764|       |
  765|    216|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|    216|			idNode->value = tree.name;
  767|    216|			idNode->RemoveChildren();
  768|    216|			idNode->RemoveQualifiers();
  769|       |
  770|    216|			tree.name.erase();
  771|       |
  772|    216|		}
  773|       |
  774|    718|	}
  775|       |
  776|  5.95k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  29.7k|{
  610|  29.7k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  29.7k|#define kXMP_ExistingOnly	false
  ------------------
  611|  29.7k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 25.1k, False: 4.61k]
  ------------------
  612|       |	
  613|  4.61k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.61k|#define kXMP_ExistingOnly	false
  ------------------
  614|  4.61k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 3.99k, False: 623]
  |  Branch (614:27): [True: 541, False: 82]
  ------------------
  615|       |	
  616|     82|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 0, False: 82]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     82|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  3.64k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 3.56k, False: 82]
  ------------------
  622|       |
  623|  3.56k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  3.56k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 349, False: 3.21k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|    349|			delete ( currChild );
  629|    349|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  3.21k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.98k, False: 1.22k]
  ------------------
  632|       |		
  633|  1.98k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 8, False: 1.97k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|      8|				delete ( currChild );
  637|      8|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  1.97k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  1.97k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  1.97k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 1.96k, False: 14]
  ------------------
  644|  1.96k|					currChild->qualifiers.push_back ( repairLang );
  645|  1.96k|				} else {
  646|     14|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     14|				}
  648|  1.97k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  1.97k|			}
  651|       |
  652|  1.98k|		}
  653|       |
  654|  3.56k|	}
  655|       |
  656|     82|}	// RepairAltText

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

