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

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

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

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

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

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  2.49M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  4.85M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|  72.7k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  82.7M|  [[nodiscard]] auto begin() noexcept {
  151|  82.7M|    return pData_.begin();
  152|  82.7M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  1.30k|  [[nodiscard]] auto end() noexcept {
  155|  1.30k|    return pData_.end();
  156|  1.30k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  13.6k|  [[nodiscard]] auto begin() const noexcept {
  159|  13.6k|    return pData_.begin();
  160|  13.6k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  13.6k|  [[nodiscard]] auto end() const noexcept {
  163|  13.6k|    return pData_.end();
  164|  13.6k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  2.61M|  [[nodiscard]] size_t size() const {
  167|  2.61M|    return pData_.size();
  168|  2.61M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  16.9k|  [[nodiscard]] bool empty() const {
  195|  16.9k|    return pData_.empty();
  196|  16.9k|  }
_ZN5Exiv27DataBufC2Ev:
  126|   553k|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  30.2k|const T* find(T (&src)[N], const K& key) {
  448|  30.2k|  static_assert(N > 0, "Passed zero length find");
  449|  30.2k|  auto rc = std::find(src, src + N, key);
  450|  30.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 30.2k]
  ------------------
  451|  30.2k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  34.8k|std::string toString(const T& arg) {
  467|  34.8k|  return toStringHelper(arg, std::is_integral<T>());
  468|  34.8k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  34.8k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  34.8k|  return std::to_string(arg);
  457|  34.8k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  3.37M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  3.37M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 1.80M, False: 1.57M]
  ------------------
  229|  1.80M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  1.80M|  }
  231|  1.57M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  3.37M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|  28.7k|const T* find(T (&src)[N], const K& key) {
  448|  28.7k|  static_assert(N > 0, "Passed zero length find");
  449|  28.7k|  auto rc = std::find(src, src + N, key);
  450|  28.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 23.2k, False: 5.54k]
  ------------------
  451|  28.7k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  12.4k|const T* find(T (&src)[N], const K& key) {
  448|  12.4k|  static_assert(N > 0, "Passed zero length find");
  449|  12.4k|  auto rc = std::find(src, src + N, key);
  450|  12.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 11.5k, False: 928]
  ------------------
  451|  12.4k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|  58.6k|const T* find(T (&src)[N], const K& key) {
  448|  58.6k|  static_assert(N > 0, "Passed zero length find");
  449|  58.6k|  auto rc = std::find(src, src + N, key);
  450|  58.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 28.3k, False: 30.2k]
  ------------------
  451|  58.6k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|   703k|const T* find(T (&src)[N], const K& key) {
  448|   703k|  static_assert(N > 0, "Passed zero length find");
  449|   703k|  auto rc = std::find(src, src + N, key);
  450|   703k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 16, False: 703k]
  ------------------
  451|   703k|}
_ZN5Exiv24findIKNS_8mimeTypeEiLm6EEEPKT_RAT1__S3_RKT0_:
  447|    117|const T* find(T (&src)[N], const K& key) {
  448|    117|  static_assert(N > 0, "Passed zero length find");
  449|    117|  auto rc = std::find(src, src + N, key);
  450|    117|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 109, False: 8]
  ------------------
  451|    117|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  1.75M|const T* find(T (&src)[N], const K& key) {
  448|  1.75M|  static_assert(N > 0, "Passed zero length find");
  449|  1.75M|  auto rc = std::find(src, src + N, key);
  450|  1.75M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 721k, False: 1.03M]
  ------------------
  451|  1.75M|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  20.5k|std::string toString(const T& arg) {
  467|  20.5k|  return toStringHelper(arg, std::is_integral<T>());
  468|  20.5k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  20.5k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  20.5k|  return std::to_string(arg);
  457|  20.5k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  4.56k|std::string toString(const T& arg) {
  467|  4.56k|  return toStringHelper(arg, std::is_integral<T>());
  468|  4.56k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  4.56k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  4.56k|  return std::to_string(arg);
  457|  4.56k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   106k|std::string toString(const T& arg) {
  467|   106k|  return toStringHelper(arg, std::is_integral<T>());
  468|   106k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   106k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   106k|  return std::to_string(arg);
  457|   106k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  3.11k|std::string toString(const T& arg) {
  467|  3.11k|  return toStringHelper(arg, std::is_integral<T>());
  468|  3.11k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  3.11k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  3.11k|  std::ostringstream os;
  462|  3.11k|  os << arg;
  463|  3.11k|  return os.str();
  464|  3.11k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  62.0k|std::string toString(const T& arg) {
  467|  62.0k|  return toStringHelper(arg, std::is_integral<T>());
  468|  62.0k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  62.0k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  62.0k|  std::ostringstream os;
  462|  62.0k|  os << arg;
  463|  62.0k|  return os.str();
  464|  62.0k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  11.6k|std::string toString(const T& arg) {
  467|  11.6k|  return toStringHelper(arg, std::is_integral<T>());
  468|  11.6k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  11.6k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  11.6k|  return std::to_string(arg);
  457|  11.6k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  2.08k|const T* find(T (&src)[N], const K& key) {
  448|  2.08k|  static_assert(N > 0, "Passed zero length find");
  449|  2.08k|  auto rc = std::find(src, src + N, key);
  450|  2.08k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.21k, False: 873]
  ------------------
  451|  2.08k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|  1.33k|const T* find(T (&src)[N], const K& key) {
  448|  1.33k|  static_assert(N > 0, "Passed zero length find");
  449|  1.33k|  auto rc = std::find(src, src + N, key);
  450|  1.33k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 510, False: 828]
  ------------------
  451|  1.33k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|  1.31k|const T* find(T (&src)[N], const K& key) {
  448|  1.31k|  static_assert(N > 0, "Passed zero length find");
  449|  1.31k|  auto rc = std::find(src, src + N, key);
  450|  1.31k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 762, False: 554]
  ------------------
  451|  1.31k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|  74.1k|const T* find(T (&src)[N], const K& key) {
  448|  74.1k|  static_assert(N > 0, "Passed zero length find");
  449|  74.1k|  auto rc = std::find(src, src + N, key);
  450|  74.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.54k, False: 72.5k]
  ------------------
  451|  74.1k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  3.02k|const T* find(T (&src)[N], const K& key) {
  448|  3.02k|  static_assert(N > 0, "Passed zero length find");
  449|  3.02k|  auto rc = std::find(src, src + N, key);
  450|  3.02k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.11k, False: 916]
  ------------------
  451|  3.02k|}
_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.7k, False: 3.61k]
  ------------------
  451|  16.3k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  6.38k|const T* find(T (&src)[N], const K& key) {
  448|  6.38k|  static_assert(N > 0, "Passed zero length find");
  449|  6.38k|  auto rc = std::find(src, src + N, key);
  450|  6.38k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.18k, False: 2.20k]
  ------------------
  451|  6.38k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  2.25k|std::string toString(const T& arg) {
  467|  2.25k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.25k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  2.25k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  2.25k|  std::ostringstream os;
  462|  2.25k|  os << arg;
  463|  2.25k|  return os.str();
  464|  2.25k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.22k|std::string toString(const T& arg) {
  467|  1.22k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.22k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.22k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.22k|  return std::to_string(arg);
  457|  1.22k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|  2.15M|std::string toString(const T& arg) {
  467|  2.15M|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.15M|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|  2.15M|std::string toStringHelper(const T& arg, std::false_type) {
  461|  2.15M|  std::ostringstream os;
  462|  2.15M|  os << arg;
  463|  2.15M|  return os.str();
  464|  2.15M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|  2.84k|const T* find(T (&src)[N], const K& key) {
  448|  2.84k|  static_assert(N > 0, "Passed zero length find");
  449|  2.84k|  auto rc = std::find(src, src + N, key);
  450|  2.84k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.44k, False: 1.40k]
  ------------------
  451|  2.84k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|   582k|const T* find(T (&src)[N], const K& key) {
  448|   582k|  static_assert(N > 0, "Passed zero length find");
  449|   582k|  auto rc = std::find(src, src + N, key);
  450|   582k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 71.9k, False: 510k]
  ------------------
  451|   582k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|   582k|const T* find(T (&src)[N], const K& key) {
  448|   582k|  static_assert(N > 0, "Passed zero length find");
  449|   582k|  auto rc = std::find(src, src + N, key);
  450|   582k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 579k, False: 2.67k]
  ------------------
  451|   582k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|   570k|const T* find(T (&src)[N], const K& key) {
  448|   570k|  static_assert(N > 0, "Passed zero length find");
  449|   570k|  auto rc = std::find(src, src + N, key);
  450|   570k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 532k, False: 38.3k]
  ------------------
  451|   570k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  67.2k|const T* find(T (&src)[N], const K& key) {
  448|  67.2k|  static_assert(N > 0, "Passed zero length find");
  449|  67.2k|  auto rc = std::find(src, src + N, key);
  450|  67.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 31.4k, False: 35.8k]
  ------------------
  451|  67.2k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  10.8k|const T* find(T (&src)[N], const K& key) {
  448|  10.8k|  static_assert(N > 0, "Passed zero length find");
  449|  10.8k|  auto rc = std::find(src, src + N, key);
  450|  10.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 8.89k, False: 1.99k]
  ------------------
  451|  10.8k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  10.8k|const T* find(T (&src)[N], const K& key) {
  448|  10.8k|  static_assert(N > 0, "Passed zero length find");
  449|  10.8k|  auto rc = std::find(src, src + N, key);
  450|  10.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 7.60k, False: 3.26k]
  ------------------
  451|  10.8k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|  1.90k|const T* find(T (&src)[N], const K& key) {
  448|  1.90k|  static_assert(N > 0, "Passed zero length find");
  449|  1.90k|  auto rc = std::find(src, src + N, key);
  450|  1.90k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 250, False: 1.65k]
  ------------------
  451|  1.90k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   173k|const T* find(T (&src)[N], const K& key) {
  448|   173k|  static_assert(N > 0, "Passed zero length find");
  449|   173k|  auto rc = std::find(src, src + N, key);
  450|   173k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 152k, False: 20.1k]
  ------------------
  451|   173k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|  39.9k|const T* find(T (&src)[N], const K& key) {
  448|  39.9k|  static_assert(N > 0, "Passed zero length find");
  449|  39.9k|  auto rc = std::find(src, src + N, key);
  450|  39.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 33.7k, False: 6.19k]
  ------------------
  451|  39.9k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  5.17k|const T* find(T (&src)[N], const K& key) {
  448|  5.17k|  static_assert(N > 0, "Passed zero length find");
  449|  5.17k|  auto rc = std::find(src, src + N, key);
  450|  5.17k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 730, False: 4.44k]
  ------------------
  451|  5.17k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  11.9k|const T* find(T (&src)[N], const K& key) {
  448|  11.9k|  static_assert(N > 0, "Passed zero length find");
  449|  11.9k|  auto rc = std::find(src, src + N, key);
  450|  11.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.07k, False: 7.91k]
  ------------------
  451|  11.9k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  3.78M|const T* find(T (&src)[N], const K& key) {
  448|  3.78M|  static_assert(N > 0, "Passed zero length find");
  449|  3.78M|  auto rc = std::find(src, src + N, key);
  450|  3.78M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 3.78M]
  ------------------
  451|  3.78M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  1.80M|const T* find(T (&src)[N], const K& key) {
  448|  1.80M|  static_assert(N > 0, "Passed zero length find");
  449|  1.80M|  auto rc = std::find(src, src + N, key);
  450|  1.80M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 1.80M]
  ------------------
  451|  1.80M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|   960k|const T* find(T (&src)[N], const K& key) {
  448|   960k|  static_assert(N > 0, "Passed zero length find");
  449|   960k|  auto rc = std::find(src, src + N, key);
  450|   960k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 952k, False: 8.61k]
  ------------------
  451|   960k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  10.4k|const T* find(T (&src)[N], const K& key) {
  448|  10.4k|  static_assert(N > 0, "Passed zero length find");
  449|  10.4k|  auto rc = std::find(src, src + N, key);
  450|  10.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.86k, False: 5.59k]
  ------------------
  451|  10.4k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|    377|const T* find(T (&src)[N], const K& key) {
  448|    377|  static_assert(N > 0, "Passed zero length find");
  449|    377|  auto rc = std::find(src, src + N, key);
  450|    377|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 146, False: 231]
  ------------------
  451|    377|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     26|T stringTo(const std::string& s, bool& ok) {
  483|     26|  std::istringstream is(s);
  484|     26|  T tmp = T();
  485|     26|  ok = static_cast<bool>(is >> tmp);
  486|     26|  std::string rest;
  487|     26|  is >> std::skipws >> rest;
  488|     26|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 18, False: 8]
  ------------------
  489|     18|    ok = false;
  490|     26|  return tmp;
  491|     26|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     15|const T* find(T (&src)[N], const K& key) {
  448|     15|  static_assert(N > 0, "Passed zero length find");
  449|     15|  auto rc = std::find(src, src + N, key);
  450|     15|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 15, False: 0]
  ------------------
  451|     15|}

_ZNK5Exiv25Value6typeIdEv:
   85|  1.66M|  TypeId typeId() const {
   86|  1.66M|    return type_;
   87|  1.66M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  2.58M|  UniquePtr clone() const {
   94|  2.58M|    return UniquePtr(clone_());
   95|  2.58M|  }
_ZNK5Exiv25Value2okEv:
  181|  4.28k|  bool ok() const {
  182|  4.28k|    return ok_;
  183|  4.28k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|   200k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|   200k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 74.1k, False: 126k]
  ------------------
  797|  74.1k|      return str1.size() > str2.size();
  798|       |
  799|   126k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|   126k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|   200k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  26.6k|inline TypeId getType<uint16_t>() {
 1084|  26.6k|  return unsignedShort;
 1085|  26.6k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  2.66k|inline TypeId getType<uint32_t>() {
 1089|  2.66k|  return unsignedLong;
 1090|  2.66k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  6.93k|inline TypeId getType<URational>() {
 1094|  6.93k|  return unsignedRational;
 1095|  6.93k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  75.9k|inline TypeId getType<int16_t>() {
 1099|  75.9k|  return signedShort;
 1100|  75.9k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  12.2k|inline TypeId getType<int32_t>() {
 1104|  12.2k|  return signedLong;
 1105|  12.2k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  2.25k|inline TypeId getType<Rational>() {
 1109|  2.25k|  return signedRational;
 1110|  2.25k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  1.97k|inline TypeId getType<float>() {
 1114|  1.97k|  return tiffFloat;
 1115|  1.97k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  4.84k|inline TypeId getType<double>() {
 1119|  4.84k|  return tiffDouble;
 1120|  4.84k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|   838k|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|   838k|  return getUShort(buf, byteOrder);
 1316|   838k|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|   460k|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|   460k|  return getULong(buf, byteOrder);
 1321|   460k|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|  1.26M|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|  1.26M|  return getURational(buf, byteOrder);
 1326|  1.26M|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   474k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   474k|  return getShort(buf, byteOrder);
 1331|   474k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   529k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   529k|  return getLong(buf, byteOrder);
 1336|   529k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|  71.7k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|  71.7k|  return getRational(buf, byteOrder);
 1341|  71.7k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  18.7k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  18.7k|  return getFloat(buf, byteOrder);
 1346|  18.7k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|  32.1k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|  32.1k|  return getDouble(buf, byteOrder);
 1351|  32.1k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  36.1k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  36.1k|  return us2Data(buf, t, byteOrder);
 1374|  36.1k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  72.0k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  72.0k|  return ul2Data(buf, t, byteOrder);
 1382|  72.0k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   917k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   917k|  return ur2Data(buf, t, byteOrder);
 1390|   917k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  2.73k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  2.73k|  return s2Data(buf, t, byteOrder);
 1398|  2.73k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   602k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   602k|  return l2Data(buf, t, byteOrder);
 1406|   602k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  33.9k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  33.9k|  return r2Data(buf, t, byteOrder);
 1414|  33.9k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  9.24k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  9.24k|  return f2Data(buf, t, byteOrder);
 1422|  9.24k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|  6.45k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|  6.45k|  return d2Data(buf, t, byteOrder);
 1430|  6.45k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.12k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.12k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.12k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  4.59k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  4.59k|  return float_to_integer_helper<uint32_t>(n);
 1555|  4.59k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  1.19k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  1.19k|  return float_to_integer_helper<int64_t>(n);
 1560|  1.19k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  6.90k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  6.90k|  return float_to_integer_helper<uint32_t>(n);
 1564|  6.90k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  1.55k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  1.55k|  return rational_to_integer_helper<int64_t>(n);
 1569|  1.55k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  7.43k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  7.43k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  7.43k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  1.65k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  1.65k|  return rational_to_integer_helper<int64_t>(n);
 1578|  1.65k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  87.7k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  87.7k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  87.7k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.12k|  I float_to_integer_helper(size_t n) const {
 1213|  1.12k|    const auto v = value_.at(n);
 1214|  1.12k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 849, False: 279]
  ------------------
 1215|    849|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 613, False: 236]
  ------------------
 1216|    613|      return static_cast<I>(std::lround(v));
 1217|    613|    }
 1218|    515|    return 0;
 1219|  1.12k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  4.59k|  I float_to_integer_helper(size_t n) const {
 1213|  4.59k|    const auto v = value_.at(n);
 1214|  4.59k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.82k, False: 778]
  ------------------
 1215|  3.82k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.84k, False: 978]
  ------------------
 1216|  2.84k|      return static_cast<I>(std::lround(v));
 1217|  2.84k|    }
 1218|  1.75k|    return 0;
 1219|  4.59k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  1.19k|  I float_to_integer_helper(size_t n) const {
 1213|  1.19k|    const auto v = value_.at(n);
 1214|  1.19k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.13k, False: 58]
  ------------------
 1215|  1.13k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 791, False: 345]
  ------------------
 1216|    791|      return static_cast<I>(std::lround(v));
 1217|    791|    }
 1218|    403|    return 0;
 1219|  1.19k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  6.90k|  I float_to_integer_helper(size_t n) const {
 1213|  6.90k|    const auto v = value_.at(n);
 1214|  6.90k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.42k, False: 481]
  ------------------
 1215|  6.42k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 5.55k, False: 869]
  ------------------
 1216|  5.55k|      return static_cast<I>(std::lround(v));
 1217|  5.55k|    }
 1218|  1.35k|    return 0;
 1219|  6.90k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  1.55k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.55k|    auto a = value_.at(n).first;
 1225|  1.55k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.55k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 532, False: 1.02k]
  ------------------
 1229|    532|      return 0;
 1230|    532|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.02k|#ifdef __cpp_if_constexpr
 1234|  1.02k|    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.02k|      const auto imin = std::numeric_limits<I>::min();
 1240|  1.02k|      const auto imax = std::numeric_limits<I>::max();
 1241|  1.02k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 1.02k]
  |  Branch (1241:23): [True: 0, False: 1.02k]
  |  Branch (1241:35): [True: 0, False: 1.02k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  1.02k|#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.02k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.55k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  7.43k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.43k|    auto a = value_.at(n).first;
 1225|  7.43k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.43k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.44k, False: 4.99k]
  ------------------
 1229|  2.44k|      return 0;
 1230|  2.44k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  4.99k|#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|  4.99k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  4.99k|      const auto imax = std::numeric_limits<I>::max();
 1257|  4.99k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 591, False: 4.40k]
  ------------------
 1258|    591|        return 0;
 1259|    591|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  4.40k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  4.40k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  4.40k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 4.40k]
  |  Branch (1263:25): [True: 0, False: 4.40k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  4.40k|    }
 1267|       |
 1268|  4.40k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.43k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  1.65k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.65k|    auto a = value_.at(n).first;
 1225|  1.65k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.65k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 420, False: 1.23k]
  ------------------
 1229|    420|      return 0;
 1230|    420|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.23k|#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.23k|    } 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.23k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  1.23k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 1.23k]
  |  Branch (1251:23): [True: 0, False: 1.23k]
  ------------------
 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.23k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.65k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  87.7k|  I rational_to_integer_helper(size_t n) const {
 1224|  87.7k|    auto a = value_.at(n).first;
 1225|  87.7k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  87.7k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 5.31k, False: 82.4k]
  ------------------
 1229|  5.31k|      return 0;
 1230|  5.31k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  82.4k|#ifdef __cpp_if_constexpr
 1234|  82.4k|    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.4k|      const auto imin = std::numeric_limits<I>::min();
 1240|  82.4k|      const auto imax = std::numeric_limits<I>::max();
 1241|  82.4k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 82.4k]
  |  Branch (1241:23): [True: 0, False: 82.4k]
  |  Branch (1241:35): [True: 0, False: 82.4k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  82.4k|#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.4k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  87.7k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  26.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  26.6k|}
_ZN5Exiv25ValueD2Ev:
   43|  3.63M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  24.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  24.9k|  value_.clear();
 1469|  24.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  24.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 24.9k, False: 0]
  |  Branch (1470:17): [True: 496, False: 24.4k]
  ------------------
 1471|    496|    len = (len / ts) * ts;
 1472|   863k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 838k, False: 24.9k]
  ------------------
 1473|   838k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   838k|  }
 1475|  24.9k|  return 0;
 1476|  24.9k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.70k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.70k|  std::istringstream is(buf);
 1481|  1.70k|  T tmp;
 1482|  1.70k|  ValueList val;
 1483|  2.87k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 1.17k, False: 1.70k]
  ------------------
 1484|  1.17k|    val.push_back(tmp);
 1485|  1.70k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 1.70k]
  ------------------
 1486|      0|    return 1;
 1487|  1.70k|  value_ = std::move(val);
 1488|  1.70k|  return 0;
 1489|  1.70k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  2.33k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  2.33k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.82k, False: 507]
  ------------------
 1651|  1.82k|    pDataArea_ = Blob(buf, buf + len);
 1652|    507|  else
 1653|    507|    pDataArea_.clear();
 1654|  2.33k|  return 0;
 1655|  2.33k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  6.06k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.06k|  size_t offset = 0;
 1494|  36.1k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 36.1k, False: 6.06k]
  ------------------
 1495|  36.1k|    offset += toData(buf + offset, val, byteOrder);
 1496|  36.1k|  }
 1497|  6.06k|  return offset;
 1498|  6.06k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   129k|size_t ValueType<T>::count() const {
 1502|   129k|  return value_.size();
 1503|   129k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  12.6k|size_t ValueType<T>::size() const {
 1507|  12.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  12.6k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    522|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    522|  auto end = value_.end();
 1518|    522|  auto i = value_.begin();
 1519|  6.28k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.75k, False: 522]
  ------------------
 1520|  5.75k|    os << std::setprecision(15) << *i;
 1521|  5.75k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.43k, False: 324]
  ------------------
 1522|  5.43k|      os << " ";
 1523|  5.75k|  }
 1524|    522|  return os;
 1525|    522|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  65.8k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  65.8k|  ok_ = true;
 1537|  65.8k|  return static_cast<int64_t>(value_.at(n));
 1538|  65.8k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|  78.4k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  78.4k|  ok_ = true;
 1542|  78.4k|  return static_cast<uint32_t>(value_.at(n));
 1543|  78.4k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  6.55k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.55k|  return pDataArea_.size();
 1641|  6.55k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    694|DataBuf ValueType<T>::dataArea() const {
 1645|    694|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    694|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|  72.0k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  72.0k|  return new ValueType<T>(*this);
 1513|  72.0k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|  72.0k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  72.0k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 7.03k, False: 65.0k]
  ------------------
 1449|  7.03k|    pDataArea_ = rhs.pDataArea_;
 1450|  72.0k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  2.13M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  52.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  52.3k|  value_.clear();
 1469|  52.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  52.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 52.3k, False: 0]
  |  Branch (1470:17): [True: 45, False: 52.3k]
  ------------------
 1471|     45|    len = (len / ts) * ts;
 1472|   512k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 460k, False: 52.3k]
  ------------------
 1473|   460k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   460k|  }
 1475|  52.3k|  return 0;
 1476|  52.3k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    421|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    421|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 313, False: 108]
  ------------------
 1651|    313|    pDataArea_ = Blob(buf, buf + len);
 1652|    108|  else
 1653|    108|    pDataArea_.clear();
 1654|    421|  return 0;
 1655|    421|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  15.8k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  15.8k|  size_t offset = 0;
 1494|  72.0k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 72.0k, False: 15.8k]
  ------------------
 1495|  72.0k|    offset += toData(buf + offset, val, byteOrder);
 1496|  72.0k|  }
 1497|  15.8k|  return offset;
 1498|  15.8k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|  89.6k|size_t ValueType<T>::count() const {
 1502|  89.6k|  return value_.size();
 1503|  89.6k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  32.7k|size_t ValueType<T>::size() const {
 1507|  32.7k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  32.7k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  3.50k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  3.50k|  auto end = value_.end();
 1518|  3.50k|  auto i = value_.begin();
 1519|  30.4k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 26.9k, False: 3.50k]
  ------------------
 1520|  26.9k|    os << std::setprecision(15) << *i;
 1521|  26.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 23.7k, False: 3.25k]
  ------------------
 1522|  23.7k|      os << " ";
 1523|  26.9k|  }
 1524|  3.50k|  return os;
 1525|  3.50k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  7.47k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  7.47k|  ok_ = true;
 1537|  7.47k|  return static_cast<int64_t>(value_.at(n));
 1538|  7.47k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  22.3k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  22.3k|  ok_ = true;
 1542|  22.3k|  return static_cast<uint32_t>(value_.at(n));
 1543|  22.3k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  4.91k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.91k|  return pDataArea_.size();
 1641|  4.91k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    271|DataBuf ValueType<T>::dataArea() const {
 1645|    271|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    271|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   142k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   142k|  return new ValueType<T>(*this);
 1513|   142k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   142k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   142k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 824, False: 141k]
  ------------------
 1449|    824|    pDataArea_ = rhs.pDataArea_;
 1450|   142k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  6.93k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  6.93k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  6.89k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  6.89k|  value_.clear();
 1469|  6.89k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  6.89k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 6.89k, False: 0]
  |  Branch (1470:17): [True: 0, False: 6.89k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  1.26M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.26M, False: 6.89k]
  ------------------
 1473|  1.26M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.26M|  }
 1475|  6.89k|  return 0;
 1476|  6.89k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    707|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    707|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 417, False: 290]
  ------------------
 1651|    417|    pDataArea_ = Blob(buf, buf + len);
 1652|    290|  else
 1653|    290|    pDataArea_.clear();
 1654|    707|  return 0;
 1655|    707|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  2.48k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.48k|  size_t offset = 0;
 1494|   917k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 917k, False: 2.48k]
  ------------------
 1495|   917k|    offset += toData(buf + offset, val, byteOrder);
 1496|   917k|  }
 1497|  2.48k|  return offset;
 1498|  2.48k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  17.3k|size_t ValueType<T>::count() const {
 1502|  17.3k|  return value_.size();
 1503|  17.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  6.23k|size_t ValueType<T>::size() const {
 1507|  6.23k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  6.23k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    486|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    486|  auto end = value_.end();
 1518|    486|  auto i = value_.begin();
 1519|  4.54k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.05k, False: 486]
  ------------------
 1520|  4.05k|    os << std::setprecision(15) << *i;
 1521|  4.05k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.77k, False: 278]
  ------------------
 1522|  3.77k|      os << " ";
 1523|  4.05k|  }
 1524|    486|  return os;
 1525|    486|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  2.71k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.71k|  return pDataArea_.size();
 1641|  2.71k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|      7|DataBuf ValueType<T>::dataArea() const {
 1645|      7|  return {pDataArea_.data(), pDataArea_.size()};
 1646|      7|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  24.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  24.4k|  return new ValueType<T>(*this);
 1513|  24.4k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  24.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  24.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.90k, False: 22.5k]
  ------------------
 1449|  1.90k|    pDataArea_ = rhs.pDataArea_;
 1450|  24.4k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  75.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  75.9k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  69.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  69.1k|  value_.clear();
 1469|  69.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  69.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 69.1k, False: 0]
  |  Branch (1470:17): [True: 75, False: 69.0k]
  ------------------
 1471|     75|    len = (len / ts) * ts;
 1472|   543k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 474k, False: 69.1k]
  ------------------
 1473|   474k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   474k|  }
 1475|  69.1k|  return 0;
 1476|  69.1k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  6.80k|int ValueType<T>::read(const std::string& buf) {
 1480|  6.80k|  std::istringstream is(buf);
 1481|  6.80k|  T tmp;
 1482|  6.80k|  ValueList val;
 1483|  28.9k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 22.1k, False: 6.80k]
  ------------------
 1484|  22.1k|    val.push_back(tmp);
 1485|  6.80k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 6.80k]
  ------------------
 1486|      0|    return 1;
 1487|  6.80k|  value_ = std::move(val);
 1488|  6.80k|  return 0;
 1489|  6.80k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    635|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    635|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 309, False: 326]
  ------------------
 1651|    309|    pDataArea_ = Blob(buf, buf + len);
 1652|    326|  else
 1653|    326|    pDataArea_.clear();
 1654|    635|  return 0;
 1655|    635|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  1.22k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.22k|  size_t offset = 0;
 1494|  2.73k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 2.73k, False: 1.22k]
  ------------------
 1495|  2.73k|    offset += toData(buf + offset, val, byteOrder);
 1496|  2.73k|  }
 1497|  1.22k|  return offset;
 1498|  1.22k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  75.7k|size_t ValueType<T>::count() const {
 1502|  75.7k|  return value_.size();
 1503|  75.7k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  2.65k|size_t ValueType<T>::size() const {
 1507|  2.65k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.65k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    672|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    672|  auto end = value_.end();
 1518|    672|  auto i = value_.begin();
 1519|  76.1k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 75.4k, False: 672]
  ------------------
 1520|  75.4k|    os << std::setprecision(15) << *i;
 1521|  75.4k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 75.0k, False: 440]
  ------------------
 1522|  75.0k|      os << " ";
 1523|  75.4k|  }
 1524|    672|  return os;
 1525|    672|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|    580|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|    580|  ok_ = true;
 1537|    580|  return static_cast<int64_t>(value_.at(n));
 1538|    580|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  2.96k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  2.96k|  ok_ = true;
 1542|  2.96k|  return static_cast<uint32_t>(value_.at(n));
 1543|  2.96k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|    922|size_t ValueType<T>::sizeDataArea() const {
 1640|    922|  return pDataArea_.size();
 1641|    922|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    213|DataBuf ValueType<T>::dataArea() const {
 1645|    213|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    213|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|   148k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   148k|  return new ValueType<T>(*this);
 1513|   148k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|   148k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   148k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 851, False: 147k]
  ------------------
 1449|    851|    pDataArea_ = rhs.pDataArea_;
 1450|   148k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  12.2k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  12.2k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  12.2k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.2k|  value_.clear();
 1469|  12.2k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.2k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.2k, False: 0]
  |  Branch (1470:17): [True: 66, False: 12.1k]
  ------------------
 1471|     66|    len = (len / ts) * ts;
 1472|   541k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 529k, False: 12.2k]
  ------------------
 1473|   529k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   529k|  }
 1475|  12.2k|  return 0;
 1476|  12.2k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    649|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    649|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 285, False: 364]
  ------------------
 1651|    285|    pDataArea_ = Blob(buf, buf + len);
 1652|    364|  else
 1653|    364|    pDataArea_.clear();
 1654|    649|  return 0;
 1655|    649|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  5.26k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.26k|  size_t offset = 0;
 1494|   602k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 602k, False: 5.26k]
  ------------------
 1495|   602k|    offset += toData(buf + offset, val, byteOrder);
 1496|   602k|  }
 1497|  5.26k|  return offset;
 1498|  5.26k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  25.0k|size_t ValueType<T>::count() const {
 1502|  25.0k|  return value_.size();
 1503|  25.0k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|  11.5k|size_t ValueType<T>::size() const {
 1507|  11.5k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  11.5k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    437|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    437|  auto end = value_.end();
 1518|    437|  auto i = value_.begin();
 1519|  1.03M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.03M, False: 437]
  ------------------
 1520|  1.03M|    os << std::setprecision(15) << *i;
 1521|  1.03M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.03M, False: 235]
  ------------------
 1522|  1.03M|      os << " ";
 1523|  1.03M|  }
 1524|    437|  return os;
 1525|    437|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  2.36k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  2.36k|  ok_ = true;
 1537|  2.36k|  return static_cast<int64_t>(value_.at(n));
 1538|  2.36k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  5.88k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  5.88k|  ok_ = true;
 1542|  5.88k|  return static_cast<uint32_t>(value_.at(n));
 1543|  5.88k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  1.35k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.35k|  return pDataArea_.size();
 1641|  1.35k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    185|DataBuf ValueType<T>::dataArea() const {
 1645|    185|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    185|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  38.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  38.2k|  return new ValueType<T>(*this);
 1513|  38.2k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  38.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  38.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 759, False: 37.5k]
  ------------------
 1449|    759|    pDataArea_ = rhs.pDataArea_;
 1450|  38.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  2.25k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.25k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  2.25k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  2.25k|  value_.clear();
 1469|  2.25k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  2.25k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 2.25k, False: 0]
  |  Branch (1470:17): [True: 0, False: 2.25k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  73.9k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 71.7k, False: 2.25k]
  ------------------
 1473|  71.7k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  71.7k|  }
 1475|  2.25k|  return 0;
 1476|  2.25k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    490|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    490|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 227, False: 263]
  ------------------
 1651|    227|    pDataArea_ = Blob(buf, buf + len);
 1652|    263|  else
 1653|    263|    pDataArea_.clear();
 1654|    490|  return 0;
 1655|    490|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  1.10k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.10k|  size_t offset = 0;
 1494|  33.9k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 33.9k, False: 1.10k]
  ------------------
 1495|  33.9k|    offset += toData(buf + offset, val, byteOrder);
 1496|  33.9k|  }
 1497|  1.10k|  return offset;
 1498|  1.10k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  9.45k|size_t ValueType<T>::count() const {
 1502|  9.45k|  return value_.size();
 1503|  9.45k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  2.42k|size_t ValueType<T>::size() const {
 1507|  2.42k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.42k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    466|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    466|  auto end = value_.end();
 1518|    466|  auto i = value_.begin();
 1519|  6.51k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 6.05k, False: 466]
  ------------------
 1520|  6.05k|    os << std::setprecision(15) << *i;
 1521|  6.05k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.73k, False: 316]
  ------------------
 1522|  5.73k|      os << " ";
 1523|  6.05k|  }
 1524|    466|  return os;
 1525|    466|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|    444|size_t ValueType<T>::sizeDataArea() const {
 1640|    444|  return pDataArea_.size();
 1641|    444|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     12|DataBuf ValueType<T>::dataArea() const {
 1645|     12|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     12|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  7.62k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  7.62k|  return new ValueType<T>(*this);
 1513|  7.62k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  7.62k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  7.62k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 342, False: 7.28k]
  ------------------
 1449|    342|    pDataArea_ = rhs.pDataArea_;
 1450|  7.62k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  1.97k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  1.97k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  1.97k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  1.97k|  value_.clear();
 1469|  1.97k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  1.97k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 1.97k, False: 0]
  |  Branch (1470:17): [True: 0, False: 1.97k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  20.7k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 18.7k, False: 1.97k]
  ------------------
 1473|  18.7k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  18.7k|  }
 1475|  1.97k|  return 0;
 1476|  1.97k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    611|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    611|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 202, False: 409]
  ------------------
 1651|    202|    pDataArea_ = Blob(buf, buf + len);
 1652|    409|  else
 1653|    409|    pDataArea_.clear();
 1654|    611|  return 0;
 1655|    611|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|    660|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    660|  size_t offset = 0;
 1494|  9.24k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 9.24k, False: 660]
  ------------------
 1495|  9.24k|    offset += toData(buf + offset, val, byteOrder);
 1496|  9.24k|  }
 1497|    660|  return offset;
 1498|    660|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  9.95k|size_t ValueType<T>::count() const {
 1502|  9.95k|  return value_.size();
 1503|  9.95k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  1.54k|size_t ValueType<T>::size() const {
 1507|  1.54k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.54k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    665|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    665|  auto end = value_.end();
 1518|    665|  auto i = value_.begin();
 1519|  5.57k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.91k, False: 665]
  ------------------
 1520|  4.91k|    os << std::setprecision(15) << *i;
 1521|  4.91k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.60k, False: 306]
  ------------------
 1522|  4.60k|      os << " ";
 1523|  4.91k|  }
 1524|    665|  return os;
 1525|    665|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|    459|size_t ValueType<T>::sizeDataArea() const {
 1640|    459|  return pDataArea_.size();
 1641|    459|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|     16|DataBuf ValueType<T>::dataArea() const {
 1645|     16|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     16|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  6.14k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  6.14k|  return new ValueType<T>(*this);
 1513|  6.14k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  6.14k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  6.14k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 177, False: 5.96k]
  ------------------
 1449|    177|    pDataArea_ = rhs.pDataArea_;
 1450|  6.14k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  4.84k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.84k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  4.84k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  4.84k|  value_.clear();
 1469|  4.84k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  4.84k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 4.84k, False: 0]
  |  Branch (1470:17): [True: 0, False: 4.84k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  36.9k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 32.1k, False: 4.84k]
  ------------------
 1473|  32.1k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  32.1k|  }
 1475|  4.84k|  return 0;
 1476|  4.84k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    408|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    408|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 211, False: 197]
  ------------------
 1651|    211|    pDataArea_ = Blob(buf, buf + len);
 1652|    197|  else
 1653|    197|    pDataArea_.clear();
 1654|    408|  return 0;
 1655|    408|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|    446|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    446|  size_t offset = 0;
 1494|  6.45k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 6.45k, False: 446]
  ------------------
 1495|  6.45k|    offset += toData(buf + offset, val, byteOrder);
 1496|  6.45k|  }
 1497|    446|  return offset;
 1498|    446|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  9.80k|size_t ValueType<T>::count() const {
 1502|  9.80k|  return value_.size();
 1503|  9.80k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  1.11k|size_t ValueType<T>::size() const {
 1507|  1.11k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.11k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    550|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    550|  auto end = value_.end();
 1518|    550|  auto i = value_.begin();
 1519|  1.50k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 953, False: 550]
  ------------------
 1520|    953|    os << std::setprecision(15) << *i;
 1521|    953|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 623, False: 330]
  ------------------
 1522|    623|      os << " ";
 1523|    953|  }
 1524|    550|  return os;
 1525|    550|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|    433|size_t ValueType<T>::sizeDataArea() const {
 1640|    433|  return pDataArea_.size();
 1641|    433|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|     11|DataBuf ValueType<T>::dataArea() const {
 1645|     11|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     11|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  11.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  11.4k|  return new ValueType<T>(*this);
 1513|  11.4k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  11.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  11.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 217, False: 11.2k]
  ------------------
 1449|    217|    pDataArea_ = rhs.pDataArea_;
 1450|  11.4k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|  10.2M|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  2.66k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.66k|}

_ZNK5Exiv27XmpData9usePacketEv:
  216|  4.00k|  [[nodiscard]] bool usePacket() const {
  217|  4.00k|    return usePacket_;
  218|  4.00k|  }
_ZN5Exiv27XmpData9usePacketEb:
  221|  37.9k|  bool usePacket(bool b) {
  222|  37.9k|    bool r = usePacket_;
  223|  37.9k|    usePacket_ = b;
  224|  37.9k|    return r;
  225|  37.9k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  227|  37.9k|  void setPacket(std::string xmpPacket) {
  228|  37.9k|    xmpPacket_ = std::move(xmpPacket);
  229|  37.9k|    usePacket(false);
  230|  37.9k|  }
_ZN5Exiv27XmpDataC2Ev:
  140|  34.8k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  395|  29.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|  29.7k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  29.7k|  return *this;
  405|  29.7k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  395|  62.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|  62.0k|    setValue(Exiv2::toString(value));
  404|  62.0k|  return *this;
  405|  62.0k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  395|  11.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  11.6k|    setValue(Exiv2::toString(value));
  404|  11.6k|  return *this;
  405|  11.6k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  395|  20.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|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  20.5k|    setValue(Exiv2::toString(value));
  404|  20.5k|  return *this;
  405|  20.5k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  395|  2.25k|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.25k|    setValue(Exiv2::toString(value));
  404|  2.25k|  return *this;
  405|  2.25k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  395|  3.22k|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.22k|    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.22k|  return *this;
  405|  3.22k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  395|  1.22k|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.22k|    setValue(Exiv2::toString(value));
  404|  1.22k|  return *this;
  405|  1.22k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  395|  3.11k|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|  3.11k|    setValue(Exiv2::toString(value));
  404|  3.11k|  return *this;
  405|  3.11k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  395|  1.80k|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|  1.80k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  1.80k|  return *this;
  405|  1.80k|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  395|  34.8k|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|  34.8k|    setValue(Exiv2::toString(value));
  404|  34.8k|  return *this;
  405|  34.8k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  395|  4.56k|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|  4.56k|    setValue(Exiv2::toString(value));
  404|  4.56k|  return *this;
  405|  4.56k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  395|  83.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|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  83.5k|    setValue(Exiv2::toString(value));
  404|  83.5k|  return *this;
  405|  83.5k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  395|  58.8k|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|  58.8k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  58.8k|  return *this;
  405|  58.8k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  395|   106k|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|   106k|    setValue(Exiv2::toString(value));
  404|   106k|  return *this;
  405|   106k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  395|    157|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|    157|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    157|  return *this;
  405|    157|}

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

_ZN5Exiv27BasicIoD2Ev:
   54|  39.2k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   56|  5.35M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   57|  5.35M|  const size_t nread = read(buf, rcount);
   58|  5.35M|  Internal::enforce(nread == rcount, err);
   59|  5.35M|  Internal::enforce(!error(), err);
   60|  5.35M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   62|  11.1k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   63|  11.1k|  const int r = seek(offset, pos);
   64|  11.1k|  Internal::enforce(r == 0, err);
   65|  11.1k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  618|  31.2k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  619|  31.2k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  672|   305k|void MemIo::Impl::reserve(size_t wcount) {
  673|   305k|  const size_t need = wcount + idx_;
  674|   305k|  size_t blockSize = 32 * 1024;  // 32768
  675|   305k|  const size_t maxBlockSize = 4 * 1024 * 1024;
  676|       |
  677|   305k|  if (!isMalloced_) {
  ------------------
  |  Branch (677:7): [True: 4.00k, False: 301k]
  ------------------
  678|       |    // Minimum size for 1st block
  679|  4.00k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  680|  4.00k|    auto data = static_cast<byte*>(std::malloc(size));
  681|  4.00k|    if (!data) {
  ------------------
  |  Branch (681:9): [True: 0, False: 4.00k]
  ------------------
  682|      0|      throw Error(ErrorCode::kerMallocFailed);
  683|      0|    }
  684|  4.00k|    if (data_) {
  ------------------
  |  Branch (684:9): [True: 0, False: 4.00k]
  ------------------
  685|      0|      std::memcpy(data, data_, size_);
  686|      0|    }
  687|  4.00k|    data_ = data;
  688|  4.00k|    sizeAlloced_ = size;
  689|  4.00k|    isMalloced_ = true;
  690|  4.00k|  }
  691|       |
  692|   305k|  if (need > size_) {
  ------------------
  |  Branch (692:7): [True: 290k, False: 14.9k]
  ------------------
  693|   290k|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (693:9): [True: 125, False: 290k]
  ------------------
  694|    125|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  695|       |      // Allocate in blocks
  696|    125|      size_t want = blockSize * (1 + need / blockSize);
  697|    125|      data_ = static_cast<byte*>(std::realloc(data_, want));
  698|    125|      if (!data_) {
  ------------------
  |  Branch (698:11): [True: 0, False: 125]
  ------------------
  699|      0|        throw Error(ErrorCode::kerMallocFailed);
  700|      0|      }
  701|    125|      sizeAlloced_ = want;
  702|    125|    }
  703|   290k|    size_ = need;
  704|   290k|  }
  705|   305k|}
_ZN5Exiv25MemIoC2Ev:
  707|  8.01k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  708|  8.01k|}
_ZN5Exiv25MemIoC2EPKhm:
  710|  31.2k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  711|  31.2k|}
_ZN5Exiv25MemIoD2Ev:
  713|  39.2k|MemIo::~MemIo() {
  714|  39.2k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (714:7): [True: 4.00k, False: 35.2k]
  ------------------
  715|  4.00k|    std::free(p_->data_);
  716|  4.00k|  }
  717|  39.2k|}
_ZN5Exiv25MemIo5writeEPKhm:
  719|   303k|size_t MemIo::write(const byte* data, size_t wcount) {
  720|   303k|  p_->reserve(wcount);
  721|   303k|  if (data) {
  ------------------
  |  Branch (721:7): [True: 288k, False: 14.9k]
  ------------------
  722|   288k|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  723|   288k|  }
  724|   303k|  p_->idx_ += wcount;
  725|   303k|  return wcount;
  726|   303k|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  728|  3.89k|void MemIo::transfer(BasicIo& src) {
  729|  3.89k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (729:12): [True: 3.89k, False: 0]
  ------------------
  730|       |    // Optimization if src is another instance of MemIo
  731|  3.89k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (731:9): [True: 0, False: 3.89k]
  ------------------
  732|      0|      std::free(p_->data_);
  733|      0|    }
  734|  3.89k|    p_->idx_ = 0;
  735|  3.89k|    p_->data_ = memIo->p_->data_;
  736|  3.89k|    p_->size_ = memIo->p_->size_;
  737|  3.89k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  738|  3.89k|    memIo->p_->idx_ = 0;
  739|  3.89k|    memIo->p_->data_ = nullptr;
  740|  3.89k|    memIo->p_->size_ = 0;
  741|  3.89k|    memIo->p_->isMalloced_ = false;
  742|  3.89k|  } 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|  3.89k|  if (error() || src.error())
  ------------------
  |  Branch (751:7): [True: 0, False: 3.89k]
  |  Branch (751:18): [True: 0, False: 3.89k]
  ------------------
  752|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  753|  3.89k|}
_ZN5Exiv25MemIo4putbEh:
  773|  2.40k|int MemIo::putb(byte data) {
  774|  2.40k|  p_->reserve(1);
  775|  2.40k|  p_->data_[p_->idx_++] = data;
  776|  2.40k|  return data;
  777|  2.40k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  779|  1.32M|int MemIo::seek(int64_t offset, Position pos) {
  780|  1.32M|  int64_t newIdx = 0;
  781|       |
  782|  1.32M|  switch (pos) {
  ------------------
  |  Branch (782:11): [True: 1.32M, False: 0]
  ------------------
  783|   582k|    case BasicIo::cur:
  ------------------
  |  Branch (783:5): [True: 582k, False: 746k]
  ------------------
  784|   582k|      newIdx = p_->idx_ + offset;
  785|   582k|      break;
  786|   745k|    case BasicIo::beg:
  ------------------
  |  Branch (786:5): [True: 745k, False: 582k]
  ------------------
  787|   745k|      newIdx = offset;
  788|   745k|      break;
  789|    135|    case BasicIo::end:
  ------------------
  |  Branch (789:5): [True: 135, False: 1.32M]
  ------------------
  790|    135|      newIdx = p_->size_ + offset;
  791|    135|      break;
  792|  1.32M|  }
  793|       |
  794|  1.32M|  if (newIdx < 0)
  ------------------
  |  Branch (794:7): [True: 0, False: 1.32M]
  ------------------
  795|      0|    return 1;
  796|       |
  797|  1.32M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (797:7): [True: 10.0k, False: 1.31M]
  ------------------
  798|  10.0k|    p_->eof_ = true;
  799|  10.0k|    return 1;
  800|  10.0k|  }
  801|       |
  802|  1.31M|  p_->idx_ = static_cast<size_t>(newIdx);
  803|  1.31M|  p_->eof_ = false;
  804|  1.31M|  return 0;
  805|  1.32M|}
_ZN5Exiv25MemIo4mmapEb:
  807|  31.5k|byte* MemIo::mmap(bool /*isWriteable*/) {
  808|  31.5k|  return p_->data_;
  809|  31.5k|}
_ZNK5Exiv25MemIo4tellEv:
  815|  1.48M|size_t MemIo::tell() const {
  816|  1.48M|  return p_->idx_;
  817|  1.48M|}
_ZNK5Exiv25MemIo4sizeEv:
  819|   740k|size_t MemIo::size() const {
  820|   740k|  return p_->size_;
  821|   740k|}
_ZN5Exiv25MemIo4openEv:
  823|   107k|int MemIo::open() {
  824|   107k|  p_->idx_ = 0;
  825|   107k|  p_->eof_ = false;
  826|   107k|  return 0;
  827|   107k|}
_ZNK5Exiv25MemIo6isopenEv:
  829|  76.0k|bool MemIo::isopen() const {
  830|  76.0k|  return true;
  831|  76.0k|}
_ZN5Exiv25MemIo5closeEv:
  833|  76.0k|int MemIo::close() {
  834|  76.0k|  return 0;
  835|  76.0k|}
_ZN5Exiv25MemIo4readEm:
  837|  51.0k|DataBuf MemIo::read(size_t rcount) {
  838|  51.0k|  DataBuf buf(rcount);
  839|  51.0k|  size_t readCount = read(buf.data(), buf.size());
  840|  51.0k|  buf.resize(readCount);
  841|  51.0k|  return buf;
  842|  51.0k|}
_ZN5Exiv25MemIo4readEPhm:
  844|  6.80M|size_t MemIo::read(byte* buf, size_t rcount) {
  845|  6.80M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  846|  6.80M|  const auto allow = std::min<size_t>(rcount, avail);
  847|  6.80M|  if (allow > 0) {
  ------------------
  |  Branch (847:7): [True: 6.65M, False: 149k]
  ------------------
  848|  6.65M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  849|  6.65M|  }
  850|  6.80M|  p_->idx_ += allow;
  851|  6.80M|  if (rcount > avail) {
  ------------------
  |  Branch (851:7): [True: 10.5k, False: 6.79M]
  ------------------
  852|  10.5k|    p_->eof_ = true;
  853|  10.5k|  }
  854|  6.80M|  return allow;
  855|  6.80M|}
_ZN5Exiv25MemIo4getbEv:
  857|   552k|int MemIo::getb() {
  858|   552k|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (858:7): [True: 606, False: 552k]
  ------------------
  859|    606|    p_->eof_ = true;
  860|    606|    return EOF;
  861|    606|  }
  862|   552k|  return p_->data_[p_->idx_++];
  863|   552k|}
_ZNK5Exiv25MemIo5errorEv:
  865|  6.05M|int MemIo::error() const {
  866|  6.05M|  return 0;
  867|  6.05M|}
_ZNK5Exiv25MemIo3eofEv:
  869|  1.36M|bool MemIo::eof() const {
  870|  1.36M|  return p_->eof_;
  871|  1.36M|}
_ZNK5Exiv25MemIo4pathEv:
  873|  13.5k|const std::string& MemIo::path() const noexcept {
  874|  13.5k|  static std::string _path{"MemIo"};
  875|  13.5k|  return _path;
  876|  13.5k|}
_ZN5Exiv25MemIo4ImplC2Ev:
  598|  8.01k|  Impl() = default;                     //!< Default constructor

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

_ZN5Exiv28BmpImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   26|    522|BmpImage::BmpImage(BasicIo::UniquePtr io) : Image(ImageType::bmp, mdNone, std::move(io)) {
   27|    522|}
_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|    512|void BmpImage::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Exiv2::BmpImage::readMetadata: Reading Windows bitmap file " << io_->path() << "\n";
   49|       |#endif
   50|    512|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 512]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|    512|  IoCloser closer(*io_);
   54|       |
   55|       |  // Ensure that this is the correct image type
   56|    512|  if (!isBmpType(*io_, false)) {
  ------------------
  |  Branch (56:7): [True: 0, False: 512]
  ------------------
   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|    512|  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|    512|  byte buf[26];
   83|    512|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (83:7): [True: 512, False: 0]
  ------------------
   84|    512|    pixelWidth_ = getULong(buf + 18, littleEndian);
   85|    512|    pixelHeight_ = getULong(buf + 22, littleEndian);
   86|    512|  }
   87|    512|}
_ZN5Exiv214newBmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
   96|    522|Image::UniquePtr newBmpInstance(BasicIo::UniquePtr io, bool /*create*/) {
   97|    522|  auto image = std::make_unique<BmpImage>(std::move(io));
   98|    522|  if (!image->good()) {
  ------------------
  |  Branch (98:7): [True: 10, False: 512]
  ------------------
   99|     10|    return nullptr;
  100|     10|  }
  101|    512|  return image;
  102|    522|}
_ZN5Exiv29isBmpTypeERNS_7BasicIoEb:
  104|  14.5k|bool isBmpType(BasicIo& iIo, bool advance) {
  105|  14.5k|  const int32_t len = 2;
  106|  14.5k|  const std::array<byte, len> BmpImageId{'B', 'M'};
  107|  14.5k|  std::array<byte, len> buf;
  108|  14.5k|  iIo.read(buf.data(), len);
  109|  14.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (109:7): [True: 0, False: 14.5k]
  |  Branch (109:22): [True: 306, False: 14.2k]
  ------------------
  110|    306|    return false;
  111|    306|  }
  112|  14.2k|  bool matched = buf == BmpImageId;
  113|  14.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (113:7): [True: 14.2k, False: 0]
  |  Branch (113:19): [True: 0, False: 0]
  ------------------
  114|  14.2k|    iIo.seek(-len, BasicIo::cur);
  115|  14.2k|  }
  116|  14.2k|  return matched;
  117|  14.5k|}

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|  34.6k|  static constexpr auto tagList() {
   39|  34.6k|    return tagInfo_;
   40|  34.6k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  2.38k|  static constexpr auto tagListCs() {
   43|  2.38k|    return tagInfoCs_;
   44|  2.38k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  7.60k|  static constexpr auto tagListSi() {
   47|  7.60k|    return tagInfoSi_;
   48|  7.60k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|    748|  static constexpr auto tagListCf() {
   55|    748|    return tagInfoCf_;
   56|    748|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|    256|  static constexpr auto tagListPi() {
   59|    256|    return tagInfoPi_;
   60|    256|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    680|  static constexpr auto tagListTi() {
   63|    680|    return tagInfoTi_;
   64|    680|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|  66.5k|  static constexpr auto tagListFi() {
   67|  66.5k|    return tagInfoFi_;
   68|  66.5k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    762|  static constexpr auto tagListPa() {
   51|    762|    return tagInfoPa_;
   52|    762|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    507|  static constexpr auto tagListPr() {
   71|    507|    return tagInfoPr_;
   72|    507|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    240|  static constexpr auto tagListVigCor2() {
  135|    240|    return tagInfoVigCor2_;
  136|    240|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    416|  static constexpr auto tagListLiOp() {
  139|    416|    return tagInfoLiOp_;
  140|    416|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    100|  static constexpr auto tagListAfMiAdj() {
  127|    100|    return tagInfoAfMiAdj_;
  128|    100|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|   213k|  static constexpr auto tagListLe() {
  143|   213k|    return tagInfoLe_;
  144|   213k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    352|  static constexpr auto tagListAm() {
  147|    352|    return tagInfoAm_;
  148|    352|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    527|  static constexpr auto tagListFil() {
  155|    527|    return tagInfoFil_;
  156|    527|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    380|  static constexpr auto tagListMe() {
  151|    380|    return tagInfoMe_;
  152|    380|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    272|  static constexpr auto tagListHdr() {
  159|    272|    return tagInfoHdr_;
  160|    272|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|  2.90k|  static constexpr auto tagListAfC() {
  163|  2.90k|    return tagInfoAfC_;
  164|  2.90k|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    198|  static constexpr auto tagListRawB() {
  167|    198|    return tagInfoRawB_;
  168|    198|  }

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

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

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  30.1k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  30.1k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  30.1k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  30.1k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 30.1k]
  |  Branch (18:17): [True: 0, False: 30.1k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  30.1k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 3.45k, False: 26.7k]
  |  Branch (22:26): [True: 3.43k, False: 25]
  ------------------
   23|  3.43k|    setByteOrder(littleEndian);
   24|  26.7k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 5.92k, False: 20.8k]
  |  Branch (24:33): [True: 5.89k, False: 36]
  ------------------
   25|  5.89k|    setByteOrder(bigEndian);
   26|  20.8k|  } else {
   27|  20.8k|    return false;
   28|  20.8k|  }
   29|  9.32k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 794, False: 8.52k]
  ------------------
   30|    794|    return false;
   31|  8.52k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  8.52k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 8.28k, False: 248]
  ------------------
   33|  8.28k|    return false;
   34|    248|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|    248|  return true;
   37|  8.52k|}

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

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

_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  126|  8.45k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  127|  8.45k|  return doAdd(std::move(component));
  128|  8.45k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  134|  8.45k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  135|  8.45k|  return components_.emplace_back(std::move(component));
  136|  8.45k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  140|    517|void CiffHeader::read(const byte* pData, size_t size) {
  141|    517|  if (size < 14)
  ------------------
  |  Branch (141:7): [True: 0, False: 517]
  ------------------
  142|      0|    throw Error(ErrorCode::kerNotACrwImage);
  143|       |
  144|    517|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (144:7): [True: 367, False: 150]
  |  Branch (144:26): [True: 367, False: 0]
  ------------------
  145|    367|    byteOrder_ = littleEndian;
  146|    367|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (146:14): [True: 150, False: 0]
  |  Branch (146:33): [True: 150, False: 0]
  ------------------
  147|    150|    byteOrder_ = bigEndian;
  148|    150|  } else {
  149|      0|    throw Error(ErrorCode::kerNotACrwImage);
  150|      0|  }
  151|    517|  offset_ = getULong(pData + 2, byteOrder_);
  152|    517|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (152:7): [True: 12, False: 505]
  |  Branch (152:23): [True: 44, False: 461]
  ------------------
  153|     56|    throw Error(ErrorCode::kerNotACrwImage);
  154|    461|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (154:7): [True: 0, False: 461]
  ------------------
  155|      0|    throw Error(ErrorCode::kerNotACrwImage);
  156|      0|  }
  157|       |
  158|    461|  pPadding_.clear();
  159|    461|  if (offset_ > 14) {
  ------------------
  |  Branch (159:7): [True: 384, False: 77]
  ------------------
  160|    384|    pPadding_.resize(offset_ - 14);
  161|    384|    padded_ = offset_ - 14;
  162|    384|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  163|    384|  }
  164|       |
  165|    461|  pRootDir_ = std::make_unique<CiffDirectory>();
  166|    461|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  167|    461|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  169|  8.67k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  170|  8.67k|  doRead(pData, size, start, byteOrder);
  171|  8.67k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  173|  8.67k|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|  8.67k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (175:11): [True: 8.67k, False: 0]
  |  Branch (175:25): [True: 8.67k, False: 0]
  ------------------
  176|  8.67k|  tag_ = getUShort(pData + start, byteOrder);
  177|       |
  178|  8.67k|  DataLocId dl = dataLocation();
  179|       |
  180|  8.67k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (180:7): [True: 3.55k, False: 5.12k]
  ------------------
  181|  3.55k|    size_ = getULong(pData + start + 2, byteOrder);
  182|  3.55k|    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|  3.55k|    if (offset_ < start) {
  ------------------
  |  Branch (189:9): [True: 3.34k, False: 208]
  ------------------
  190|       |      // Sub-region is before in memory.
  191|  3.34k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  192|  3.34k|    } else {
  193|       |      // Sub-region is after in memory.
  194|    208|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  195|    208|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  196|    208|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  197|    208|    }
  198|  3.55k|  }
  199|  8.67k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (199:7): [True: 5.10k, False: 3.56k]
  ------------------
  200|  5.10k|    size_ = 8;
  201|  5.10k|    offset_ = start + 2;
  202|  5.10k|  }
  203|  8.67k|  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|  8.67k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  211|  1.92k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  212|  1.92k|  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.92k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (216:7): [True: 0, False: 1.92k]
  ------------------
  217|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  218|       |
  219|  1.92k|  readDirectory(pData + offset(), this->size(), byteOrder);
  220|       |#ifdef EXIV2_DEBUG_MESSAGES
  221|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  222|       |#endif
  223|  1.92k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  225|  2.36k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  226|  2.36k|  if (size < 4)
  ------------------
  |  Branch (226:7): [True: 12, False: 2.34k]
  ------------------
  227|     12|    throw Error(ErrorCode::kerCorruptedMetadata);
  228|  2.34k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  229|  2.34k|  if (o > size - 2)
  ------------------
  |  Branch (229:7): [True: 20, False: 2.32k]
  ------------------
  230|     20|    throw Error(ErrorCode::kerCorruptedMetadata);
  231|  2.32k|  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.32k|  o += 2;
  236|  2.32k|  if (count * 10u > size - o)
  ------------------
  |  Branch (236:7): [True: 24, False: 2.30k]
  ------------------
  237|     24|    throw Error(ErrorCode::kerCorruptedMetadata);
  238|       |
  239|  10.9k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (239:24): [True: 8.67k, False: 2.30k]
  ------------------
  240|  8.67k|    uint16_t tag = getUShort(pData + o, byteOrder);
  241|  8.67k|    auto m = [this, tag]() -> UniquePtr {
  242|  8.67k|      if (this->typeId(tag) == TypeId::directory)
  243|  8.67k|        return std::make_unique<CiffDirectory>();
  244|  8.67k|      return std::make_unique<CiffEntry>();
  245|  8.67k|    }();
  246|  8.67k|    m->setDir(this->tag());
  247|  8.67k|    m->read(pData, size, o, byteOrder);
  248|  8.67k|    add(std::move(m));
  249|  8.67k|    o += 10;
  250|  8.67k|  }
  251|  2.30k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  253|    194|void CiffHeader::decode(Image& image) const {
  254|       |  // Nothing to decode from the header itself, just add correct byte order
  255|    194|  if (pRootDir_)
  ------------------
  |  Branch (255:7): [True: 194, False: 0]
  ------------------
  256|    194|    pRootDir_->decode(image, byteOrder_);
  257|    194|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  259|  5.69k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  260|  5.69k|  doDecode(image, byteOrder);
  261|  5.69k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  263|  4.24k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  264|  4.24k|  CrwMap::decode(*this, image, byteOrder);
  265|  4.24k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  267|  1.44k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  268|  5.50k|  for (auto&& component : components_) {
  ------------------
  |  Branch (268:25): [True: 5.50k, False: 1.44k]
  ------------------
  269|  5.50k|    component->decode(image, byteOrder);
  270|  5.50k|  }
  271|  1.44k|}  // CiffDirectory::doDecode
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  435|  9.71k|TypeId CiffComponent::typeId(uint16_t tag) {
  436|  9.71k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (436:11): [True: 9.65k, False: 53]
  ------------------
  437|  2.59k|    case 0x0000:
  ------------------
  |  Branch (437:5): [True: 2.59k, False: 7.11k]
  ------------------
  438|  2.59k|      return unsignedByte;
  439|    824|    case 0x0800:
  ------------------
  |  Branch (439:5): [True: 824, False: 8.88k]
  ------------------
  440|    824|      return asciiString;
  441|    700|    case 0x1000:
  ------------------
  |  Branch (441:5): [True: 700, False: 9.01k]
  ------------------
  442|    700|      return unsignedShort;
  443|  1.25k|    case 0x1800:
  ------------------
  |  Branch (443:5): [True: 1.25k, False: 8.45k]
  ------------------
  444|  1.25k|      return unsignedLong;
  445|  2.36k|    case 0x2000:
  ------------------
  |  Branch (445:5): [True: 2.36k, False: 7.35k]
  ------------------
  446|  2.36k|      return undefined;
  447|    149|    case 0x2800:
  ------------------
  |  Branch (447:5): [True: 149, False: 9.56k]
  ------------------
  448|  1.92k|    case 0x3000:
  ------------------
  |  Branch (448:5): [True: 1.77k, False: 7.93k]
  ------------------
  449|  1.92k|      return directory;
  450|  9.71k|  }
  451|     53|  return invalidTypeId;
  452|  9.71k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  454|  8.67k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  455|  8.67k|  switch (tag & 0xc000) {
  456|  3.55k|    case 0x0000:
  ------------------
  |  Branch (456:5): [True: 3.55k, False: 5.12k]
  ------------------
  457|  3.55k|      return DataLocId::valueData;
  458|  5.10k|    case 0x4000:
  ------------------
  |  Branch (458:5): [True: 5.10k, False: 3.56k]
  ------------------
  459|  5.10k|      return DataLocId::directoryData;
  460|     17|    default:
  ------------------
  |  Branch (460:5): [True: 17, False: 8.65k]
  ------------------
  461|     17|      throw Error(ErrorCode::kerCorruptedMetadata);
  462|  8.67k|  }
  463|  8.67k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  470|    194|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  471|    194|  if (!pRootDir_)
  ------------------
  |  Branch (471:7): [True: 0, False: 194]
  ------------------
  472|      0|    return nullptr;
  473|    194|  return pRootDir_->findComponent(crwTagId, crwDir);
  474|    194|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  476|  5.69k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  477|  5.69k|  return doFindComponent(crwTagId, crwDir);
  478|  5.69k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  480|  4.24k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  481|  4.24k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (481:7): [True: 24, False: 4.22k]
  |  Branch (481:30): [True: 3, False: 21]
  ------------------
  482|      3|    return this;
  483|      3|  }
  484|  4.24k|  return nullptr;
  485|  4.24k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  487|  1.44k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  488|  5.49k|  for (auto&& component : components_) {
  ------------------
  |  Branch (488:25): [True: 5.49k, False: 1.44k]
  ------------------
  489|  5.49k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (489:14): [True: 3, False: 5.49k]
  ------------------
  490|      3|      return cc;
  491|  5.49k|  }
  492|  1.44k|  return nullptr;
  493|  1.44k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  604|  4.24k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  605|  4.24k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  606|  4.24k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (606:7): [True: 426, False: 3.82k]
  |  Branch (606:14): [True: 426, False: 0]
  ------------------
  607|    426|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  608|    426|  }
  609|  4.24k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  611|  4.24k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  612|  88.6k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (612:19): [True: 88.6k, False: 3.82k]
  ------------------
  613|  88.6k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (613:9): [True: 9.74k, False: 78.8k]
  |  Branch (613:34): [True: 426, False: 9.31k]
  ------------------
  614|    426|      return &crw;
  615|    426|    }
  616|  88.6k|  }
  617|  3.82k|  return nullptr;
  618|  4.24k|}  // 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|     51|                          ByteOrder byteOrder) {
  628|     51|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (628:7): [True: 0, False: 51]
  ------------------
  629|      0|    return;
  630|       |
  631|       |  // Make
  632|     51|  ExifKey key1("Exif.Image.Make");
  633|     51|  auto value1 = Value::create(ciffComponent.typeId());
  634|     51|  uint32_t i = 0;
  635|    305|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (635:10): [True: 279, False: 26]
  ------------------
  636|    279|    ++i;
  637|    279|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (637:9): [True: 25, False: 254]
  ------------------
  638|     25|      break;
  639|     25|    }
  640|    279|  }
  641|     51|  value1->read(ciffComponent.pData(), i, byteOrder);
  642|     51|  image.exifData().add(key1, value1.get());
  643|       |
  644|       |  // Model
  645|     51|  ExifKey key2("Exif.Image.Model");
  646|     51|  auto value2 = Value::create(ciffComponent.typeId());
  647|     51|  uint32_t j = i;
  648|    129|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (648:10): [True: 90, False: 39]
  ------------------
  649|     90|    ++i;
  650|     90|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (650:9): [True: 12, False: 78]
  ------------------
  651|     12|      break;
  652|     12|    }
  653|     90|  }
  654|     51|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  655|     51|  image.exifData().add(key2, value2.get());
  656|     51|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  659|     53|                         ByteOrder byteOrder) {
  660|     53|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (660:7): [True: 0, False: 53]
  ------------------
  661|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  662|      0|    return;
  663|      0|  }
  664|       |
  665|     53|  int64_t aperture = 0;
  666|     53|  int64_t shutterSpeed = 0;
  667|       |
  668|     53|  auto ifdId = [pCrwMapping] {
  669|     53|    if (pCrwMapping->tag_ == 0x0001)
  670|     53|      return IfdId::canonCsId;
  671|     53|    if (pCrwMapping->tag_ == 0x0004)
  672|     53|      return IfdId::canonSiId;
  673|     53|    if (pCrwMapping->tag_ == 0x000f)
  674|     53|      return IfdId::canonCfId;
  675|     53|    if (pCrwMapping->tag_ == 0x0012)
  676|     53|      return IfdId::canonPiId;
  677|     53|    return IfdId::ifdIdNotSet;
  678|     53|  }();
  679|       |
  680|     53|  std::string groupName(Internal::groupName(ifdId));
  681|     53|  const size_t component_size = ciffComponent.size();
  682|     53|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  683|     53|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  684|     53|          ErrorCode::kerCorruptedMetadata);
  685|     53|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  686|     53|  uint16_t c = 1;
  687|    212|  while (c < num_components) {
  ------------------
  |  Branch (687:10): [True: 159, False: 53]
  ------------------
  688|    159|    uint16_t n = 1;
  689|    159|    ExifKey key(c, groupName);
  690|    159|    UShortValue value;
  691|    159|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (691:9): [True: 24, False: 135]
  |  Branch (691:38): [True: 0, False: 24]
  |  Branch (691:49): [True: 0, False: 0]
  ------------------
  692|      0|      n = 3;
  693|    159|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  694|    159|    image.exifData().add(key, &value);
  695|    159|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (695:9): [True: 57, False: 102]
  |  Branch (695:38): [True: 0, False: 57]
  ------------------
  696|      0|      aperture = value.toInt64();
  697|    159|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (697:9): [True: 57, False: 102]
  |  Branch (697:38): [True: 0, False: 57]
  ------------------
  698|      0|      shutterSpeed = value.toInt64();
  699|    159|    c += n;
  700|    159|  }
  701|       |
  702|     53|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (702:7): [True: 19, False: 34]
  ------------------
  703|       |    // Exif.Photo.FNumber
  704|     19|    float f = fnumber(canonEv(aperture));
  705|     19|    auto [r, s] = floatToRationalCast(f);
  706|     19|    auto ur = URational(r, s);
  707|     19|    URationalValue fn;
  708|     19|    fn.value_.push_back(ur);
  709|     19|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  710|       |
  711|       |    // Exif.Photo.ExposureTime
  712|     19|    ur = exposureTime(canonEv(shutterSpeed));
  713|     19|    URationalValue et;
  714|     19|    et.value_.push_back(ur);
  715|     19|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  716|     19|  }
  717|     53|}  // CrwMap::decodeArray
_ZN5Exiv28Internal6CrwMap12decode0x180eERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  720|     18|                          ByteOrder byteOrder) {
  721|     18|  if (ciffComponent.size() < 8 || ciffComponent.typeId() != unsignedLong) {
  ------------------
  |  Branch (721:7): [True: 0, False: 18]
  |  Branch (721:35): [True: 0, False: 18]
  ------------------
  722|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  723|      0|    return;
  724|      0|  }
  725|     18|  ULongValue v;
  726|     18|  v.read(ciffComponent.pData(), 8, byteOrder);
  727|     18|  time_t t = v.value_.at(0);
  728|     18|  std::tm r;
  729|       |#ifdef _WIN32
  730|       |  auto tm = localtime_s(&r, &t) ? nullptr : &r;
  731|       |#else
  732|     18|  auto tm = localtime_r(&t, &r);
  733|     18|#endif
  734|     18|  if (!tm)
  ------------------
  |  Branch (734:7): [True: 0, False: 18]
  ------------------
  735|      0|    return;
  736|     18|  const size_t m = 20;
  737|     18|  char s[m];
  738|     18|  std::strftime(s, m, "%Y:%m:%d %T", tm);
  739|       |
  740|     18|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  741|     18|  AsciiValue value;
  742|     18|  value.read(s);
  743|     18|  image.exifData().add(key, &value);
  744|     18|}  // 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|     23|                          ByteOrder /*byteOrder*/) {
  771|     23|  ExifThumb exifThumb(image.exifData());
  772|     23|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  773|     23|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  776|    271|                         ByteOrder byteOrder) {
  777|       |  // create a key and value pair
  778|    271|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  779|    271|  Value::UniquePtr value;
  780|    271|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (780:7): [True: 271, False: 0]
  ------------------
  781|    271|    value = Value::create(ciffComponent.typeId());
  782|    271|    size_t size = 0;
  783|    271|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (783:9): [True: 21, False: 250]
  ------------------
  784|     21|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  785|    250|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (785:16): [True: 90, False: 160]
  ------------------
  786|       |      // determine size from the data, by looking for the first 0
  787|     90|      uint32_t i = 0;
  788|    455|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (788:14): [True: 431, False: 24]
  ------------------
  789|    431|        ++i;
  790|    431|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (790:13): [True: 66, False: 365]
  ------------------
  791|     66|          break;
  792|     66|        }
  793|    431|      }
  794|     90|      size = i;
  795|    160|    } else {
  796|       |      // by default, use the size from the directory entry
  797|    160|      size = ciffComponent.size();
  798|    160|    }
  799|    271|    enforce(size <= ciffComponent.size(), ErrorCode::kerCorruptedMetadata);
  800|    271|    value->read(ciffComponent.pData(), size, byteOrder);
  801|    271|  }
  802|       |  // Add metadatum to exif data
  803|    271|  image.exifData().add(key, value.get());
  804|    271|}  // CrwMap::decodeBasic
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  241|  8.67k|    auto m = [this, tag]() -> UniquePtr {
  242|  8.67k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (242:11): [True: 1.92k, False: 6.74k]
  ------------------
  243|  1.92k|        return std::make_unique<CiffDirectory>();
  244|  6.74k|      return std::make_unique<CiffEntry>();
  245|  8.67k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderEENK3$_0clEv:
  668|     53|  auto ifdId = [pCrwMapping] {
  669|     53|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (669:9): [True: 8, False: 45]
  ------------------
  670|      8|      return IfdId::canonCsId;
  671|     45|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (671:9): [True: 19, False: 26]
  ------------------
  672|     19|      return IfdId::canonSiId;
  673|     26|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (673:9): [True: 8, False: 18]
  ------------------
  674|      8|      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|  1.38k|  [[nodiscard]] const byte* pData() const {
  214|  1.38k|    return pData_;
  215|  1.38k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  5.24k|  [[nodiscard]] size_t size() const {
  204|  5.24k|    return size_;
  205|  5.24k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  10.5k|  static auto signature() {
  419|  10.5k|    return signature_;
  420|  10.5k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  8.67k|  void setDir(uint16_t dir) {
  147|  8.67k|    dir_ = dir;
  148|  8.67k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  4.27k|  [[nodiscard]] uint16_t dir() const {
  184|  4.27k|    return dir_;
  185|  4.27k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|  8.67k|  [[nodiscard]] uint16_t tag() const {
  189|  8.67k|    return tag_;
  190|  8.67k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  3.79k|  [[nodiscard]] size_t offset() const {
  209|  3.79k|    return offset_;
  210|  3.79k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  8.49k|  [[nodiscard]] uint16_t tagId() const {
  219|  8.49k|    return tag_ & 0x3fff;
  220|  8.49k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  1.03k|  [[nodiscard]] TypeId typeId() const {
  224|  1.03k|    return typeId(tag_);
  225|  1.03k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  8.67k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  8.67k|    return dataLocation(tag_);
  230|  8.67k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  9.13k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  9.13k|  virtual ~CiffComponent() = default;

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

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

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

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

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

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

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

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

_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  140|  30.3k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  141|  30.3k|}
_ZN5Exiv25ImageD2Ev:
  143|  30.3k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  181|    358|bool Image::isBigEndianPlatform() {
  182|    358|  return std::endian::native == std::endian::big;
  183|    358|}
_ZN5Exiv25Image8byteSwapEjb:
  205|  1.05k|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.05k|  uint32_t result = 0;
  212|  1.05k|  result |= (value & 0x000000FFU) << 24;
  213|  1.05k|  result |= (value & 0x0000FF00U) << 8;
  214|  1.05k|  result |= (value & 0x00FF0000U) >> 8;
  215|  1.05k|  result |= (value & 0xFF000000U) >> 24;
  216|  1.05k|  return bSwap ? result : value;
  ------------------
  |  Branch (216:10): [True: 0, False: 1.05k]
  ------------------
  217|  1.05k|#endif
  218|  1.05k|}
_ZN5Exiv25Image13clearMetadataEv:
  537|  25.8k|void Image::clearMetadata() {
  538|  25.8k|  clearExifData();
  539|  25.8k|  clearIptcData();
  540|  25.8k|  clearXmpPacket();
  541|  25.8k|  clearXmpData();
  542|  25.8k|  clearComment();
  543|  25.8k|  clearIccProfile();
  544|  25.8k|}
_ZN5Exiv25Image8exifDataEv:
  546|  4.74k|ExifData& Image::exifData() {
  547|  4.74k|  return exifData_;
  548|  4.74k|}
_ZN5Exiv25Image8iptcDataEv:
  550|  2.40k|IptcData& Image::iptcData() {
  551|  2.40k|  return iptcData_;
  552|  2.40k|}
_ZN5Exiv25Image7xmpDataEv:
  554|  10.0k|XmpData& Image::xmpData() {
  555|  10.0k|  return xmpData_;
  556|  10.0k|}
_ZN5Exiv25Image9xmpPacketEv:
  558|  2.15k|std::string& Image::xmpPacket() {
  559|       |  // Serialize the current XMP
  560|  2.15k|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (560:7): [True: 0, False: 2.15k]
  |  Branch (560:28): [True: 0, False: 0]
  ------------------
  561|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  562|      0|  }
  563|  2.15k|  return xmpPacket_;
  564|  2.15k|}
_ZN5Exiv25Image13clearExifDataEv:
  586|  25.8k|void Image::clearExifData() {
  587|  25.8k|  exifData_.clear();
  588|  25.8k|}
_ZN5Exiv25Image13clearIptcDataEv:
  594|  25.8k|void Image::clearIptcData() {
  595|  25.8k|  iptcData_.clear();
  596|  25.8k|}
_ZN5Exiv25Image14clearXmpPacketEv:
  602|  25.8k|void Image::clearXmpPacket() {
  603|  25.8k|  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|  25.8k|  xmpData_.setPacket(std::string());
  609|  25.8k|  writeXmpFromPacket(true);
  610|  25.8k|}
_ZN5Exiv25Image12clearXmpDataEv:
  619|  25.8k|void Image::clearXmpData() {
  620|  25.8k|  xmpData_.clear();
  621|  25.8k|  writeXmpFromPacket(false);
  622|  25.8k|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  630|  51.7k|void Image::writeXmpFromPacket(bool flag) {
  631|  51.7k|  writeXmpFromPacket_ = flag;
  632|  51.7k|}
_ZN5Exiv25Image12clearCommentEv:
  638|  25.8k|void Image::clearComment() {
  639|  25.8k|  comment_.erase();
  640|  25.8k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  642|     91|void Image::setComment(const std::string& comment) {
  643|     91|  comment_ = comment;
  644|     91|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  646|    144|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  647|    144|  iccProfile_ = std::move(iccProfile);
  648|    144|  if (bTestValid) {
  ------------------
  |  Branch (648:7): [True: 144, False: 0]
  ------------------
  649|    144|    checkIccProfile();
  650|    144|  }
  651|    144|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  653|  1.03k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  654|  1.03k|  if (size == 0) {
  ------------------
  |  Branch (654:7): [True: 454, False: 578]
  ------------------
  655|    454|    return;
  656|    454|  }
  657|    578|  const size_t start = iccProfile_.size();
  658|    578|  iccProfile_.resize(Safe::add(start, size));
  659|    578|  memcpy(iccProfile_.data(start), bytes, size);
  660|    578|  if (bTestValid) {
  ------------------
  |  Branch (660:7): [True: 25, False: 553]
  ------------------
  661|     25|    checkIccProfile();
  662|     25|  }
  663|    578|}
_ZNK5Exiv25Image15checkIccProfileEv:
  665|    169|void Image::checkIccProfile() const {
  666|    169|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (666:7): [True: 23, False: 146]
  ------------------
  667|     23|    throw Error(ErrorCode::kerInvalidIccProfile);
  668|     23|  }
  669|    146|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  670|    146|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (670:7): [True: 80, False: 66]
  ------------------
  671|     80|    throw Error(ErrorCode::kerInvalidIccProfile);
  672|     80|  }
  673|    146|}
_ZN5Exiv25Image15clearIccProfileEv:
  675|  25.8k|void Image::clearIccProfile() {
  676|  25.8k|  iccProfile_.reset();
  677|  25.8k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  679|  8.98k|void Image::setByteOrder(ByteOrder byteOrder) {
  680|  8.98k|  byteOrder_ = byteOrder;
  681|  8.98k|}
_ZNK5Exiv25Image9byteOrderEv:
  683|     29|ByteOrder Image::byteOrder() const {
  684|     29|  return byteOrder_;
  685|     29|}
_ZNK5Exiv25Image10pixelWidthEv:
  687|  1.68k|uint32_t Image::pixelWidth() const {
  688|  1.68k|  return pixelWidth_;
  689|  1.68k|}
_ZNK5Exiv25Image11pixelHeightEv:
  691|  1.68k|uint32_t Image::pixelHeight() const {
  692|  1.68k|  return pixelHeight_;
  693|  1.68k|}
_ZNK5Exiv25Image8exifDataEv:
  695|   552k|const ExifData& Image::exifData() const {
  696|   552k|  return exifData_;
  697|   552k|}
_ZNK5Exiv25Image7xmpDataEv:
  703|  14.6k|const XmpData& Image::xmpData() const {
  704|  14.6k|  return xmpData_;
  705|  14.6k|}
_ZNK5Exiv25Image7commentEv:
  707|    706|std::string Image::comment() const {
  708|    706|  return comment_;
  709|    706|}
_ZNK5Exiv25Image2ioEv:
  715|  22.8k|BasicIo& Image::io() const {
  716|  22.8k|  return *io_;
  717|  22.8k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  723|  61.5k|const NativePreviewList& Image::nativePreviews() const {
  724|  61.5k|  return nativePreviews_;
  725|  61.5k|}
_ZNK5Exiv25Image4goodEv:
  727|  30.2k|bool Image::good() const {
  728|  30.2k|  if (io_->open() != 0)
  ------------------
  |  Branch (728:7): [True: 0, False: 30.2k]
  ------------------
  729|      0|    return false;
  730|  30.2k|  IoCloser closer(*io_);
  731|  30.2k|  return ImageFactory::checkType(imageType_, *io_, false);
  732|  30.2k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  782|  30.2k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  783|  30.2k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (783:12): [True: 30.2k, False: 0]
  ------------------
  784|  30.2k|    return r->isThisType_(io, advance);
  785|      0|  return false;
  786|  30.2k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  868|  31.1k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  869|  31.1k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  870|  31.1k|  if (!image)
  ------------------
  |  Branch (870:7): [True: 704, False: 30.4k]
  ------------------
  871|    704|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  872|  30.4k|  return image;
  873|  31.1k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  875|  31.1k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  876|  31.1k|  if (io->open() != 0) {
  ------------------
  |  Branch (876:7): [True: 0, False: 31.1k]
  ------------------
  877|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  878|      0|  }
  879|   565k|  for (const auto& r : registry) {
  ------------------
  |  Branch (879:22): [True: 565k, False: 871]
  ------------------
  880|   565k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (880:9): [True: 30.2k, False: 535k]
  ------------------
  881|  30.2k|      return r.newInstance_(std::move(io), false);
  882|  30.2k|    }
  883|   565k|  }
  884|    871|  return nullptr;
  885|  31.1k|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  923|  8.02k|void append(Blob& blob, const byte* buf, size_t len) {
  924|  8.02k|  if (len != 0) {
  ------------------
  |  Branch (924:7): [True: 8.02k, False: 0]
  ------------------
  925|  8.02k|    Blob::size_type size = blob.size();
  926|  8.02k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (926:9): [True: 473, False: 7.54k]
  ------------------
  927|    473|      blob.reserve(size + 65536);
  928|    473|    }
  929|  8.02k|    blob.resize(size + len);
  930|  8.02k|    std::copy_n(buf, len, blob.begin() + size);
  931|  8.02k|  }
  932|  8.02k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   542k|  bool operator==(const ImageType& imageType) const {
   67|   542k|    return imageType == imageType_;
   68|   542k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  36.0k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  36.0k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 31.9k, False: 4.15k]
  ------------------
   58|  31.9k|    value_ = pValue->clone();
   59|  36.0k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|  36.7k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|  36.7k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 36.7k, False: 0]
  ------------------
   63|  36.7k|    key_ = rhs.key_->clone();  // deep copy
   64|  36.7k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 36.7k, False: 0]
  ------------------
   65|  36.7k|    value_ = rhs.value_->clone();  // deep copy
   66|  36.7k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|  72.7k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum6recordEv:
   86|  84.2k|uint16_t Iptcdatum::record() const {
   87|  84.2k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 84.2k, False: 0]
  ------------------
   88|  84.2k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   268k|uint16_t Iptcdatum::tag() const {
  111|   268k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 268k, False: 0]
  ------------------
  112|   268k|}
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|    218|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|    218|  setValue(value);
  188|    218|  return *this;
  189|    218|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  4.18k|int Iptcdatum::setValue(const std::string& value) {
  203|  4.18k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 4.15k, False: 33]
  ------------------
  204|  4.15k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  4.15k|    value_ = Value::create(type);
  206|  4.15k|  }
  207|  4.18k|  return value_->read(value);
  208|  4.18k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|    218|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|    218|  IptcKey iptcKey(key);
  212|    218|  auto pos = findKey(iptcKey);
  213|    218|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 185, False: 33]
  ------------------
  214|    185|    return iptcMetadata_.emplace_back(iptcKey);
  215|    185|  }
  216|     33|  return *pos;
  217|    218|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  31.9k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  31.9k|  return add(Iptcdatum(key, value));
  236|  31.9k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  35.8k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  35.8k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 20.8k, False: 14.9k]
  |  Branch (239:7): [True: 19.6k, False: 16.2k]
  ------------------
  240|  20.8k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 19.6k, False: 1.26k]
  ------------------
  241|  19.6k|    return 6;
  242|  19.6k|  }
  243|       |  // allow duplicates
  244|  16.2k|  iptcMetadata_.push_back(iptcDatum);
  245|  16.2k|  return 0;
  246|  35.8k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|    400|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|    400|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|    400|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  20.8k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  20.8k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  20.8k|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  1.37k|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.37k|  auto pRead = pData;
  367|  1.37k|  const auto pEnd = pData + size;
  368|  1.37k|  iptcData.clear();
  369|       |
  370|  1.37k|  uint16_t record = 0;
  371|  1.37k|  uint16_t dataSet = 0;
  372|  1.37k|  uint32_t sizeData = 0;
  373|  1.37k|  byte extTest = 0;
  374|       |
  375|  1.50M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.50M, False: 800]
  ------------------
  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.50M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.47M, False: 32.4k]
  ------------------
  380|  1.47M|      continue;
  381|  32.4k|    record = *pRead++;
  382|  32.4k|    dataSet = *pRead++;
  383|       |
  384|  32.4k|    extTest = *pRead;
  385|  32.4k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 2.66k, False: 29.8k]
  ------------------
  386|       |      // extended dataset
  387|  2.66k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  2.66k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 128, False: 2.53k]
  ------------------
  389|    128|        return 5;
  390|  2.53k|      pRead += 2;
  391|  2.53k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 36, False: 2.50k]
  ------------------
  392|     36|        return 6;
  393|  2.50k|      sizeData = 0;
  394|  8.42k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 5.92k, False: 2.50k]
  ------------------
  395|  5.92k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  5.92k|      }
  397|  29.8k|    } else {
  398|       |      // standard dataset
  399|  29.8k|      sizeData = getUShort(pRead, bigEndian);
  400|  29.8k|      pRead += 2;
  401|  29.8k|    }
  402|  32.3k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 31.9k, False: 414]
  ------------------
  403|  31.9k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  31.9k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 31.9k]
  ------------------
  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|  31.9k|    } else {
  410|    414|#ifndef SUPPRESS_WARNINGS
  411|    414|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    414|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 414]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    414|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    414|#endif
  413|    414|      return 7;
  414|    414|    }
  415|  31.9k|    pRead += sizeData;
  416|  31.9k|  }
  417|       |
  418|    800|  return 0;
  419|  1.37k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  4.00k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  4.00k|  DataBuf buf;
  423|  4.00k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 4.00k, False: 0]
  ------------------
  424|  4.00k|    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.00k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   207k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   207k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 23.3k, False: 184k]
  |  Branch (42:43): [True: 19.6k, False: 3.75k]
  ------------------
   43|   207k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  21.2k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  21.2k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  31.9k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  31.9k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  31.9k|  auto value = Exiv2::Value::create(type);
  466|  31.9k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  31.9k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 17.7k, False: 14.1k]
  ------------------
  468|  17.7k|    Exiv2::IptcKey key(dataSet, record);
  469|  17.7k|    iptcData.add(key, value.get());
  470|  17.7k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 14.1k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  14.1k|    value = Exiv2::Value::create(Exiv2::string);
  473|  14.1k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  14.1k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 14.1k, False: 0]
  ------------------
  475|  14.1k|      Exiv2::IptcKey key(dataSet, record);
  476|  14.1k|      iptcData.add(key, value.get());
  477|  14.1k|    }
  478|  14.1k|  }
  479|  31.9k|  return rc;
  480|  31.9k|}

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    162|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|    162|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 10, False: 152]
  |  Branch (15:29): [True: 11, False: 141]
  ------------------
   16|     21|    return false;
   17|     21|  }
   18|       |
   19|    141|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    141|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    141|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    141|  bool clWithRightBrand = false;
   24|  1.47k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.37k, False: 95]
  ------------------
   25|  1.37k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.37k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 499, False: 880]
  |  Branch (26:31): [True: 21, False: 478]
  |  Branch (26:66): [True: 241, False: 1.11k]
  |  Branch (26:87): [True: 25, False: 216]
  ------------------
   27|     46|      clWithRightBrand = true;
   28|     46|      break;
   29|     46|    }
   30|  1.37k|  }
   31|    141|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 43, False: 98]
  |  Branch (31:32): [True: 21, False: 22]
  ------------------
   32|    162|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEEbPKhm:
  116|  1.07k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
  117|  1.07k|  if (create) {
  ------------------
  |  Branch (117:7): [True: 0, False: 1.07k]
  ------------------
  118|      0|    initImage(initData, dataSize);
  119|      0|  }
  120|  1.07k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  133|  29.6k|byte JpegBase::advanceToMarker(ErrorCode err) const {
  134|  29.6k|  int c = -1;
  135|       |  // Skips potential padding between markers
  136|   519k|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (136:10): [True: 490k, False: 29.1k]
  ------------------
  137|   490k|    if (c == EOF)
  ------------------
  |  Branch (137:9): [True: 572, False: 489k]
  ------------------
  138|    572|      throw Error(err);
  139|   490k|  }
  140|       |
  141|       |  // Markers can start with any number of 0xff
  142|  32.7k|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (142:10): [True: 3.63k, False: 29.1k]
  ------------------
  143|  3.63k|  }
  144|  29.1k|  if (c == EOF)
  ------------------
  |  Branch (144:7): [True: 34, False: 29.0k]
  ------------------
  145|     34|    throw Error(err);
  146|       |
  147|  29.0k|  return static_cast<byte>(c);
  148|  29.1k|}
_ZN5Exiv28JpegBase12readMetadataEv:
  150|  1.07k|void JpegBase::readMetadata() {
  151|  1.07k|  int rc = 0;  // Todo: this should be the return value
  152|       |
  153|  1.07k|  if (io_->open() != 0)
  ------------------
  |  Branch (153:7): [True: 0, False: 1.07k]
  ------------------
  154|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  155|  1.07k|  IoCloser closer(*io_);
  156|       |  // Ensure that this is the correct image type
  157|  1.07k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (157:7): [True: 91, False: 980]
  ------------------
  158|     91|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (158:9): [True: 0, False: 91]
  |  Branch (158:25): [True: 0, False: 91]
  ------------------
  159|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  160|     91|    throw Error(ErrorCode::kerNotAJpeg);
  161|     91|  }
  162|    980|  clearMetadata();
  163|    980|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  164|    980|  Blob psBlob;
  165|    980|  bool foundCompletePsData = false;
  166|    980|  bool foundExifData = false;
  167|    980|  bool foundXmpData = false;
  168|    980|  bool foundIccData = false;
  169|       |
  170|       |  // Read section marker
  171|    980|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  172|       |
  173|  29.1k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (173:10): [True: 29.0k, False: 77]
  |  Branch (173:28): [True: 29.0k, False: 11]
  |  Branch (173:46): [True: 29.0k, False: 9]
  ------------------
  174|  29.0k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  175|       |
  176|       |    // Read the rest of the segment.
  177|  29.0k|    DataBuf buf(size);
  178|       |    // check if the segment is not empty
  179|  29.0k|    if (size > 2) {
  ------------------
  |  Branch (179:9): [True: 22.8k, False: 6.16k]
  ------------------
  180|  22.8k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  181|  22.8k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  182|  22.8k|    }
  183|       |
  184|  29.0k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (184:14): [True: 5.54k, False: 23.5k]
  ------------------
  185|  5.54k|      sof_encoding_process_ = itSofMarker->label_;
  186|  5.54k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (186:11): [True: 4.42k, False: 1.12k]
  |  Branch (186:24): [True: 4.04k, False: 378]
  ------------------
  187|  4.04k|        num_color_components_ = *buf.c_data(7);
  188|  4.04k|      }
  189|  5.54k|    }
  190|       |
  191|  29.0k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (191:9): [True: 28.5k, False: 518]
  |  Branch (191:27): [True: 632, False: 27.8k]
  |  Branch (191:46): [True: 588, False: 44]
  ------------------
  192|    588|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (192:12): [True: 40, False: 548]
  ------------------
  193|     40|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8);
  194|     40|      setByteOrder(bo);
  195|     40|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (195:11): [True: 19, False: 21]
  |  Branch (195:23): [True: 0, False: 19]
  ------------------
  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|     40|      --search;
  202|     40|      foundExifData = true;
  203|  29.0k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (203:16): [True: 28.6k, False: 356]
  |  Branch (203:33): [True: 555, False: 28.0k]
  |  Branch (203:52): [True: 270, False: 285]
  ------------------
  204|    270|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (204:19): [True: 35, False: 235]
  ------------------
  205|     35|      xmpPacket_.assign(buf.c_str(31), size - 31);
  206|     35|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (206:11): [True: 25, False: 10]
  |  Branch (206:34): [True: 22, False: 3]
  ------------------
  207|     22|#ifndef SUPPRESS_WARNINGS
  208|     22|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     22|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 22]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     22|  LogMsg(LogMsg::warn).os()
  ------------------
  209|     22|#endif
  210|     22|      }
  211|     35|      --search;
  212|     35|      foundXmpData = true;
  213|  28.9k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (213:16): [True: 28.4k, False: 475]
  |  Branch (213:40): [True: 13.1k, False: 15.3k]
  ------------------
  214|  13.1k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (214:16): [True: 12.8k, False: 254]
  ------------------
  215|  12.8k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (215:19): [True: 10.7k, False: 2.12k]
  ------------------
  216|       |#ifdef EXIV2_DEBUG_MESSAGES
  217|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  218|       |#endif
  219|  10.7k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (219:11): [True: 7.93k, False: 2.80k]
  ------------------
  220|  7.93k|        append(psBlob, buf.c_data(16), size - 16);
  221|  7.93k|      }
  222|       |      // Check whether psBlob is complete
  223|  10.7k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (223:11): [True: 10.4k, False: 326]
  |  Branch (223:30): [True: 88, False: 10.3k]
  ------------------
  224|     88|        --search;
  225|     88|        foundCompletePsData = true;
  226|     88|      }
  227|  18.2k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (227:16): [True: 734, False: 17.4k]
  |  Branch (227:34): [True: 232, False: 502]
  ------------------
  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|    232|      comment_.assign(buf.c_str(2), size - 2);
  232|  1.03k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (232:14): [True: 870, False: 167]
  |  Branch (232:35): [True: 805, False: 65]
  ------------------
  233|    805|        comment_.pop_back();
  234|    805|      }
  235|    232|      --search;
  236|  18.0k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (236:16): [True: 1.79k, False: 16.2k]
  |  Branch (236:35): [True: 1.58k, False: 205]
  ------------------
  237|  1.58k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (237:19): [True: 1.05k, False: 531]
  ------------------
  238|  1.05k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (238:11): [True: 9, False: 1.04k]
  ------------------
  239|      9|        rc = 8;
  240|      9|        break;
  241|      9|      }
  242|       |      // ICC profile
  243|  1.04k|      if (!foundIccData) {
  ------------------
  |  Branch (243:11): [True: 85, False: 963]
  ------------------
  244|     85|        foundIccData = true;
  245|     85|        --search;
  246|     85|      }
  247|  1.04k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  248|  1.04k|      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.04k|      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.04k|      size_t icc_size = size - 2 - 14;
  260|  1.04k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (260:11): [True: 874, False: 174]
  |  Branch (260:25): [True: 475, False: 399]
  ------------------
  261|    475|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  262|    475|        icc_size = s;
  263|    475|      }
  264|       |
  265|  1.04k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  266|  16.9k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (266:16): [True: 10.8k, False: 6.09k]
  |  Branch (266:37): [True: 620, False: 10.2k]
  ------------------
  267|       |      // We hit a SOFn (start-of-frame) marker
  268|    620|      if (size < 8) {
  ------------------
  |  Branch (268:11): [True: 26, False: 594]
  ------------------
  269|     26|        rc = 7;
  270|     26|        break;
  271|     26|      }
  272|    594|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  273|    594|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  274|    594|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (274:11): [True: 147, False: 447]
  ------------------
  275|    147|        --search;
  276|    594|    }
  277|       |
  278|       |    // Read the beginning of the next segment
  279|  29.0k|    try {
  280|  29.0k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  281|  29.0k|    } catch (const Error&) {
  282|    546|      rc = 5;
  283|    546|      break;
  284|    546|    }
  285|  29.0k|  }  // while there are segments to process
  286|       |
  287|    678|  if (!psBlob.empty()) {
  ------------------
  |  Branch (287:7): [True: 250, False: 428]
  ------------------
  288|       |    // Find actual IPTC data within the psBlob
  289|    250|    Blob iptcBlob;
  290|    250|    const byte* record = nullptr;
  291|    250|    uint32_t sizeIptc = 0;
  292|    250|    uint32_t sizeHdr = 0;
  293|    250|    const byte* pCur = psBlob.data();
  294|    250|    const byte* pEnd = pCur + psBlob.size();
  295|    355|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (295:12): [True: 336, False: 19]
  |  Branch (295:27): [True: 105, False: 231]
  ------------------
  296|       |#ifdef EXIV2_DEBUG_MESSAGES
  297|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  298|       |#endif
  299|    105|      if (sizeIptc) {
  ------------------
  |  Branch (299:11): [True: 90, False: 15]
  ------------------
  300|     90|        append(iptcBlob, record + sizeHdr, sizeIptc);
  301|     90|      }
  302|    105|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  303|    105|    }
  304|    250|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (304:9): [True: 88, False: 162]
  |  Branch (304:30): [True: 37, False: 51]
  ------------------
  305|     37|#ifndef SUPPRESS_WARNINGS
  306|     37|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     37|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 37]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     37|  LogMsg(LogMsg::warn).os()
  ------------------
  307|     37|#endif
  308|     37|      iptcData_.clear();
  309|     37|    }
  310|    250|  }
  311|       |
  312|    678|  if (rc != 0) {
  ------------------
  |  Branch (312:7): [True: 581, False: 97]
  ------------------
  313|    581|#ifndef SUPPRESS_WARNINGS
  314|    581|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    581|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 581]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    581|  LogMsg(LogMsg::warn).os()
  ------------------
  315|    581|#endif
  316|    581|  }
  317|    678|}  // JpegBase::readMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  968|    991|    JpegBase(ImageType::jpeg, std::move(io), create, blank_, sizeof(blank_)) {
  969|    991|}
_ZNK5Exiv29JpegImage8mimeTypeEv:
  971|  1.38k|std::string JpegImage::mimeType() const {
  972|  1.38k|  return "image/jpeg";
  973|  1.38k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  987|    991|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  988|    991|  return isJpegType(iIo, advance);
  989|    991|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  991|    895|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, bool create) {
  992|    895|  auto image = std::make_unique<JpegImage>(std::move(io), create);
  993|    895|  if (!image->good()) {
  ------------------
  |  Branch (993:7): [True: 0, False: 895]
  ------------------
  994|      0|    return nullptr;
  995|      0|  }
  996|    895|  return image;
  997|    895|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
  999|  33.0k|bool isJpegType(BasicIo& iIo, bool advance) {
 1000|  33.0k|  bool result = true;
 1001|  33.0k|  byte tmpBuf[2];
 1002|  33.0k|  iIo.read(tmpBuf, 2);
 1003|  33.0k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1003:7): [True: 0, False: 33.0k]
  |  Branch (1003:22): [True: 31, False: 32.9k]
  ------------------
 1004|     31|    return false;
 1005|       |
 1006|  32.9k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1006:7): [True: 30.0k, False: 2.95k]
  |  Branch (1006:28): [True: 263, False: 2.69k]
  ------------------
 1007|  30.3k|    result = false;
 1008|  30.3k|  }
 1009|  32.9k|  if (!advance || !result)
  ------------------
  |  Branch (1009:7): [True: 32.0k, False: 991]
  |  Branch (1009:19): [True: 91, False: 900]
  ------------------
 1010|  32.0k|    iIo.seek(-2, BasicIo::cur);
 1011|  32.9k|  return result;
 1012|  33.0k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
 1015|     80|    JpegBase(ImageType::exv, std::move(io), create, blank_, sizeof(blank_)) {
 1016|     80|}
_ZNK5Exiv28ExvImage8mimeTypeEv:
 1018|      3|std::string ExvImage::mimeType() const {
 1019|      3|  return "image/x-exv";
 1020|      3|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1033|     80|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1034|     80|  return isExvType(iIo, advance);
 1035|     80|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1037|     80|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, bool create) {
 1038|     80|  auto image = std::make_unique<ExvImage>(std::move(io), create);
 1039|     80|  if (!image->good())
  ------------------
  |  Branch (1039:7): [True: 0, False: 80]
  ------------------
 1040|      0|    return nullptr;
 1041|     80|  return image;
 1042|     80|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1044|  30.4k|bool isExvType(BasicIo& iIo, bool advance) {
 1045|  30.4k|  bool result = true;
 1046|  30.4k|  byte tmpBuf[7];
 1047|  30.4k|  iIo.read(tmpBuf, 7);
 1048|  30.4k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1048:7): [True: 0, False: 30.4k]
  |  Branch (1048:22): [True: 75, False: 30.3k]
  ------------------
 1049|     75|    return false;
 1050|       |
 1051|  30.3k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1051:7): [True: 29.9k, False: 382]
  |  Branch (1051:28): [True: 116, False: 266]
  |  Branch (1051:49): [True: 26, False: 240]
  ------------------
 1052|  30.0k|    result = false;
 1053|  30.0k|  }
 1054|  30.3k|  if (!advance || !result)
  ------------------
  |  Branch (1054:7): [True: 30.2k, False: 80]
  |  Branch (1054:19): [True: 0, False: 80]
  ------------------
 1055|  30.2k|    iIo.seek(-7, BasicIo::cur);
 1056|  30.3k|  return result;
 1057|  30.4k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  29.0k|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  29.0k|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  29.0k|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  29.0k|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 23.8k, False: 5.23k]
  ------------------
  107|  23.8k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|  23.8k|    size = getUShort(buf.data(), bigEndian);
  109|  23.8k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|  23.8k|  }
  111|  29.0k|  return {buf, size};
  112|  29.0k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  10.8k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  10.8k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 293, False: 10.5k]
  |  Branch (92:38): [True: 327, False: 10.2k]
  ------------------
   93|  10.8k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  21.3k|constexpr bool inRange(int lo, int value, int hi) {
   88|  21.3k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 19.5k, False: 1.85k]
  |  Branch (88:25): [True: 620, False: 18.9k]
  ------------------
   89|  21.3k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  29.0k|bool markerHasLength(byte m) {
   99|  29.0k|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 21.7k, False: 7.33k]
  |  Branch (99:44): [True: 5.23k, False: 16.4k]
  ------------------
  100|  29.0k|  return !markerWithoutLength;
  101|  29.0k|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  599|  3.01k|MatroskaVideo::MatroskaVideo(BasicIo::UniquePtr io) : Image(ImageType::mkv, mdNone, std::move(io)) {
  600|  3.01k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  602|  8.22k|std::string MatroskaVideo::mimeType() const {
  603|  8.22k|  return "video/matroska";
  604|  8.22k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  609|  3.01k|void MatroskaVideo::readMetadata() {
  610|  3.01k|  if (io_->open() != 0)
  ------------------
  |  Branch (610:7): [True: 0, False: 3.01k]
  ------------------
  611|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  612|       |
  613|       |  // Ensure that this is the correct image type
  614|  3.01k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 3.01k]
  ------------------
  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.01k|  IoCloser closer(*io_);
  621|  3.01k|  clearMetadata();
  622|  3.01k|  continueTraversing_ = true;
  623|  3.01k|  height_ = width_ = 1;
  624|       |
  625|  3.01k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  626|  3.01k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  627|       |
  628|  77.9k|  while (continueTraversing_)
  ------------------
  |  Branch (628:10): [True: 74.9k, False: 3.01k]
  ------------------
  629|  74.9k|    decodeBlock();
  630|       |
  631|  3.01k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  632|  3.01k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  634|  74.9k|void MatroskaVideo::decodeBlock() {
  635|  74.9k|  byte buf[8];
  636|  74.9k|  io_->read(buf, 1);
  637|       |
  638|  74.9k|  if (io_->eof()) {
  ------------------
  |  Branch (638:7): [True: 290, False: 74.6k]
  ------------------
  639|    290|    continueTraversing_ = false;
  640|    290|    return;
  641|    290|  }
  642|       |
  643|  74.6k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  644|  74.6k|  if (block_size > 0)
  ------------------
  |  Branch (644:7): [True: 74.1k, False: 465]
  ------------------
  645|  74.1k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  646|       |
  647|  74.6k|  auto tag_id = returnTagValue(buf, block_size);
  648|  74.6k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  649|       |
  650|  74.6k|  if (!tag) {
  ------------------
  |  Branch (650:7): [True: 1.54k, False: 73.1k]
  ------------------
  651|  1.54k|    continueTraversing_ = false;
  652|  1.54k|    return;
  653|  1.54k|  }
  654|       |
  655|       |  // tag->dump(std::cout);
  656|       |
  657|  73.1k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (657:7): [True: 533, False: 72.5k]
  |  Branch (657:27): [True: 1, False: 72.5k]
  ------------------
  658|     12|    continueTraversing_ = false;
  659|     12|    return;
  660|     12|  }
  661|       |
  662|  73.1k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  663|  73.1k|  block_size = findBlockSize(buf[0]);  // 0-8
  664|       |
  665|  73.1k|  if (block_size > 0)
  ------------------
  |  Branch (665:7): [True: 72.4k, False: 622]
  ------------------
  666|  72.4k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  667|  73.1k|  size_t size = returnTagValue(buf, block_size);
  668|       |
  669|  73.1k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (669:7): [True: 31.0k, False: 42.0k]
  |  Branch (669:29): [True: 31.0k, False: 0]
  ------------------
  670|  31.0k|    return;
  671|       |
  672|  42.0k|  const size_t bufMaxSize = 200;
  673|       |
  674|  42.0k|#ifndef SUPPRESS_WARNINGS
  675|  42.0k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (675:7): [True: 40.4k, False: 1.54k]
  |  Branch (675:28): [True: 169, False: 40.2k]
  ------------------
  676|    169|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    169|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 169]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    169|  LogMsg(LogMsg::warn).os()
  ------------------
  677|      0|                << bufMaxSize << ": ignoring it.\n";
  678|    169|  }
  679|  42.0k|#endif
  680|  42.0k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (680:7): [True: 1.54k, False: 40.4k]
  |  Branch (680:27): [True: 169, False: 40.2k]
  ------------------
  681|  1.07k|    io_->seek(size, BasicIo::cur);
  682|  1.07k|    return;
  683|  1.07k|  }
  684|       |
  685|  40.9k|  DataBuf buf2(bufMaxSize + 1);
  686|  40.9k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  687|  40.9k|  switch (tag->_type) {
  688|  9.97k|    case InternalField:
  ------------------
  |  Branch (688:5): [True: 9.97k, False: 30.9k]
  ------------------
  689|  9.97k|      decodeInternalTags(tag, buf2.data());
  690|  9.97k|      break;
  691|  2.45k|    case String:
  ------------------
  |  Branch (691:5): [True: 2.45k, False: 38.4k]
  ------------------
  692|  2.45k|    case Utf8:
  ------------------
  |  Branch (692:5): [True: 0, False: 40.9k]
  ------------------
  693|  2.45k|      decodeStringTags(tag, buf2.data());
  694|  2.45k|      break;
  695|  2.47k|    case Integer:
  ------------------
  |  Branch (695:5): [True: 2.47k, False: 38.4k]
  ------------------
  696|  3.32k|    case UInteger:
  ------------------
  |  Branch (696:5): [True: 849, False: 40.0k]
  ------------------
  697|  3.32k|      decodeIntegerTags(tag, buf2.data());
  698|  3.32k|      break;
  699|  20.8k|    case Boolean:
  ------------------
  |  Branch (699:5): [True: 20.8k, False: 20.0k]
  ------------------
  700|  20.8k|      decodeBooleanTags(tag, buf2.data());
  701|  20.8k|      break;
  702|  1.35k|    case Date:
  ------------------
  |  Branch (702:5): [True: 1.35k, False: 39.5k]
  ------------------
  703|  1.35k|      decodeDateTags(tag, buf2.data(), size);
  704|  1.35k|      break;
  705|  2.10k|    case Float:
  ------------------
  |  Branch (705:5): [True: 2.10k, False: 38.8k]
  ------------------
  706|  2.10k|      decodeFloatTags(tag, buf2.data());
  707|  2.10k|      break;
  708|      0|    case Binary:
  ------------------
  |  Branch (708:5): [True: 0, False: 40.9k]
  ------------------
  709|      0|      break;
  710|      0|    case Master:
  ------------------
  |  Branch (710:5): [True: 0, False: 40.9k]
  ------------------
  711|      0|      break;
  712|      0|    default:
  ------------------
  |  Branch (712:5): [True: 0, False: 40.9k]
  ------------------
  713|      0|      break;
  714|  40.9k|  }
  715|  40.9k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  717|  9.97k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  718|  9.97k|  uint64_t key = getULongLong(buf, bigEndian);
  719|  9.97k|  if (!key)
  ------------------
  |  Branch (719:7): [True: 353, False: 9.62k]
  ------------------
  720|    353|    return;
  721|       |
  722|  9.62k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  9.62k|    switch (tag->_id) {
  724|  9.62k|      case Xmp_video_VideoScanTpye:
  725|  9.62k|        return Exiv2::find(videoScanType, key);
  726|  9.62k|      case Xmp_audio_ChannelType:
  727|  9.62k|        return Exiv2::find(audioChannels, key);
  728|  9.62k|      case Xmp_video_ContentCompressAlgo:
  729|  9.62k|        return Exiv2::find(compressionAlgorithm, key);
  730|  9.62k|      case Xmp_video_ContentEncryptAlgo:
  731|  9.62k|        return Exiv2::find(encryptionAlgorithm, key);
  732|  9.62k|      case Xmp_video_ContentSignAlgo_1:
  733|  9.62k|      case Xmp_video_ContentSignAlgo_2:
  734|  9.62k|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|  9.62k|      case Xmp_video_ContentSignHashAlgo_1:
  736|  9.62k|      case Xmp_video_ContentSignHashAlgo_2:
  737|  9.62k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  9.62k|      case Xmp_video_ContentEncodingType:
  739|  9.62k|        return Exiv2::find(encodingType, key);
  740|  9.62k|      case Xmp_video_DisplayUnit:
  741|  9.62k|        return Exiv2::find(displayUnit, key);
  742|  9.62k|      case Xmp_video_AspectRatioType:
  743|  9.62k|        return Exiv2::find(aspectRatioType, key);
  744|  9.62k|      case Xmp_video_PhysicalEquivalent:
  745|  9.62k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|  9.62k|      case Xmp_video_TranslateCodec:
  747|  9.62k|        return Exiv2::find(chapterTranslateCodec, key);
  748|  9.62k|      case Video_Audio_CodecID:
  749|  9.62k|        return Exiv2::find(trackCodec, key);
  750|  9.62k|      case Video_Audio_CodecName:
  751|  9.62k|        return Exiv2::find(codecInfo, key);
  752|  9.62k|      case CodecDownloadURL:
  753|  9.62k|      case CodecInfoURL:
  754|  9.62k|        return Exiv2::find(codecDownloadUrl, key);
  755|  9.62k|    }
  756|  9.62k|    return nullptr;
  757|  9.62k|  }();
  758|  9.62k|  if (internalMt) {
  ------------------
  |  Branch (758:7): [True: 3.91k, False: 5.71k]
  ------------------
  759|  3.91k|    xmpData_[tag->_label] = internalMt->_label;
  760|  5.71k|  } else {
  761|  5.71k|    xmpData_[tag->_label] = key;
  762|  5.71k|  }
  763|  9.62k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  765|  2.45k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  766|  2.45k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (766:7): [True: 198, False: 2.25k]
  ------------------
  767|    198|    track_count_++;
  768|    198|    xmpData_[tag->_label] = track_count_;
  769|  2.25k|  } else {
  770|  2.25k|    xmpData_[tag->_label] = buf;
  771|  2.25k|  }
  772|  2.45k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  774|  3.32k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  775|  3.32k|  uint64_t value = getULongLong(buf, bigEndian);
  776|  3.32k|  if (!value)
  ------------------
  |  Branch (776:7): [True: 484, False: 2.84k]
  ------------------
  777|    484|    return;
  778|       |
  779|  2.84k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (779:7): [True: 427, False: 2.41k]
  |  Branch (779:40): [True: 206, False: 2.21k]
  ------------------
  780|    633|    width_ = value;
  781|  2.84k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (781:7): [True: 888, False: 1.95k]
  |  Branch (781:41): [True: 588, False: 1.36k]
  ------------------
  782|  1.47k|    height_ = value;
  783|  2.84k|  xmpData_[tag->_label] = value;
  784|  2.84k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  786|  20.8k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  787|  20.8k|  const MatroskaTag* internalMt = nullptr;
  788|  20.8k|  uint64_t key = getULongLong(buf, bigEndian);
  789|  20.8k|  if (!key)
  ------------------
  |  Branch (789:7): [True: 489, False: 20.3k]
  ------------------
  790|    489|    return;
  791|       |
  792|  20.3k|  switch (tag->_id) {
  793|  6.01k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (793:5): [True: 6.01k, False: 14.3k]
  ------------------
  794|  6.01k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (794:16): [True: 2.00k, False: 4.00k]
  ------------------
  795|  2.00k|        stream_ = f->_id;
  796|  2.00k|      }
  797|  6.01k|      break;
  798|    800|    case TrackUsed:
  ------------------
  |  Branch (798:5): [True: 800, False: 19.5k]
  ------------------
  799|    800|      internalMt = Exiv2::find(trackEnable, key);
  800|    800|      break;
  801|  9.15k|    case TrackDefault:
  ------------------
  |  Branch (801:5): [True: 9.15k, False: 11.1k]
  ------------------
  802|  9.15k|      internalMt = Exiv2::find(defaultOn, key);
  803|  9.15k|      break;
  804|  1.37k|    case TrackForced:
  ------------------
  |  Branch (804:5): [True: 1.37k, False: 18.9k]
  ------------------
  805|  1.37k|      internalMt = Exiv2::find(trackForced, key);
  806|  1.37k|      break;
  807|  1.26k|    case TrackLacing:
  ------------------
  |  Branch (807:5): [True: 1.26k, False: 19.0k]
  ------------------
  808|  1.26k|      internalMt = Exiv2::find(trackLacing, key);
  809|  1.26k|      break;
  810|  1.49k|    case CodecDecodeAll:
  ------------------
  |  Branch (810:5): [True: 1.49k, False: 18.8k]
  ------------------
  811|  1.49k|      internalMt = Exiv2::find(codecDecodeAll, key);
  812|  1.49k|      break;
  813|    191|    case CodecSettings:
  ------------------
  |  Branch (813:5): [True: 191, False: 20.1k]
  ------------------
  814|    191|      internalMt = Exiv2::find(codecSettings, key);
  815|    191|      break;
  816|     53|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (816:5): [True: 53, False: 20.2k]
  ------------------
  817|     53|      internalMt = tag;
  818|     53|      break;
  819|      0|    default:
  ------------------
  |  Branch (819:5): [True: 0, False: 20.3k]
  ------------------
  820|      0|      break;
  821|  20.3k|  }
  822|       |
  823|  20.3k|  if (internalMt) {
  ------------------
  |  Branch (823:7): [True: 2.86k, False: 17.4k]
  ------------------
  824|  2.86k|    xmpData_[internalMt->_label] = "Yes";
  825|  2.86k|  }
  826|  20.3k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  828|  1.35k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  829|  1.35k|  int64_t duration_in_ms = 0;
  830|  1.35k|  uint64_t value;
  831|  1.35k|  switch (tag->_id) {
  832|    494|    case Xmp_video_Duration:
  ------------------
  |  Branch (832:5): [True: 494, False: 860]
  ------------------
  833|    494|      if (size <= 4) {
  ------------------
  |  Branch (833:11): [True: 300, False: 194]
  ------------------
  834|    300|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  835|    300|      } else {
  836|    194|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  837|    194|      }
  838|    494|      xmpData_[tag->_label] = duration_in_ms;
  839|    494|      break;
  840|    437|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (840:5): [True: 437, False: 917]
  ------------------
  841|    437|      value = getULongLong(buf, bigEndian);
  842|    437|      if (!value)
  ------------------
  |  Branch (842:11): [True: 199, False: 238]
  ------------------
  843|    199|        return;
  844|    238|      duration_in_ms = value / 1000000000;
  845|    238|      xmpData_[tag->_label] = duration_in_ms;
  846|    238|      break;
  847|       |
  848|    423|    case TimecodeScale:
  ------------------
  |  Branch (848:5): [True: 423, False: 931]
  ------------------
  849|    423|      value = getULongLong(buf, bigEndian);
  850|    423|      if (!value)
  ------------------
  |  Branch (850:11): [True: 316, False: 107]
  ------------------
  851|    316|        return;
  852|    107|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  853|    107|      xmpData_[tag->_label] = time_code_scale_;
  854|    107|      break;
  855|      0|    default:
  ------------------
  |  Branch (855:5): [True: 0, False: 1.35k]
  ------------------
  856|      0|      break;
  857|  1.35k|  }
  858|  1.35k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  860|  2.10k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  861|  2.10k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  862|       |
  863|  2.10k|  switch (tag->_id) {
  864|    945|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (864:5): [True: 945, False: 1.15k]
  ------------------
  865|  1.01k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (865:5): [True: 66, False: 2.03k]
  ------------------
  866|  1.01k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  867|  1.01k|      break;
  868|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (868:5): [True: 0, False: 2.10k]
  ------------------
  869|  1.09k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (869:5): [True: 1.09k, False: 1.01k]
  ------------------
  870|  1.09k|      uint64_t key = getULongLong(buf, bigEndian);
  871|  1.09k|      if (!key)
  ------------------
  |  Branch (871:11): [True: 484, False: 606]
  ------------------
  872|    484|        return;
  873|    606|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (873:16): [True: 247, False: 359]
  ------------------
  874|    247|        double frame_rate = 0;
  875|    247|        switch (stream_) {
  876|     66|          case 1:  // video
  ------------------
  |  Branch (876:11): [True: 66, False: 181]
  ------------------
  877|     66|            frame_rate = 1000000000.0 / static_cast<double>(key);
  878|     66|            break;
  879|     68|          case 2:  // audio
  ------------------
  |  Branch (879:11): [True: 68, False: 179]
  ------------------
  880|     68|            frame_rate = static_cast<double>(key) / 1000;
  881|     68|            break;
  882|    113|          default:
  ------------------
  |  Branch (882:11): [True: 113, False: 134]
  ------------------
  883|    113|            break;
  884|    247|        }
  885|    247|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (885:13): [True: 134, False: 113]
  ------------------
  886|    134|          xmpData_[internalMt->_label] = frame_rate;
  887|    247|      } else
  888|    359|        xmpData_[tag->_label] = "Variable Bit Rate";
  889|    606|    } break;
  890|    606|    default:
  ------------------
  |  Branch (890:5): [True: 0, False: 2.10k]
  ------------------
  891|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  892|      0|      break;
  893|  2.10k|  }
  894|  2.10k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  896|   147k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  897|   147k|  if (b & 128)
  ------------------
  |  Branch (897:7): [True: 120k, False: 26.8k]
  ------------------
  898|   120k|    return 1;
  899|  26.8k|  if (b & 64)
  ------------------
  |  Branch (899:7): [True: 14.8k, False: 11.9k]
  ------------------
  900|  14.8k|    return 2;
  901|  11.9k|  if (b & 32)
  ------------------
  |  Branch (901:7): [True: 1.30k, False: 10.6k]
  ------------------
  902|  1.30k|    return 3;
  903|  10.6k|  if (b & 16)
  ------------------
  |  Branch (903:7): [True: 6.09k, False: 4.58k]
  ------------------
  904|  6.09k|    return 4;
  905|  4.58k|  if (b & 8)
  ------------------
  |  Branch (905:7): [True: 441, False: 4.14k]
  ------------------
  906|    441|    return 5;
  907|  4.14k|  if (b & 4)
  ------------------
  |  Branch (907:7): [True: 914, False: 3.22k]
  ------------------
  908|    914|    return 6;
  909|  3.22k|  if (b & 2)
  ------------------
  |  Branch (909:7): [True: 1.06k, False: 2.16k]
  ------------------
  910|  1.06k|    return 7;
  911|  2.16k|  if (b & 1)
  ------------------
  |  Branch (911:7): [True: 1.63k, False: 529]
  ------------------
  912|  1.63k|    return 8;
  913|    529|  return 0;
  914|  2.16k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  916|  3.01k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, bool /*create*/) {
  917|  3.01k|  auto image = std::make_unique<MatroskaVideo>(std::move(io));
  918|  3.01k|  if (!image->good()) {
  ------------------
  |  Branch (918:7): [True: 0, False: 3.01k]
  ------------------
  919|      0|    return nullptr;
  920|      0|  }
  921|  3.01k|  return image;
  922|  3.01k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  924|  12.6k|bool isMkvType(BasicIo& iIo, bool advance) {
  925|  12.6k|  bool result = true;
  926|  12.6k|  byte tmpBuf[4];
  927|  12.6k|  iIo.read(tmpBuf, 4);
  928|       |
  929|  12.6k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (929:7): [True: 0, False: 12.6k]
  |  Branch (929:22): [True: 306, False: 12.3k]
  ------------------
  930|    306|    return false;
  931|       |
  932|  12.3k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (932:7): [True: 3.31k, False: 9.06k]
  |  Branch (932:28): [True: 15, False: 9.05k]
  |  Branch (932:49): [True: 10, False: 9.04k]
  |  Branch (932:70): [True: 11, False: 9.03k]
  ------------------
  933|  3.34k|    result = false;
  934|  3.34k|  }
  935|       |
  936|  12.3k|  if (!advance || !result)
  ------------------
  |  Branch (936:7): [True: 12.3k, False: 0]
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|  12.3k|    iIo.seek(0, BasicIo::beg);
  938|  12.3k|  return result;
  939|  12.6k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   147k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   147k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 146k, False: 529]
  |  Branch (583:23): [True: 146k, False: 0]
  ------------------
  584|       |
  585|   147k|  size_t b0 = buf[0] & (0xff >> size);
  586|   147k|  size_t tag = b0 << ((size - 1) * 8);
  587|   206k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 59.6k, False: 147k]
  ------------------
  588|  59.6k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  59.6k|  }
  590|       |
  591|   147k|  return tag;
  592|   147k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  722|  9.62k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  9.62k|    switch (tag->_id) {
  ------------------
  |  Branch (723:13): [True: 9.62k, False: 0]
  ------------------
  724|  1.16k|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (724:7): [True: 1.16k, False: 8.46k]
  ------------------
  725|  1.16k|        return Exiv2::find(videoScanType, key);
  726|  1.63k|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (726:7): [True: 1.63k, False: 7.99k]
  ------------------
  727|  1.63k|        return Exiv2::find(audioChannels, key);
  728|    452|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (728:7): [True: 452, False: 9.17k]
  ------------------
  729|    452|        return Exiv2::find(compressionAlgorithm, key);
  730|  1.33k|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (730:7): [True: 1.33k, False: 8.28k]
  ------------------
  731|  1.33k|        return Exiv2::find(encryptionAlgorithm, key);
  732|    531|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (732:7): [True: 531, False: 9.09k]
  ------------------
  733|    608|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (733:7): [True: 77, False: 9.54k]
  ------------------
  734|    608|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|    682|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (735:7): [True: 682, False: 8.94k]
  ------------------
  736|    789|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (736:7): [True: 107, False: 9.51k]
  ------------------
  737|    789|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|    294|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (738:7): [True: 294, False: 9.33k]
  ------------------
  739|    294|        return Exiv2::find(encodingType, key);
  740|  1.31k|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (740:7): [True: 1.31k, False: 8.31k]
  ------------------
  741|  1.31k|        return Exiv2::find(displayUnit, key);
  742|  1.07k|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (742:7): [True: 1.07k, False: 8.54k]
  ------------------
  743|  1.07k|        return Exiv2::find(aspectRatioType, key);
  744|    375|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (744:7): [True: 375, False: 9.25k]
  ------------------
  745|    375|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|    358|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (746:7): [True: 358, False: 9.26k]
  ------------------
  747|    358|        return Exiv2::find(chapterTranslateCodec, key);
  748|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (748:7): [True: 0, False: 9.62k]
  ------------------
  749|      0|        return Exiv2::find(trackCodec, key);
  750|    111|      case Video_Audio_CodecName:
  ------------------
  |  Branch (750:7): [True: 111, False: 9.51k]
  ------------------
  751|    111|        return Exiv2::find(codecInfo, key);
  752|      7|      case CodecDownloadURL:
  ------------------
  |  Branch (752:7): [True: 7, False: 9.61k]
  ------------------
  753|    114|      case CodecInfoURL:
  ------------------
  |  Branch (753:7): [True: 107, False: 9.51k]
  ------------------
  754|    114|        return Exiv2::find(codecDownloadUrl, key);
  755|  9.62k|    }
  756|      0|    return nullptr;
  757|  9.62k|  }();

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

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

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

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

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

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

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  20.5k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  20.5k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  20.5k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  20.5k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 20.5k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  20.5k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 105, False: 20.4k]
  |  Branch (13:26): [True: 89, False: 16]
  ------------------
   14|     89|    setByteOrder(littleEndian);
   15|  20.4k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 253, False: 20.1k]
  |  Branch (15:33): [True: 228, False: 25]
  ------------------
   16|    228|    setByteOrder(bigEndian);
   17|  20.2k|  } else {
   18|  20.2k|    return false;
   19|  20.2k|  }
   20|       |
   21|    317|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    317|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 273, False: 44]
  |  Branch (22:23): [True: 49, False: 224]
  ------------------
   23|     49|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    268|  sig_ = sig;
   25|    268|  setOffset(getULong(pData + 4, byteOrder()));
   26|    268|  return true;
   27|    317|}

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

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

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

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  18.9k|bool Photoshop::isIrb(const byte* pPsData) {
   28|  18.9k|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 18.9k]
  ------------------
   29|      0|    return false;
   30|       |
   31|  18.9k|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 56.2k, False: 8.71k]
  ------------------
   32|  56.2k|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 10.2k, False: 46.0k]
  ------------------
   33|  10.2k|      return true;
   34|       |
   35|  8.71k|  return false;
   36|  18.9k|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  10.4k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  10.4k|  const byte* record = nullptr;
   40|  10.4k|  uint32_t sizeIptc = 0;
   41|  10.4k|  uint32_t sizeHdr = 0;
   42|  10.4k|  const byte* pCur = pPsData;
   43|  10.4k|  const byte* pEnd = pPsData + sizePsData;
   44|  10.4k|  int ret = 0;
   45|  11.8k|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 11.7k, False: 23]
  |  Branch (45:25): [True: 1.39k, False: 10.3k]
  ------------------
   46|  1.39k|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  1.39k|  }
   48|  10.4k|  return ret >= 0;
   49|  10.4k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  12.3k|                         uint32_t& sizeData) {
   56|  12.3k|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 247, False: 12.0k]
  ------------------
   57|    247|    return 3;
   58|    247|  }
   59|       |
   60|       |  // Used for error checking
   61|  12.0k|  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|  17.3k|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 17.0k, False: 227]
  |  Branch (66:43): [True: 8.78k, False: 8.31k]
  ------------------
   67|  8.78k|    const byte* hrd = pPsData + position;
   68|  8.78k|    position += 4;
   69|  8.78k|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  8.78k|    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|  8.78k|    byte psSize = pPsData[position] + 1;
   76|  8.78k|    psSize += (psSize & 1);
   77|  8.78k|    position += psSize;
   78|  8.78k|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 286, False: 8.50k]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|    286|      return -2;
   84|    286|    }
   85|  8.50k|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  8.50k|    position += 4;
   87|  8.50k|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 1.73k, False: 6.76k]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|  1.73k|      return -2;
   93|  1.73k|    }
   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|  6.76k|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 1.49k, False: 5.27k]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  1.49k|      sizeData = dataSize;
  105|  1.49k|      sizeHdr = psSize + 10;
  106|  1.49k|      *record = hrd;
  107|  1.49k|      return 0;
  108|  1.49k|    }
  109|       |    // Data size is also padded to be even
  110|  5.27k|    position += dataSize + (dataSize & 1);
  111|  5.27k|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  8.53k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 8.51k, False: 22]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  8.51k|    return -2;
  121|  8.51k|  }
  122|     22|  return 3;
  123|  8.53k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  12.2k|                             uint32_t& sizeData) {
  127|  12.2k|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  12.2k|}
_ZN5Exiv29Photoshop16locatePreviewIrbEPKhmPS2_RjS4_:
  131|     80|                                uint32_t& sizeData) {
  132|     80|  return locateIrb(pPsData, sizePsData, preview_, record, sizeHdr, sizeData);
  133|     80|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|     35|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|     35|  *outWidth = data.read_uint32(0, bigEndian);
   48|     35|  *outHeight = data.read_uint32(4, bigEndian);
   49|     35|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  6.84k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  6.84k|  DataBuf key = keyTXTChunk(data);
   53|  6.84k|  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|  6.84k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 6.28k, False: 553]
  ------------------
   59|  6.28k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  6.84k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  6.84k|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|  6.84k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 0, False: 6.84k]
  ------------------
   74|  6.84k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 11, False: 6.83k]
  ------------------
   75|     11|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  6.83k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  6.83k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 12, False: 6.81k]
  ------------------
   79|     12|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  6.81k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  6.83k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  6.81k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  6.81k|  DataBuf arr;
   86|       |
   87|  6.81k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 257, False: 6.56k]
  ------------------
   88|    257|    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|    257|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 7, False: 250]
  ------------------
   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|      7|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|      7|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    250|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    250|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 24, False: 226]
  ------------------
  104|     24|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     24|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     24|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     24|    }
  109|  6.56k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 1.48k, False: 5.08k]
  ------------------
  110|  1.48k|    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.48k|    size_t textsize = data.size() - keysize - 1;
  115|  1.48k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 1.29k, False: 189]
  ------------------
  116|  1.29k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  1.29k|      arr = DataBuf(text, textsize);
  119|  1.29k|    }
  120|  5.08k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 5.08k, False: 0]
  ------------------
  121|  5.08k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  5.08k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  5.08k|    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.08k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  5.08k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  5.08k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.01k, False: 67]
  |  Branch (132:40): [True: 38, False: 29]
  ------------------
  133|  5.08k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 38, False: 5.04k]
  ------------------
  134|     38|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  5.08k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  5.08k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  5.08k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  5.08k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  5.08k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  5.08k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  5.08k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  5.08k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  5.08k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  5.08k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  5.08k|    const auto textsize =
  152|  5.08k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  5.08k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 4.99k, False: 82]
  ------------------
  154|  4.99k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  4.99k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 4.97k, False: 26]
  ------------------
  157|       |        // then it's an uncompressed iTXt chunk
  158|       |#ifdef EXIV2_DEBUG_MESSAGES
  159|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
  160|       |#endif
  161|  4.97k|        arr = DataBuf(text, textsize);
  162|  4.97k|      } 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|     26|        zlibUncompress(text, textsize, arr);
  170|     26|      }
  171|  4.99k|    }
  172|  5.08k|  } 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|  6.81k|  return arr;
  180|  6.81k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  6.28k|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|  6.28k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 3.66k, False: 2.62k]
  ------------------
  186|  3.66k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 89, False: 3.57k]
  |  Branch (186:57): [True: 1.94k, False: 1.63k]
  ------------------
  187|  2.03k|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 1.96k, False: 66]
  ------------------
  188|  1.96k|    DataBuf exifData = readRawProfile(arr, false);
  189|  1.96k|    size_t length = exifData.size();
  190|       |
  191|  1.96k|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 49, False: 1.91k]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|     49|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|     49|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|     49|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    273|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 224, False: 49]
  ------------------
  200|    224|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 224]
  ------------------
  201|    224|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 224]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|    224|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|     49|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 49]
  ------------------
  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|     49|      } else {
  217|     49|#ifndef SUPPRESS_WARNINGS
  218|     49|        EXV_WARNING << "Failed to decode Exif metadata.\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()
  ------------------
  219|     49|#endif
  220|     49|        pImage->exifData().clear();
  221|     49|      }
  222|     49|    }
  223|  1.96k|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  6.28k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 3.63k, False: 2.65k]
  |  Branch (227:24): [True: 297, False: 3.34k]
  |  Branch (227:73): [True: 278, False: 19]
  ------------------
  228|    278|    DataBuf psData = readRawProfile(arr, false);
  229|    278|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 64, False: 214]
  ------------------
  230|     64|      Blob iptcBlob;
  231|     64|      const byte* record = nullptr;
  232|     64|      uint32_t sizeIptc = 0;
  233|     64|      uint32_t sizeHdr = 0;
  234|       |
  235|     64|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|     64|      const byte* pCur = psData.c_data();
  237|     64|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 53, False: 11]
  |  Branch (237:29): [True: 0, False: 53]
  ------------------
  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|     64|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 64]
  |  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|     64|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 64, False: 0]
  |  Branch (254:31): [True: 19, False: 45]
  ------------------
  255|     19|#ifndef SUPPRESS_WARNINGS
  256|     19|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     19|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 19]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     19|  LogMsg(LogMsg::warn).os()
  ------------------
  257|     19|#endif
  258|     19|        pImage->clearIptcData();
  259|     19|      }
  260|     64|    }  // if (psData.size() > 0)
  261|    278|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  6.28k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 3.74k, False: 2.54k]
  |  Branch (265:24): [True: 665, False: 3.08k]
  |  Branch (265:72): [True: 665, False: 0]
  ------------------
  266|    665|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|    665|    size_t length = xmpBuf.size();
  268|       |
  269|    665|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 350, False: 315]
  ------------------
  270|    350|      std::string& xmpPacket = pImage->xmpPacket();
  271|    350|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|    350|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 107, False: 243]
  |  Branch (272:80): [True: 22, False: 85]
  ------------------
  273|     22|#ifndef SUPPRESS_WARNINGS
  274|     22|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     22|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 22]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     22|  LogMsg(LogMsg::warn).os()
  ------------------
  275|     22|#endif
  276|     22|        xmpPacket = xmpPacket.substr(idx);
  277|     22|      }
  278|    350|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 350, False: 0]
  ------------------
  279|    350|#ifndef SUPPRESS_WARNINGS
  280|    350|        EXV_WARNING << "Failed to decode XMP 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()
  ------------------
  281|    350|#endif
  282|    350|      }
  283|    350|    }
  284|    665|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  6.28k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 5.40k, False: 885]
  |  Branch (288:24): [True: 1.81k, False: 3.58k]
  |  Branch (288:69): [True: 1.81k, False: 0]
  |  Branch (288:98): [True: 1.80k, False: 10]
  ------------------
  289|  1.80k|    std::string& xmpPacket = pImage->xmpPacket();
  290|  1.80k|    xmpPacket.assign(arr.c_str(), arr.size());
  291|  1.80k|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 1.66k, False: 144]
  |  Branch (291:78): [True: 740, False: 921]
  ------------------
  292|    740|#ifndef SUPPRESS_WARNINGS
  293|    740|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    740|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 740]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    740|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    740|#endif
  296|    740|      xmpPacket = xmpPacket.substr(idx);
  297|    740|    }
  298|  1.80k|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 298, False: 1.50k]
  ------------------
  299|    298|#ifndef SUPPRESS_WARNINGS
  300|    298|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    298|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 298]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    298|  LogMsg(LogMsg::warn).os()
  ------------------
  301|    298|#endif
  302|    298|    }
  303|  1.80k|  }
  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|  6.28k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 5.71k, False: 574]
  |  Branch (308:7): [True: 81, False: 6.20k]
  |  Branch (308:24): [True: 702, False: 5.01k]
  |  Branch (308:63): [True: 81, False: 621]
  ------------------
  309|     81|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|     81|  }
  311|       |
  312|  6.28k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|     50|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|     50|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|     50|  int zlibResult = Z_BUF_ERROR;
  338|     50|  int dos = 0;
  339|       |
  340|     72|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 72, False: 0]
  ------------------
  341|     72|    arr.alloc(uncompressedLen);
  342|     72|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|     72|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 0, False: 72]
  ------------------
  344|      0|      arr.resize(uncompressedLen);
  345|     72|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 22, False: 50]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     22|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     22|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 0, False: 22]
  ------------------
  350|      0|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|          break;
  352|      0|        uncompressedLen = 131072;
  353|      0|      }
  354|     50|    } else {
  355|       |      // something bad happened
  356|     50|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|     50|    }
  358|     72|  }
  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|  2.91k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  2.91k|  DataBuf info;
  471|  2.91k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 90, False: 2.82k]
  ------------------
  472|     90|    return info;
  473|     90|  }
  474|       |
  475|  2.82k|  const unsigned char unhex[103] = {
  476|  2.82k|      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|  2.82k|      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|  2.82k|      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|  2.82k|  };
  480|       |
  481|  2.82k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 2.82k]
  ------------------
  482|      0|    info.alloc(text.size());
  483|      0|    std::copy(text.begin(), text.end(), info.begin());
  484|      0|    return info;
  485|      0|  }
  486|       |
  487|  2.82k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  2.82k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  2.82k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 36, False: 2.78k]
  ------------------
  491|     36|    return info;
  492|     36|  }
  493|       |
  494|       |  // Look for newline
  495|  55.4k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 52.8k, False: 2.61k]
  ------------------
  496|  52.8k|    sp++;
  497|  52.8k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 171, False: 52.6k]
  ------------------
  498|    171|      return info;
  499|    171|    }
  500|  52.8k|  }
  501|  2.61k|  sp++;  // step over '\n'
  502|  2.61k|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 50, False: 2.56k]
  ------------------
  503|     50|    return info;
  504|     50|  }
  505|       |
  506|       |  // Look for length
  507|  90.9k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 5.11k, False: 85.8k]
  |  Branch (507:25): [True: 71.1k, False: 14.6k]
  |  Branch (507:39): [True: 12.1k, False: 2.49k]
  ------------------
  508|  88.4k|    sp++;
  509|  88.4k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 67, False: 88.3k]
  ------------------
  510|     67|      return info;
  511|     67|    }
  512|  88.4k|  }
  513|       |
  514|       |  // Parse the length.
  515|  2.49k|  size_t length = 0;
  516|  5.54k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 3.42k, False: 2.11k]
  |  Branch (516:24): [True: 3.11k, False: 315]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  3.11k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  3.11k|    length = newlength;
  520|  3.11k|    sp++;
  521|  3.11k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 67, False: 3.04k]
  ------------------
  522|     67|      return info;
  523|     67|    }
  524|  3.11k|  }
  525|  2.43k|  sp++;  // step over '\n'
  526|  2.43k|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 426, False: 2.00k]
  ------------------
  527|    426|    return info;
  528|    426|  }
  529|       |
  530|  2.00k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|  2.00k|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 973, False: 1.03k]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|    973|  }
  538|  2.00k|  info.alloc(length);
  539|  2.00k|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 2.00k]
  ------------------
  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.00k|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 973, False: 1.03k]
  ------------------
  547|    973|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|  1.03k|  unsigned char* dp = info.data();  // decode pointer
  551|  1.03k|  size_t nibbles = length * 2;
  552|       |
  553|  7.05k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 6.47k, False: 583]
  ------------------
  554|  6.47k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  14.0k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 3.35k, False: 10.7k]
  |  Branch (555:26): [True: 6.48k, False: 4.23k]
  |  Branch (555:39): [True: 2.28k, False: 4.19k]
  |  Branch (555:53): [True: 2.44k, False: 5.98k]
  ------------------
  556|  8.05k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 448, False: 7.60k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|    448|        return {};
  561|    448|      }
  562|       |
  563|  7.60k|      sp++;
  564|  7.60k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  7.60k|    }
  566|       |
  567|  6.02k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 3.01k, False: 3.01k]
  ------------------
  568|  3.01k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  3.01k|    else
  570|  3.01k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  6.02k|  }
  572|       |
  573|    583|  return info;
  574|       |
  575|  1.03k|}  // PngChunk::readRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   56|  1.00k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
   57|  1.00k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.00k]
  |  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.00k|}
_ZNK5Exiv28PngImage8mimeTypeEv:
   70|      3|std::string PngImage::mimeType() const {
   71|      3|  return "image/png";
   72|      3|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.00k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.00k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.00k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.00k|  IoCloser closer(*io_);
  400|  1.00k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.00k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.00k|  clearMetadata();
  404|       |
  405|  1.00k|  const size_t imgSize = io_->size();
  406|  1.00k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  23.5k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 23.1k, False: 420]
  ------------------
  409|  23.1k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  23.1k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  23.1k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 292, False: 22.8k]
  ------------------
  414|    292|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    292|    }
  416|       |
  417|  22.8k|    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|  22.8k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 102, False: 22.7k]
  |  Branch (424:32): [True: 106, False: 22.6k]
  |  Branch (424:55): [True: 1.49k, False: 21.1k]
  |  Branch (424:78): [True: 261, False: 20.8k]
  ------------------
  425|  20.8k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 192, False: 20.7k]
  |  Branch (425:32): [True: 5.08k, False: 15.6k]
  |  Branch (425:55): [True: 723, False: 14.8k]
  ------------------
  426|  7.87k|      DataBuf chunkData(chunkLength);
  427|  7.87k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 7.68k, False: 190]
  ------------------
  428|  7.68k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  7.68k|      }
  430|       |
  431|  7.87k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 10, False: 7.86k]
  ------------------
  432|     10|        return;  // Last chunk found: we stop parsing.
  433|     10|      }
  434|  7.86k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 106, False: 7.75k]
  |  Branch (434:34): [True: 35, False: 71]
  ------------------
  435|     35|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  7.82k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 1.49k, False: 6.33k]
  ------------------
  437|  1.49k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  6.33k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 261, False: 6.07k]
  ------------------
  439|    261|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  6.07k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 5.08k, False: 986]
  ------------------
  441|  5.08k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  5.08k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 192, False: 794]
  ------------------
  443|    192|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    192|        setByteOrder(bo);
  445|    794|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 723, False: 71]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    723|        uint32_t iccOffset = 0;
  448|  5.27k|        do {
  449|  5.27k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 5.26k, False: 6]
  |  Branch (449:37): [True: 5.25k, False: 11]
  ------------------
  450|  5.27k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 4.55k, False: 723]
  ------------------
  451|       |
  452|    723|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    723|        ++iccOffset;  // +1 = 'compressed' flag
  454|    723|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    723|        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|    723|      }
  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|  7.86k|      chunkLength = 0;
  466|  7.86k|    }
  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|  22.8k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  22.8k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 420, False: 22.4k]
  |  Branch (473:25): [True: 279, False: 22.1k]
  ------------------
  474|    279|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    279|    }
  476|  22.8k|  }
  477|  1.00k|}  // PngImage::readMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  684|  1.00k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, bool create) {
  685|  1.00k|  auto image = std::make_unique<PngImage>(std::move(io), create);
  686|  1.00k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.00k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.00k|  return image;
  690|  1.00k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  22.4k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  22.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 22.4k]
  |  Branch (693:22): [True: 215, False: 22.2k]
  ------------------
  694|    215|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    215|  }
  696|  22.2k|  const int32_t len = 8;
  697|  22.2k|  std::array<byte, len> buf;
  698|  22.2k|  iIo.read(buf.data(), len);
  699|  22.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 22.2k]
  |  Branch (699:22): [True: 0, False: 22.2k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  22.2k|  bool rc = buf == pngSignature;
  703|  22.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 21.2k, False: 1.00k]
  |  Branch (703:19): [True: 0, False: 1.00k]
  ------------------
  704|  21.2k|    iIo.seek(-len, BasicIo::cur);
  705|  21.2k|  }
  706|       |
  707|  22.2k|  return rc;
  708|  22.2k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    695|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    695|  uLongf uncompressedLen = length;  // just a starting point
   76|    695|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.58k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 886, False: 695]
  ------------------
   79|    886|    result.alloc(uncompressedLen);
   80|    886|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    886|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 0, False: 886]
  |  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|    886|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 191, False: 695]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    191|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    191|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 191]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    191|      else
   96|    191|        uncompressedLen *= 2;
   97|    191|    }
   98|    886|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    695|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  30.8k|static void readChunk(DataBuf& buffer, BasicIo& io) {
  380|       |#ifdef EXIV2_DEBUG_MESSAGES
  381|       |  std::cout << "Exiv2::PngImage::readMetadata: Position: " << io.tell() << '\n';
  382|       |#endif
  383|  30.8k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  30.8k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 30.8k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  30.8k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 92, False: 30.7k]
  ------------------
  388|     92|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     92|  }
  390|  30.8k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  954|      2|    properties_(std::move(properties)), preview_(std::move(data)) {
  955|      2|}
_ZNK5Exiv212PreviewImage5pDataEv:
  981|      2|const byte* PreviewImage::pData() const {
  982|      2|  return preview_.c_data();
  983|      2|}
_ZNK5Exiv212PreviewImage4sizeEv:
  985|      2|uint32_t PreviewImage::size() const {
  986|      2|  return static_cast<uint32_t>(preview_.size());
  987|      2|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1009|  14.8k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1010|  14.8k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1012|  14.8k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1013|  14.8k|  PreviewPropertiesList list;
 1014|       |  // go through the loader table and store all successfully created loaders in the list
 1015|   517k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1015:26): [True: 502k, False: 14.8k]
  ------------------
 1016|   502k|    auto loader = Loader::create(id, image_);
 1017|   502k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1017:9): [True: 13.0k, False: 489k]
  |  Branch (1017:19): [True: 8.43k, False: 4.60k]
  ------------------
 1018|  8.43k|      PreviewProperties props = loader->getProperties();
 1019|  8.43k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1020|  8.43k|      props.size_ = buf.size();         //     update the size
 1021|  8.43k|      list.push_back(std::move(props));
 1022|  8.43k|    }
 1023|   502k|  }
 1024|  14.8k|  std::sort(list.begin(), list.end(),
 1025|  14.8k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1026|       |
 1027|  14.8k|  return list;
 1028|  14.8k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1030|      2|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1031|      2|  auto loader = Loader::create(properties.id_, image_);
 1032|      2|  DataBuf buf;
 1033|      2|  if (loader) {
  ------------------
  |  Branch (1033:7): [True: 2, False: 0]
  ------------------
 1034|      2|    buf = loader->getData();
 1035|      2|  }
 1036|       |
 1037|      2|  return {properties, std::move(buf)};
 1038|      2|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  342|  1.01M|PreviewId Loader::getNumLoaders() {
  343|  1.01M|  return PreviewId{std::size(loaderList_)};
  344|  1.01M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  360|  59.3k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  361|  59.3k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  362|  59.3k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  346|  59.3k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  347|  59.3k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (347:7): [True: 0, False: 59.3k]
  |  Branch (347:21): [True: 57.1k, False: 2.18k]
  ------------------
  348|  57.1k|    return;
  349|  2.18k|  nativePreview_ = image.nativePreviews()[parIdx];
  350|  2.18k|  width_ = nativePreview_.width_;
  351|  2.18k|  height_ = nativePreview_.height_;
  352|  2.18k|  valid_ = true;
  353|  2.18k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (353:7): [True: 2.14k, False: 40]
  ------------------
  354|  2.14k|    size_ = nativePreview_.size_;
  355|  2.14k|  } else {
  356|     40|    size_ = getData().size();
  357|     40|  }
  358|  2.18k|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  335|   458k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  336|   458k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  338|  8.43k|PreviewProperties Loader::getProperties() const {
  339|  8.43k|  return {"", "", size_, width_, height_, id_};
  340|  8.43k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   69|  4.05k|  virtual bool readDimensions() {
   70|  4.05k|    return true;
   71|  4.05k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   46|   458k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   58|   472k|  [[nodiscard]] virtual bool valid() const {
   59|   472k|    return valid_;
   60|   472k|  }
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative13getPropertiesEv:
  364|  2.07k|PreviewProperties LoaderNative::getProperties() const {
  365|  2.07k|  PreviewProperties prop = Loader::getProperties();
  366|  2.07k|  prop.mimeType_ = nativePreview_.mimeType_;
  367|  2.07k|  if (nativePreview_.mimeType_ == "image/jpeg") {
  ------------------
  |  Branch (367:7): [True: 1.79k, False: 280]
  ------------------
  368|  1.79k|    prop.extension_ = ".jpg";
  369|  1.79k|  } else if (nativePreview_.mimeType_ == "image/tiff") {
  ------------------
  |  Branch (369:14): [True: 0, False: 280]
  ------------------
  370|      0|    prop.extension_ = ".tif";
  371|    280|  } else if (nativePreview_.mimeType_ == "image/x-wmf") {
  ------------------
  |  Branch (371:14): [True: 0, False: 280]
  ------------------
  372|      0|    prop.extension_ = ".wmf";
  373|    280|  } else if (nativePreview_.mimeType_ == "image/x-portable-anymap") {
  ------------------
  |  Branch (373:14): [True: 0, False: 280]
  ------------------
  374|      0|    prop.extension_ = ".pnm";
  375|    280|  } else {
  376|    280|#ifndef SUPPRESS_WARNINGS
  377|    280|    EXV_WARNING << "Unknown native preview format: " << nativePreview_.mimeType_ << "\n";
  ------------------
  |  |  138|    280|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 280]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    280|  LogMsg(LogMsg::warn).os()
  ------------------
  378|    280|#endif
  379|    280|    prop.extension_ = ".dat";
  380|    280|  }
  381|  2.07k|  return prop;
  382|  2.07k|}
preview.cpp:_ZNK12_GLOBAL__N_112LoaderNative7getDataEv:
  384|  2.73k|DataBuf LoaderNative::getData() const {
  385|  2.73k|  if (!valid())
  ------------------
  |  Branch (385:7): [True: 0, False: 2.73k]
  ------------------
  386|      0|    return {};
  387|       |
  388|  2.73k|  BasicIo& io = image_.io();
  389|  2.73k|  if (io.open() != 0) {
  ------------------
  |  Branch (389:7): [True: 0, False: 2.73k]
  ------------------
  390|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  391|      0|  }
  392|  2.73k|  IoCloser closer(io);
  393|  2.73k|  const byte* data = io.mmap();
  394|  2.73k|  if (io.size() < nativePreview_.position_ + nativePreview_.size_) {
  ------------------
  |  Branch (394:7): [True: 749, False: 1.98k]
  ------------------
  395|    749|#ifndef SUPPRESS_WARNINGS
  396|    749|    EXV_WARNING << "Invalid native preview position or size.\n";
  ------------------
  |  |  138|    749|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 749]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    749|  LogMsg(LogMsg::warn).os()
  ------------------
  397|    749|#endif
  398|    749|    return {};
  399|    749|  }
  400|  1.98k|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (400:7): [True: 1.90k, False: 80]
  ------------------
  401|  1.90k|    return {data + nativePreview_.position_, nativePreview_.size_};
  402|  1.90k|  }
  403|     80|  if (nativePreview_.filter_ == "hex-ai7thumbnail-pnm") {
  ------------------
  |  Branch (403:7): [True: 0, False: 80]
  ------------------
  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|     80|  if (nativePreview_.filter_ == "hex-irb") {
  ------------------
  |  Branch (408:7): [True: 80, False: 0]
  ------------------
  409|     80|    const DataBuf psData = decodeHex(data + nativePreview_.position_, nativePreview_.size_);
  410|     80|    const byte* record;
  411|     80|    uint32_t sizeHdr = 0;
  412|     80|    uint32_t sizeData = 0;
  413|     80|    if (Photoshop::locatePreviewIrb(psData.c_data(), psData.size(), &record, sizeHdr, sizeData) != 0) {
  ------------------
  |  Branch (413:9): [True: 80, False: 0]
  ------------------
  414|     80|#ifndef SUPPRESS_WARNINGS
  415|     80|      EXV_WARNING << "Missing preview IRB in Photoshop EPS preview.\n";
  ------------------
  |  |  138|     80|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 80]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     80|  LogMsg(LogMsg::warn).os()
  ------------------
  416|     80|#endif
  417|     80|      return {};
  418|     80|    }
  419|      0|    Internal::enforce(sizeData >= 28, ErrorCode::kerCorruptedMetadata);
  420|      0|    return {record + sizeHdr + 28, sizeData - 28};
  421|     80|  }
  422|      0|  throw Error(ErrorCode::kerErrorMessage, "Invalid native preview filter: ", nativePreview_.filter_);
  423|     80|}
preview.cpp:_ZN12_GLOBAL__N_19decodeHexEPKhm:
  813|     80|DataBuf decodeHex(const byte* src, size_t srcSize) {
  814|       |  // create decoding table
  815|     80|  byte invalid = 16;
  816|     80|  std::array<byte, 256> decodeHexTable;
  817|     80|  decodeHexTable.fill(invalid);
  818|    880|  for (byte i = 0; i < 10; i++)
  ------------------
  |  Branch (818:20): [True: 800, False: 80]
  ------------------
  819|    800|    decodeHexTable[static_cast<byte>('0') + i] = i;
  820|    560|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (820:20): [True: 480, False: 80]
  ------------------
  821|    480|    decodeHexTable[static_cast<byte>('A') + i] = i + 10;
  822|    560|  for (byte i = 0; i < 6; i++)
  ------------------
  |  Branch (822:20): [True: 480, False: 80]
  ------------------
  823|    480|    decodeHexTable[static_cast<byte>('a') + i] = i + 10;
  824|       |
  825|       |  // calculate dest size
  826|     80|  long validSrcSize = 0;
  827|  5.42M|  for (size_t srcPos = 0; srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (827:27): [True: 5.42M, False: 80]
  ------------------
  828|  5.42M|    if (decodeHexTable[src[srcPos]] != invalid)
  ------------------
  |  Branch (828:9): [True: 3.93M, False: 1.48M]
  ------------------
  829|  3.93M|      validSrcSize++;
  830|  5.42M|  }
  831|     80|  const size_t destSize = validSrcSize / 2;
  832|       |
  833|       |  // allocate dest buffer
  834|     80|  DataBuf dest(destSize);
  835|       |
  836|       |  // decode
  837|  1.96M|  for (size_t srcPos = 0, destPos = 0; destPos < destSize; destPos++) {
  ------------------
  |  Branch (837:40): [True: 1.96M, False: 80]
  ------------------
  838|  1.96M|    byte buffer = 0;
  839|  7.39M|    for (int bufferPos = 1; bufferPos >= 0 && srcPos < srcSize; srcPos++) {
  ------------------
  |  Branch (839:29): [True: 5.42M, False: 1.96M]
  |  Branch (839:47): [True: 5.42M, False: 0]
  ------------------
  840|  5.42M|      byte srcValue = decodeHexTable[src[srcPos]];
  841|  5.42M|      if (srcValue == invalid)
  ------------------
  |  Branch (841:11): [True: 1.48M, False: 3.93M]
  ------------------
  842|  1.48M|        continue;
  843|  3.93M|      buffer |= srcValue << (bufferPos * 4);
  844|  3.93M|      bufferPos--;
  845|  3.93M|    }
  846|  1.96M|    dest.write_uint8(destPos, buffer);
  847|  1.96M|  }
  848|     80|  return dest;
  849|     80|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNative14readDimensionsEv:
  425|  2.18k|bool LoaderNative::readDimensions() {
  426|  2.18k|  if (!valid())
  ------------------
  |  Branch (426:7): [True: 0, False: 2.18k]
  ------------------
  427|      0|    return false;
  428|  2.18k|  if (width_ != 0 || height_ != 0)
  ------------------
  |  Branch (428:7): [True: 1.24k, False: 944]
  |  Branch (428:22): [True: 331, False: 613]
  ------------------
  429|  1.57k|    return true;
  430|       |
  431|    613|  const DataBuf data = getData();
  432|    613|  if (data.empty())
  ------------------
  |  Branch (432:7): [True: 61, False: 552]
  ------------------
  433|     61|    return false;
  434|       |
  435|    552|  try {
  436|    552|    auto image = ImageFactory::open(data.c_data(), data.size());
  437|    552|    if (!image)
  ------------------
  |  Branch (437:9): [True: 0, False: 552]
  ------------------
  438|      0|      return false;
  439|    552|    image->readMetadata();
  440|       |
  441|    552|    width_ = image->pixelWidth();
  442|    552|    height_ = image->pixelHeight();
  443|    552|  } catch (const Error& /* error */) {
  444|     45|#ifndef SUPPRESS_WARNINGS
  445|     45|    EXV_WARNING << "Invalid native preview image.\n";
  ------------------
  |  |  138|     45|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 45]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     45|  LogMsg(LogMsg::warn).os()
  ------------------
  446|     45|#endif
  447|     45|    return false;
  448|     45|  }
  449|    503|  return true;
  450|    552|}
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  553|   163k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  554|   163k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  555|   163k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  540|   163k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  541|   163k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (541:55): [True: 571, False: 162k]
  ------------------
  542|    571|    size_ = pos->sizeDataArea();  // indirect data
  543|    571|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (543:9): [True: 468, False: 103]
  |  Branch (543:23): [True: 47, False: 421]
  ------------------
  544|     47|      size_ = pos->size();  // direct data
  545|    571|  }
  546|       |
  547|   163k|  if (size_ == 0)
  ------------------
  |  Branch (547:7): [True: 163k, False: 140]
  ------------------
  548|   163k|    return;
  549|       |
  550|    140|  valid_ = true;
  551|    140|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  557|      5|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  558|      5|  PreviewProperties prop = Loader::getProperties();
  559|      5|  prop.mimeType_ = "image/jpeg";
  560|      5|  prop.extension_ = ".jpg";
  561|      5|  return prop;
  562|      5|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  564|    145|DataBuf LoaderExifDataJpeg::getData() const {
  565|    145|  DataBuf buf;
  566|       |
  567|    145|  if (!valid())
  ------------------
  |  Branch (567:7): [True: 0, False: 145]
  ------------------
  568|      0|    return buf;
  569|       |
  570|    145|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (570:55): [True: 145, False: 0]
  ------------------
  571|    145|    buf = pos->dataArea();  // indirect data
  572|       |
  573|    145|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (573:9): [True: 41, False: 104]
  ------------------
  574|     41|      buf = DataBuf(pos->size());
  575|     41|      pos->copy(buf.data(), invalidByteOrder);
  576|     41|    }
  577|       |
  578|    145|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  579|    145|    return buf;
  580|    145|  }
  581|       |
  582|      0|  return buf;
  583|    145|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  585|    138|bool LoaderExifDataJpeg::readDimensions() {
  586|    138|  if (!valid())
  ------------------
  |  Branch (586:7): [True: 0, False: 138]
  ------------------
  587|      0|    return false;
  588|       |
  589|    138|  DataBuf buf = getData();
  590|    138|  if (buf.empty())
  ------------------
  |  Branch (590:7): [True: 0, False: 138]
  ------------------
  591|      0|    return false;
  592|       |
  593|    138|  try {
  594|    138|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  595|    138|    if (!image)
  ------------------
  |  Branch (595:9): [True: 0, False: 138]
  ------------------
  596|      0|      return false;
  597|    138|    image->readMetadata();
  598|       |
  599|    138|    width_ = image->pixelWidth();
  600|    138|    height_ = image->pixelHeight();
  601|    138|  } catch (const Error& /* error */) {
  602|    133|    return false;
  603|    133|  }
  604|       |
  605|      5|  return true;
  606|    138|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  666|   103k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  667|   103k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  668|   103k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  609|   103k|    Loader(id, image), group_(param_[parIdx].group_) {
  610|   103k|  const ExifData& exifData = image_.exifData();
  611|       |
  612|   103k|  size_t offsetCount = 0;
  613|   103k|  ExifData::const_iterator pos;
  614|       |
  615|       |  // check if the group_ contains a preview image
  616|   103k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (616:7): [True: 88.7k, False: 14.7k]
  ------------------
  617|  88.7k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  618|  88.7k|    if (pos == exifData.end())
  ------------------
  |  Branch (618:9): [True: 84.0k, False: 4.67k]
  ------------------
  619|  84.0k|      return;
  620|  4.67k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (620:9): [True: 4.67k, False: 0]
  |  Branch (620:9): [True: 787, False: 3.89k]
  |  Branch (620:39): [True: 787, False: 3.89k]
  ------------------
  621|    787|      return;
  622|  4.67k|  }
  623|       |
  624|  18.6k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  625|  18.6k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (625:7): [True: 4.17k, False: 14.5k]
  ------------------
  626|  4.17k|    offsetTag_ = "StripOffsets";
  627|  4.17k|    sizeTag_ = "StripByteCounts";
  628|  4.17k|    offsetCount = pos->value().count();
  629|  14.5k|  } else {
  630|  14.5k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  631|  14.5k|    if (pos == exifData.end())
  ------------------
  |  Branch (631:9): [True: 14.2k, False: 283]
  ------------------
  632|  14.2k|      return;
  633|    283|    offsetTag_ = "TileOffsets";
  634|    283|    sizeTag_ = "TileByteCounts";
  635|    283|    offsetCount = pos->value().count();
  636|    283|  }
  637|       |
  638|  4.45k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  639|  4.45k|  if (pos == exifData.end())
  ------------------
  |  Branch (639:7): [True: 137, False: 4.32k]
  ------------------
  640|    137|    return;
  641|  4.32k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (641:7): [True: 39, False: 4.28k]
  ------------------
  642|     39|    return;
  643|  26.0k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (643:22): [True: 21.7k, False: 4.28k]
  ------------------
  644|  21.7k|    size_ += pos->toUint32(i);
  645|  21.7k|  }
  646|       |
  647|  4.28k|  if (size_ == 0)
  ------------------
  |  Branch (647:7): [True: 72, False: 4.21k]
  ------------------
  648|     72|    return;
  649|       |
  650|  4.21k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  651|  4.21k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (651:7): [True: 4.15k, False: 59]
  |  Branch (651:7): [True: 4.10k, False: 104]
  |  Branch (651:32): [True: 4.10k, False: 45]
  ------------------
  652|  4.10k|    width_ = pos->toUint32();
  653|  4.10k|  }
  654|       |
  655|  4.21k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  656|  4.21k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (656:7): [True: 4.15k, False: 59]
  |  Branch (656:7): [True: 4.11k, False: 101]
  |  Branch (656:32): [True: 4.11k, False: 42]
  ------------------
  657|  4.11k|    height_ = pos->toUint32();
  658|  4.11k|  }
  659|       |
  660|  4.21k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (660:7): [True: 117, False: 4.09k]
  |  Branch (660:22): [True: 39, False: 4.05k]
  ------------------
  661|    156|    return;
  662|       |
  663|  4.05k|  valid_ = true;
  664|  4.05k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  670|  4.05k|PreviewProperties LoaderTiff::getProperties() const {
  671|  4.05k|  PreviewProperties prop = Loader::getProperties();
  672|  4.05k|  prop.mimeType_ = "image/tiff";
  673|  4.05k|  prop.extension_ = ".tif";
  674|  4.05k|  return prop;
  675|  4.05k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  677|  4.05k|DataBuf LoaderTiff::getData() const {
  678|  4.05k|  const ExifData& exifData = image_.exifData();
  679|       |
  680|  4.05k|  ExifData preview;
  681|       |
  682|       |  // copy tags
  683|   714k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (683:19): [True: 714k, False: 4.05k]
  ------------------
  684|   714k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (684:9): [True: 214k, False: 500k]
  ------------------
  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|   214k|      uint16_t tag = pos.tag();
  693|   214k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (693:11): [True: 209k, False: 4.31k]
  |  Branch (693:28): [True: 209k, False: 270]
  |  Branch (693:45): [True: 131k, False: 78.2k]
  ------------------
  694|   131k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  695|   131k|      }
  696|   214k|    }
  697|   714k|  }
  698|       |
  699|  4.05k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  700|       |
  701|  4.05k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (701:7): [True: 3.85k, False: 205]
  ------------------
  702|       |    // image data are not available via exifData, read them from image_.io()
  703|  3.85k|    BasicIo& io = image_.io();
  704|       |
  705|  3.85k|    if (io.open() != 0) {
  ------------------
  |  Branch (705:9): [True: 0, False: 3.85k]
  ------------------
  706|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  707|      0|    }
  708|  3.85k|    IoCloser closer(io);
  709|       |
  710|  3.85k|    const Exiv2::byte* base = io.mmap();
  711|       |
  712|  3.85k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  713|       |
  714|  3.85k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (714:9): [True: 3.85k, False: 0]
  ------------------
  715|  3.85k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (715:11): [True: 3.65k, False: 194]
  ------------------
  716|       |        // this saves one copying of the buffer
  717|  3.65k|        uint32_t offset = dataValue.toUint32(0);
  718|  3.65k|        uint32_t size = sizes.toUint32(0);
  719|  3.65k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (719:13): [True: 2.27k, False: 1.37k]
  ------------------
  720|  2.27k|          dataValue.setDataArea(base + offset, size);
  721|  3.65k|      } else {
  722|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  723|    194|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  724|    194|        DataBuf buf(size_);
  725|    194|        uint32_t idxBuf = 0;
  726|  11.1k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (726:28): [True: 10.9k, False: 194]
  ------------------
  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: 3.52k, False: 7.42k]
  |  Branch (735:28): [True: 2.07k, False: 1.45k]
  ------------------
  736|  2.07k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  737|  2.07k|          }
  738|       |
  739|  10.9k|          idxBuf += size;
  740|  10.9k|        }
  741|    194|        dataValue.setDataArea(buf.c_data(), buf.size());
  742|    194|      }
  743|  3.85k|    }
  744|  3.85k|  }
  745|       |
  746|       |  // Fix compression value in the CR2 IFD2 image
  747|  4.05k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (747:7): [True: 2, False: 4.05k]
  |  Branch (747:7): [True: 2, False: 4.05k]
  |  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.05k|  MemIo mio;
  753|  4.05k|  IptcData emptyIptc;
  754|  4.05k|  XmpData emptyXmp;
  755|  4.05k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  756|  4.05k|  return {mio.mmap(), mio.size()};
  757|  4.05k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  481|   117k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  482|   117k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  483|   117k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  452|   117k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  453|   117k|  const ExifData& exifData = image_.exifData();
  454|   117k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  455|   117k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (455:7): [True: 8.15k, False: 109k]
  |  Branch (455:7): [True: 7.07k, False: 110k]
  |  Branch (455:32): [True: 7.07k, False: 1.07k]
  ------------------
  456|  7.07k|    offset_ = pos->toUint32();
  457|  7.07k|  }
  458|       |
  459|   117k|  size_ = 0;
  460|   117k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  461|   117k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (461:7): [True: 9.26k, False: 108k]
  |  Branch (461:7): [True: 7.23k, False: 110k]
  |  Branch (461:32): [True: 7.23k, False: 2.03k]
  ------------------
  462|  7.23k|    size_ = pos->toUint32();
  463|  7.23k|  }
  464|       |
  465|   117k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (465:7): [True: 110k, False: 6.95k]
  |  Branch (465:23): [True: 155, False: 6.80k]
  ------------------
  466|   110k|    return;
  467|       |
  468|  6.80k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (468:7): [True: 0, False: 6.80k]
  ------------------
  469|      0|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  470|      0|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:9): [True: 0, False: 0]
  |  Branch (470:9): [True: 0, False: 0]
  |  Branch (470:34): [True: 0, False: 0]
  ------------------
  471|      0|      offset_ += pos->toUint32();
  472|      0|    }
  473|      0|  }
  474|       |
  475|  6.80k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (475:7): [True: 154, False: 6.65k]
  ------------------
  476|    154|    return;
  477|       |
  478|  6.65k|  valid_ = true;
  479|  6.65k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  485|  2.29k|PreviewProperties LoaderExifJpeg::getProperties() const {
  486|  2.29k|  PreviewProperties prop = Loader::getProperties();
  487|  2.29k|  prop.mimeType_ = "image/jpeg";
  488|  2.29k|  prop.extension_ = ".jpg";
  489|  2.29k|  return prop;
  490|  2.29k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  492|  2.29k|DataBuf LoaderExifJpeg::getData() const {
  493|  2.29k|  if (!valid())
  ------------------
  |  Branch (493:7): [True: 0, False: 2.29k]
  ------------------
  494|      0|    return {};
  495|  2.29k|  BasicIo& io = image_.io();
  496|       |
  497|  2.29k|  if (io.open() != 0) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.29k]
  ------------------
  498|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  499|      0|  }
  500|  2.29k|  IoCloser closer(io);
  501|       |
  502|  2.29k|  const Exiv2::byte* base = io.mmap();
  503|       |
  504|  2.29k|  return {base + offset_, size_};
  505|  2.29k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  507|  6.65k|bool LoaderExifJpeg::readDimensions() {
  508|  6.65k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 6.65k]
  ------------------
  509|      0|    return false;
  510|  6.65k|  if (width_ || height_)
  ------------------
  |  Branch (510:7): [True: 0, False: 6.65k]
  |  Branch (510:17): [True: 0, False: 6.65k]
  ------------------
  511|      0|    return true;
  512|       |
  513|  6.65k|  BasicIo& io = image_.io();
  514|       |
  515|  6.65k|  if (io.open() != 0) {
  ------------------
  |  Branch (515:7): [True: 0, False: 6.65k]
  ------------------
  516|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  517|      0|  }
  518|  6.65k|  IoCloser closer(io);
  519|  6.65k|  const Exiv2::byte* base = io.mmap();
  520|       |
  521|  6.65k|  try {
  522|  6.65k|    auto image = ImageFactory::open(base + offset_, size_);
  523|  6.65k|    if (!image)
  ------------------
  |  Branch (523:9): [True: 0, False: 6.65k]
  ------------------
  524|      0|      return false;
  525|  6.65k|    image->readMetadata();
  526|       |
  527|  6.65k|    width_ = image->pixelWidth();
  528|  6.65k|    height_ = image->pixelHeight();
  529|  6.65k|  } catch (const Error& /* error */) {
  530|  4.34k|#ifndef SUPPRESS_WARNINGS
  531|  4.34k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  4.34k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.34k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.34k|  LogMsg(LogMsg::warn).os()
  ------------------
  532|  4.34k|#endif
  533|  4.34k|    return false;
  534|  4.34k|  }
  535|       |
  536|  2.29k|  return true;
  537|  6.65k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  792|  14.6k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  793|  14.6k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  794|  14.6k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  759|  14.6k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  760|  14.6k|  (void)parIdx;
  761|       |
  762|  14.6k|  const XmpData& xmpData = image_.xmpData();
  763|       |
  764|  14.6k|  std::string prefix = "xmpGImg";
  765|  14.6k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (765:7): [True: 0, False: 14.6k]
  ------------------
  766|      0|    prefix = "xapGImg";
  767|      0|  }
  768|       |
  769|  14.6k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  770|  14.6k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (770:7): [True: 14.6k, False: 0]
  ------------------
  771|  14.6k|    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|   502k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  321|   502k|  Loader::UniquePtr loader;
  322|   502k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (322:7): [True: 0, False: 502k]
  |  Branch (322:17): [True: 0, False: 502k]
  ------------------
  323|      0|    return loader;
  324|       |
  325|   502k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (325:7): [True: 44.1k, False: 458k]
  |  Branch (325:7): [True: 44.0k, False: 458k]
  |  Branch (325:41): [True: 44.0k, False: 170]
  ------------------
  326|  44.0k|    return loader;
  327|       |
  328|   458k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  329|   458k|  if (!loader->valid())
  ------------------
  |  Branch (329:7): [True: 445k, False: 13.0k]
  ------------------
  330|   445k|    loader = nullptr;
  331|       |
  332|   458k|  return loader;
  333|   502k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1025|  7.31k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

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

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  102|    766|PsdImage::PsdImage(BasicIo::UniquePtr io) : Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io)) {
  103|    766|}  // PsdImage::PsdImage
_ZNK5Exiv28PsdImage8mimeTypeEv:
  105|    813|std::string PsdImage::mimeType() const {
  106|    813|  return "image/x-photoshop";
  107|    813|}
_ZN5Exiv28PsdImage12readMetadataEv:
  114|    756|void PsdImage::readMetadata() {
  115|       |#ifdef EXIV2_DEBUG_MESSAGES
  116|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  117|       |#endif
  118|    756|  if (io_->open() != 0) {
  ------------------
  |  Branch (118:7): [True: 0, False: 756]
  ------------------
  119|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  120|      0|  }
  121|    756|  IoCloser closer(*io_);
  122|       |  // Ensure that this is the correct image type
  123|    756|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (123:7): [True: 0, False: 756]
  ------------------
  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|    756|  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|    756|  byte buf[26];
  146|    756|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (146:7): [True: 0, False: 756]
  ------------------
  147|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  148|      0|  }
  149|    756|  pixelWidth_ = getLong(buf + 18, bigEndian);
  150|    756|  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|    756|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (154:7): [True: 0, False: 756]
  ------------------
  155|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  156|      0|  }
  157|       |
  158|       |  // skip it
  159|    756|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (159:7): [True: 11, False: 745]
  ------------------
  160|     11|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  161|     11|  }
  162|       |
  163|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  164|    745|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (164:7): [True: 10, False: 735]
  ------------------
  165|     10|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  166|     10|  }
  167|    735|  uint32_t resourcesLength = getULong(buf, bigEndian);
  168|    735|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  169|       |
  170|  2.19k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (170:10): [True: 1.91k, False: 275]
  ------------------
  171|  1.91k|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  172|  1.91k|    resourcesLength -= 8;
  173|  1.91k|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (173:9): [True: 50, False: 1.86k]
  ------------------
  174|     50|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  175|     50|    }
  176|       |
  177|  1.86k|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (177:9): [True: 400, False: 1.46k]
  ------------------
  178|    400|      break;  // bad resource type
  179|    400|    }
  180|  1.46k|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  181|  1.46k|    uint32_t resourceNameLength = buf[6] & ~1;
  182|       |
  183|       |    // skip the resource name, plus any padding
  184|  1.46k|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  185|  1.46k|    resourcesLength -= resourceNameLength;
  186|  1.46k|    io_->seek(resourceNameLength, BasicIo::cur);
  187|       |
  188|       |    // read resource size
  189|  1.46k|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  190|  1.46k|    resourcesLength -= 4;
  191|  1.46k|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (191:9): [True: 10, False: 1.45k]
  ------------------
  192|     10|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  193|     10|    }
  194|  1.45k|    uint32_t resourceSize = getULong(buf, bigEndian);
  195|  1.45k|    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.45k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  203|  1.45k|    readResourceBlock(resourceId, resourceSize);
  204|  1.45k|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  205|  1.45k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  206|  1.45k|    resourcesLength -= resourceSize;
  207|  1.45k|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  208|  1.45k|  }
  209|       |
  210|    735|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  212|  1.38k|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  213|  1.38k|  switch (resourceId) {
  214|    134|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (214:5): [True: 134, False: 1.25k]
  ------------------
  215|    134|      DataBuf rawIPTC(resourceSize);
  216|    134|      io_->read(rawIPTC.data(), rawIPTC.size());
  217|    134|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (217:11): [True: 0, False: 134]
  |  Branch (217:27): [True: 11, False: 123]
  ------------------
  218|     11|        throw Error(ErrorCode::kerFailedToReadImageData);
  219|    123|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (219:11): [True: 42, False: 81]
  ------------------
  220|     42|#ifndef SUPPRESS_WARNINGS
  221|     42|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     42|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 42]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     42|  LogMsg(LogMsg::warn).os()
  ------------------
  222|     42|#endif
  223|     42|        iptcData_.clear();
  224|     42|      }
  225|    123|      break;
  226|    134|    }
  227|       |
  228|    132|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (228:5): [True: 132, False: 1.25k]
  ------------------
  229|    132|      DataBuf rawExif(resourceSize);
  230|    132|      io_->read(rawExif.data(), rawExif.size());
  231|    132|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (231:11): [True: 0, False: 132]
  |  Branch (231:27): [True: 10, False: 122]
  ------------------
  232|     10|        throw Error(ErrorCode::kerFailedToReadImageData);
  233|    122|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size());
  234|    122|      setByteOrder(bo);
  235|    122|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (235:11): [True: 6, False: 116]
  |  Branch (235:31): [True: 0, False: 6]
  ------------------
  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|    122|      break;
  242|    132|    }
  243|       |
  244|     44|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (244:5): [True: 44, False: 1.34k]
  ------------------
  245|     44|      DataBuf xmpPacket(resourceSize);
  246|     44|      io_->read(xmpPacket.data(), xmpPacket.size());
  247|     44|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (247:11): [True: 0, False: 44]
  |  Branch (247:27): [True: 1, False: 43]
  ------------------
  248|      1|        throw Error(ErrorCode::kerFailedToReadImageData);
  249|     43|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  250|     43|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (250:11): [True: 30, False: 13]
  |  Branch (250:34): [True: 30, False: 0]
  ------------------
  251|     30|#ifndef SUPPRESS_WARNINGS
  252|     30|        EXV_WARNING << "Failed to decode XMP metadata.\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()
  ------------------
  253|     30|#endif
  254|     30|      }
  255|     43|      break;
  256|     44|    }
  257|       |
  258|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  259|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  260|    835|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (260:5): [True: 835, False: 550]
  ------------------
  261|    866|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (261:5): [True: 31, False: 1.35k]
  ------------------
  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|    866|      byte buf[28];
  279|    866|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (279:11): [True: 22, False: 844]
  ------------------
  280|     22|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  281|     22|      }
  282|    844|      NativePreview nativePreview;
  283|    844|      nativePreview.position_ = io_->tell();
  284|    844|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  285|    844|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  286|    844|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  287|    844|      const uint32_t format = getLong(buf + 0, bigEndian);
  288|       |
  289|    844|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  290|    844|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  291|       |
  292|    844|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (292:11): [True: 764, False: 80]
  |  Branch (292:38): [True: 764, False: 0]
  ------------------
  293|    764|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  294|    764|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (294:13): [True: 0, False: 764]
  |  Branch (294:29): [True: 41, False: 723]
  ------------------
  295|     41|          throw Error(ErrorCode::kerFailedToReadImageData);
  296|       |
  297|       |        // unsupported format of native preview
  298|    723|        if (format != 1)
  ------------------
  |  Branch (298:13): [True: 93, False: 630]
  ------------------
  299|     93|          break;
  300|    630|        nativePreview.filter_ = "";
  301|    630|        nativePreview.mimeType_ = "image/jpeg";
  302|    630|        nativePreviews_.push_back(std::move(nativePreview));
  303|    630|      }
  304|    710|      break;
  305|    844|    }
  306|       |
  307|    710|    default:
  ------------------
  |  Branch (307:5): [True: 209, False: 1.17k]
  ------------------
  308|    209|      break;
  309|  1.38k|  }
  310|  1.38k|}  // PsdImage::readResourceBlock
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  676|    766|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, bool /*create*/) {
  677|    766|  auto image = std::make_unique<PsdImage>(std::move(io));
  678|    766|  if (!image->good()) {
  ------------------
  |  Branch (678:7): [True: 10, False: 756]
  ------------------
  679|     10|    return nullptr;
  680|     10|  }
  681|    756|  return image;
  682|    766|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  684|  15.8k|bool isPsdType(BasicIo& iIo, bool advance) {
  685|  15.8k|  const int32_t len = 6;
  686|  15.8k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  687|  15.8k|  std::array<byte, len> buf;
  688|  15.8k|  iIo.read(buf.data(), len);
  689|  15.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (689:7): [True: 0, False: 15.8k]
  |  Branch (689:22): [True: 316, False: 15.5k]
  ------------------
  690|    316|    return false;
  691|    316|  }
  692|  15.5k|  bool matched = buf == PsdHeader;
  693|  15.5k|  if (!advance || !matched) {
  ------------------
  |  Branch (693:7): [True: 15.5k, False: 0]
  |  Branch (693:19): [True: 0, False: 0]
  ------------------
  694|  15.5k|    iIo.seek(-len, BasicIo::cur);
  695|  15.5k|  }
  696|       |
  697|  15.5k|  return matched;
  698|  15.8k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  540|  3.76k|    Image(ImageType::qtime, mdNone, std::move(io)),
  541|  3.76k|    mvhdTimeScale_(1),
  542|  3.76k|    mdhdTimeScale_(1),
  543|  3.76k|    currentStream_(Null),
  544|  3.76k|    max_recursion_depth_(max_recursion_depth) {
  545|  3.76k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  4.53k|std::string QuickTimeVideo::mimeType() const {
  548|  4.53k|  return "video/quicktime";
  549|  4.53k|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  3.75k|void QuickTimeVideo::readMetadata() {
  555|  3.75k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.75k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  3.75k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 3.75k]
  ------------------
  560|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  |  Branch (560:25): [True: 0, False: 0]
  ------------------
  561|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  562|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  563|      0|  }
  564|       |
  565|  3.75k|  IoCloser closer(*io_);
  566|  3.75k|  clearMetadata();
  567|  3.75k|  continueTraversing_ = true;
  568|  3.75k|  height_ = width_ = 1;
  569|       |
  570|  3.75k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  3.75k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  35.2k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 31.4k, False: 3.75k]
  ------------------
  574|  31.4k|    decodeBlock(0);
  575|       |
  576|  3.75k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  3.75k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|   578k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|   578k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|   578k|  const long bufMinSize = 4;
  583|   578k|  DataBuf buf(bufMinSize + 1);
  584|   578k|  uint64_t size = 0;
  585|   578k|  buf.data()[4] = '\0';
  586|       |
  587|   578k|  io_->read(buf.data(), 4);
  588|   578k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 283, False: 578k]
  ------------------
  589|    283|    continueTraversing_ = false;
  590|    283|    return;
  591|    283|  }
  592|       |
  593|   578k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|   578k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|   578k|  size_t hdrsize = 8;
  599|       |
  600|   578k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 121, False: 577k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    121|    DataBuf data(8);
  603|    121|    hdrsize += 8;
  604|    121|    io_->readOrThrow(data.data(), data.size());
  605|    121|    size = data.read_uint64(0, bigEndian);
  606|   577k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 11.3k, False: 566k]
  |  Branch (606:27): [True: 11.1k, False: 129]
  ------------------
  607|  11.1k|    size = buf.read_uint32(0, bigEndian);
  608|  11.1k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  11.1k|  }
  610|       |
  611|   578k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|   578k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|   578k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|   578k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|   578k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 1.59k, False: 576k]
  ------------------
  618|  1.59k|    discard(newsize);
  619|  1.59k|    return;
  620|  1.59k|  }
  621|   576k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 559k, False: 16.7k]
  ------------------
  622|   559k|    buf.resize(newsize);
  623|   559k|  }
  624|   576k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|   576k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  1.08M|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  1.08M|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  1.08M|  assert(buf.size() > 4);
  638|       |
  639|  1.08M|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 1.08M]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  1.08M|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 545k, False: 538k]
  ------------------
  643|   545k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|   545k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 7.02k, False: 531k]
  ------------------
  645|  7.02k|    fileTypeDecoder(size);
  646|       |
  647|   531k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 2.20k, False: 529k]
  ------------------
  648|  2.20k|    setMediaStream(size);
  649|       |
  650|   529k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 634, False: 528k]
  ------------------
  651|    634|    movieHeaderDecoder(size);
  652|       |
  653|   528k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 475, False: 527k]
  ------------------
  654|    475|    trackHeaderDecoder(size);
  655|       |
  656|   527k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 1.38k, False: 526k]
  ------------------
  657|  1.38k|    mediaHeaderDecoder(size);
  658|       |
  659|   526k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 11.9k, False: 514k]
  ------------------
  660|  11.9k|    handlerDecoder(size);
  661|       |
  662|   514k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 5.49k, False: 509k]
  ------------------
  663|  5.49k|    videoHeaderDecoder(size);
  664|       |
  665|   509k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 438k, False: 70.5k]
  ------------------
  666|   438k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  70.5k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 771, False: 69.7k]
  ------------------
  669|    771|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  69.7k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 805, False: 68.9k]
  ------------------
  672|    805|    sampleDesc(size);
  673|       |
  674|  68.9k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 335, False: 68.6k]
  ------------------
  675|    335|    timeToSampleDecoder();
  676|       |
  677|  68.6k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 895, False: 67.7k]
  ------------------
  678|    895|    previewTagDecoder(size);
  679|       |
  680|  67.7k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 1.01k, False: 66.7k]
  ------------------
  681|  1.01k|    trackApertureTagDecoder(size);
  682|       |
  683|  66.7k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 1.76k, False: 64.9k]
  ------------------
  684|  1.76k|    keysTagDecoder(size);
  685|       |
  686|  64.9k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 251, False: 64.7k]
  ------------------
  687|    251|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 63, False: 188]
  ------------------
  688|     63|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    188|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 116, False: 72]
  ------------------
  690|    116|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|     72|    else
  692|     72|      discard(size);
  693|    251|  }
  694|       |
  695|  64.7k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 860, False: 63.8k]
  ------------------
  696|    860|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 485, False: 375]
  ------------------
  697|    485|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    375|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 93, False: 282]
  ------------------
  699|     93|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|    282|    else
  701|    282|      discard(size);
  702|    860|  }
  703|       |
  704|  63.8k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 539, False: 63.3k]
  ------------------
  705|    539|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|    539|  }
  707|       |
  708|  63.3k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 12, False: 63.3k]
  ------------------
  709|     12|    io_->readOrThrow(buf.data(), 4);
  710|     12|    io_->readOrThrow(buf.data(), 4);
  711|     12|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|     12|  }
  713|       |
  714|  63.3k|  else {
  715|  63.3k|    discard(size);
  716|  63.3k|  }
  717|  1.08M|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  65.2k|void QuickTimeVideo::discard(size_t size) {
  720|  65.2k|  size_t cur_pos = io_->tell();
  721|  65.2k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  65.2k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|    895|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|    895|  DataBuf buf(4);
  726|    895|  size_t cur_pos = io_->tell();
  727|    895|  io_->readOrThrow(buf.data(), 4);
  728|    895|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|    895|  io_->readOrThrow(buf.data(), 2);
  730|    895|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|    895|  io_->readOrThrow(buf.data(), 4);
  733|    895|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 223, False: 672]
  ------------------
  734|    223|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|    672|  else
  736|    672|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|    895|  io_->seek(cur_pos + size, BasicIo::beg);
  739|    895|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|  1.76k|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|  1.76k|  DataBuf buf(4);
  743|  1.76k|  size_t cur_pos = io_->tell();
  744|  1.76k|  io_->readOrThrow(buf.data(), 4);
  745|  1.76k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|  1.76k|  io_->readOrThrow(buf.data(), 2);
  747|  1.76k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|  1.76k|  io_->readOrThrow(buf.data(), 4);
  750|  1.76k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 1.22k, False: 544]
  ------------------
  751|  1.22k|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    544|  else
  753|    544|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|  1.76k|  io_->seek(cur_pos + size, BasicIo::beg);
  756|  1.76k|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|  1.01k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|  1.01k|  DataBuf buf(4);
  760|  1.01k|  DataBuf buf2(2);
  761|  1.01k|  size_t cur_pos = io_->tell();
  762|  1.01k|  byte n = 3;
  763|       |
  764|  4.05k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 3.03k, False: 1.01k]
  ------------------
  765|  3.03k|    io_->seek(4L, BasicIo::cur);
  766|  3.03k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  3.03k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 278, False: 2.75k]
  ------------------
  769|    278|      io_->seek(4L, BasicIo::cur);
  770|    278|      io_->readOrThrow(buf.data(), 2);
  771|    278|      io_->readOrThrow(buf2.data(), 2);
  772|    278|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|    278|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    278|#define stringFormat std::format
  ------------------
  774|    278|      io_->readOrThrow(buf.data(), 2);
  775|    278|      io_->readOrThrow(buf2.data(), 2);
  776|    278|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|    278|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    278|#define stringFormat std::format
  ------------------
  778|    278|    }
  779|       |
  780|  2.75k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 89, False: 2.66k]
  ------------------
  781|     89|      io_->seek(4L, BasicIo::cur);
  782|     89|      io_->readOrThrow(buf.data(), 2);
  783|     89|      io_->readOrThrow(buf2.data(), 2);
  784|     89|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|     89|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     89|#define stringFormat std::format
  ------------------
  786|     89|      io_->readOrThrow(buf.data(), 2);
  787|     89|      io_->readOrThrow(buf2.data(), 2);
  788|     89|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|     89|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     89|#define stringFormat std::format
  ------------------
  790|     89|    }
  791|       |
  792|  2.66k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 17, False: 2.65k]
  ------------------
  793|     17|      io_->seek(4L, BasicIo::cur);
  794|     17|      io_->readOrThrow(buf.data(), 2);
  795|     17|      io_->readOrThrow(buf2.data(), 2);
  796|     17|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|     17|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     17|#define stringFormat std::format
  ------------------
  798|     17|      io_->readOrThrow(buf.data(), 2);
  799|     17|      io_->readOrThrow(buf2.data(), 2);
  800|     17|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|     17|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     17|#define stringFormat std::format
  ------------------
  802|     17|    }
  803|  3.03k|  }
  804|  1.01k|  io_->seek(cur_pos + size, BasicIo::beg);
  805|  1.01k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|  3.53k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|  3.53k|  size_t cur_pos = io_->tell();
  809|  3.53k|  DataBuf buf(50);
  810|  3.53k|  DataBuf buf2(4);
  811|       |
  812|  3.53k|  io_->readOrThrow(buf.data(), 4);
  813|  3.53k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 2.89k, False: 643]
  ------------------
  814|  2.89k|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|  2.89k|    io_->readOrThrow(buf.data(), 24);
  817|  2.89k|    xmpData_["Xmp.video.Make"] = buf.data();
  818|  2.89k|    io_->readOrThrow(buf.data(), 14);
  819|  2.89k|    xmpData_["Xmp.video.Model"] = buf.data();
  820|  2.89k|    io_->readOrThrow(buf.data(), 4);
  821|  2.89k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  2.89k|#define stringFormat std::format
  ------------------
  822|  2.89k|    io_->readOrThrow(buf.data(), 4);
  823|  2.89k|    io_->readOrThrow(buf2.data(), 4);
  824|  2.89k|    xmpData_["Xmp.video.FNumber"] =
  825|  2.89k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|  2.89k|    io_->readOrThrow(buf.data(), 4);
  827|  2.89k|    io_->readOrThrow(buf2.data(), 4);
  828|  2.89k|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|  2.89k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|  2.89k|    io_->readOrThrow(buf.data(), 10);
  831|  2.89k|    io_->readOrThrow(buf.data(), 4);
  832|  2.89k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 1.40k, False: 1.49k]
  ------------------
  833|  1.40k|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|  1.40k|#define _(String) (String)
  ------------------
  834|  2.89k|    io_->readOrThrow(buf.data(), 4);
  835|  2.89k|    io_->readOrThrow(buf2.data(), 4);
  836|  2.89k|    xmpData_["Xmp.video.FocalLength"] =
  837|  2.89k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|  2.89k|    io_->seek(95L, BasicIo::cur);
  839|  2.89k|    io_->readOrThrow(buf.data(), 48);
  840|  2.89k|    buf.write_uint8(48, 0);
  841|  2.89k|    xmpData_["Xmp.video.Software"] = buf.data();
  842|  2.89k|    io_->readOrThrow(buf.data(), 4);
  843|  2.89k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|  2.89k|  }
  845|       |
  846|  3.53k|  io_->seek(cur_pos + size, BasicIo::beg);
  847|  3.53k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|   438k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|   438k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|   438k|  size_t cur_pos = io_->tell();
  852|   438k|  const TagVocabulary* td;
  853|   438k|  const TagVocabulary* tv;
  854|   438k|  const TagVocabulary* tv_internal;
  855|       |
  856|   438k|  const long bufMinSize = 100;
  857|   438k|  DataBuf buf(bufMinSize);
  858|   438k|  size_t size_internal = outer_size;
  859|   438k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  1.01M|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 1.00M, False: 9.35k]
  |  Branch (861:38): [True: 1.00M, False: 0]
  ------------------
  862|  1.00M|    buf.data()[4] = '\0';
  863|  1.00M|    io_->readOrThrow(buf.data(), 4);
  864|  1.00M|    const size_t size = buf.read_uint32(0, bigEndian);
  865|  1.00M|    if (size > size_internal)
  ------------------
  |  Branch (865:9): [True: 420k, False: 582k]
  ------------------
  866|   420k|      break;
  867|   582k|    size_internal -= size;
  868|   582k|    io_->readOrThrow(buf.data(), 4);
  869|       |
  870|   582k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (870:9): [True: 211, False: 582k]
  ------------------
  871|    211|      buf.data()[0] = ' ';
  872|   582k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  873|       |
  874|   582k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  875|       |
  876|   582k|    if (size <= 12)
  ------------------
  |  Branch (876:9): [True: 8.87k, False: 573k]
  ------------------
  877|  8.87k|      break;
  878|       |
  879|   573k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (879:9): [True: 78, False: 573k]
  |  Branch (879:40): [True: 231, False: 573k]
  ------------------
  880|    294|      userDataDecoder(size - 8, recursion_depth + 1);
  881|       |
  882|   573k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (882:14): [True: 6.28k, False: 567k]
  ------------------
  883|  6.28k|      NikonTagsDecoder(size - 8);
  884|       |
  885|   567k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (885:14): [True: 3.53k, False: 563k]
  ------------------
  886|  3.53k|      CameraTagsDecoder(size - 8);
  887|       |
  888|   563k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (888:14): [True: 490, False: 563k]
  |  Branch (888:45): [True: 259, False: 562k]
  |  Branch (888:76): [True: 83, False: 562k]
  ------------------
  889|   562k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (889:14): [True: 352, False: 562k]
  |  Branch (889:45): [True: 201, False: 562k]
  ------------------
  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|   562k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (894:14): [True: 488, False: 561k]
  |  Branch (894:45): [True: 0, False: 561k]
  ------------------
  895|    473|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  896|    473|      io_->readOrThrow(buf.data(), 2);
  897|    473|      buf.data()[2] = '\0';
  898|    473|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  899|       |
  900|    473|      if (tv_internal)
  ------------------
  |  Branch (900:11): [True: 291, False: 182]
  ------------------
  901|    291|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    291|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    291|#define _(String) (String)
  ------------------
  902|    182|      else
  903|    182|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|    182|#define _(String) (String)
  ------------------
  904|    473|    }
  905|       |
  906|   561k|    else if (tv) {
  ------------------
  |  Branch (906:14): [True: 836, False: 560k]
  ------------------
  907|    836|      io_->readOrThrow(buf.data(), 4);
  908|    836|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    836|#define _(String) (String)
  ------------------
  909|    836|    }
  910|       |
  911|   560k|    else if (td)
  ------------------
  |  Branch (911:14): [True: 509k, False: 51.6k]
  ------------------
  912|   509k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  913|   573k|  }
  914|       |
  915|   438k|  io_->seek(cur_pos + outer_size, BasicIo::beg);
  916|   438k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  6.28k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  6.28k|  size_t cur_pos = io_->tell();
  920|  6.28k|  DataBuf buf(201);
  921|  6.28k|  DataBuf buf2(4 + 1);
  922|  6.28k|  uint32_t TagID = 0;
  923|  6.28k|  uint16_t dataLength = 0;
  924|  6.28k|  uint16_t dataType = 2;
  925|  6.28k|  const TagDetails* td;
  926|  6.28k|  const TagDetails* td2;
  927|       |
  928|   577k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 570k, False: 6.28k]
  ------------------
  929|   570k|    io_->readOrThrow(buf.data(), 4);
  930|   570k|    TagID = buf.read_uint32(0, bigEndian);
  931|   570k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   570k|    io_->readOrThrow(buf.data(), 2);
  934|   570k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   570k|    std::memset(buf.data(), 0x0, buf.size());
  937|   570k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   570k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 10.9k, False: 559k]
  ------------------
  940|  10.9k|      size_t local_pos = io_->tell();
  941|  10.9k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  10.9k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  10.9k|      io_->readOrThrow(buf.data(), 4);
  945|  10.9k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  10.9k|      io_->readOrThrow(buf.data(), 20);
  947|  10.9k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  10.9k|      io_->readOrThrow(buf.data(), 20);
  949|  10.9k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  10.9k|      io_->readOrThrow(buf.data(), 4);
  951|  10.9k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  10.9k|      io_->readOrThrow(buf.data(), 1);
  954|  10.9k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  10.9k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 5.67k, False: 5.26k]
  ------------------
  956|  5.67k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  5.67k|#define _(String) (String)
  ------------------
  957|  5.26k|      else
  958|  5.26k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  10.9k|      io_->readOrThrow(buf.data(), 1);
  961|  10.9k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  10.9k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 5.87k, False: 5.07k]
  ------------------
  963|  5.87k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  5.87k|#define _(String) (String)
  ------------------
  964|       |
  965|  10.9k|      io_->readOrThrow(buf.data(), 1);
  966|  10.9k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  10.9k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 5.85k, False: 5.08k]
  ------------------
  968|  5.85k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  5.85k|#define _(String) (String)
  ------------------
  969|  5.08k|      else
  970|  5.08k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  10.9k|      io_->readOrThrow(buf.data(), 1);
  973|  10.9k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  10.9k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 5.39k, False: 5.54k]
  ------------------
  975|  5.39k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  5.39k|#define _(String) (String)
  ------------------
  976|  5.54k|      else
  977|  5.54k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  10.9k|      io_->readOrThrow(buf.data(), 1);
  980|  10.9k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  10.9k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 6.66k, False: 4.27k]
  ------------------
  982|  6.66k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  6.66k|#define _(String) (String)
  ------------------
  983|  4.27k|      else
  984|  4.27k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  10.9k|      io_->readOrThrow(buf.data(), 1);
  987|  10.9k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  10.9k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 5.88k, False: 5.05k]
  ------------------
  989|  5.88k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  5.88k|#define _(String) (String)
  ------------------
  990|  5.05k|      else
  991|  5.05k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  10.9k|      io_->readOrThrow(buf.data(), 1);
  994|  10.9k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  10.9k|      io_->readOrThrow(buf.data(), 1);
  997|  10.9k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  10.9k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 1.99k, False: 8.95k]
  ------------------
  999|  1.99k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.99k|#define _(String) (String)
  ------------------
 1000|  8.95k|      else
 1001|  8.95k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  10.9k|      io_->readOrThrow(buf.data(), 1);
 1004|  10.9k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  10.9k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 3.26k, False: 7.68k]
  ------------------
 1006|  3.26k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  3.26k|#define _(String) (String)
  ------------------
 1007|  7.68k|      else
 1008|  7.68k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  10.9k|      io_->readOrThrow(buf.data(), 1);
 1011|  10.9k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  10.9k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  10.9k|    }
 1015|       |
 1016|   559k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 1.90k, False: 557k]
  ------------------
 1017|  1.90k|      size_t local_pos = io_->tell();
 1018|  1.90k|      dataLength = buf.read_uint16(0, bigEndian);
 1019|  1.90k|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|  1.90k|      io_->readOrThrow(buf.data(), 2);
 1022|  1.90k|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|  1.90k|      io_->readOrThrow(buf.data(), 1);
 1024|  1.90k|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|  1.90k|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 1.65k, False: 251]
  ------------------
 1026|  1.65k|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|  1.65k|#define _(String) (String)
  ------------------
 1027|       |
 1028|  1.90k|      io_->readOrThrow(buf.data(), 1);
 1029|  1.90k|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|  1.90k|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 546, False: 1.35k]
  ------------------
 1031|    546|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    546|#define _(String) (String)
  ------------------
 1032|       |
 1033|  1.90k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|  1.90k|    }
 1035|       |
 1036|   557k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 6.32k, False: 551k]
  |  Branch (1036:31): [True: 1.21k, False: 550k]
  ------------------
 1037|  6.92k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  6.92k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  6.92k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 2.45k, False: 4.46k]
  ------------------
 1042|  2.45k|#ifndef SUPPRESS_WARNINGS
 1043|  2.45k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|  2.45k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.45k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.45k|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|  2.45k|#endif
 1046|  2.45k|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|  2.45k|        buf.data()[0] = '\0';
 1048|  4.46k|      } else {
 1049|  4.46k|        io_->readOrThrow(buf.data(), dataLength);
 1050|  4.46k|        buf.data()[dataLength] = '\0';
 1051|  4.46k|      }
 1052|       |
 1053|  6.92k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 1.41k, False: 5.50k]
  ------------------
 1054|  1.41k|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|  1.41k|#define _(String) (String)
  ------------------
 1055|  1.41k|      }
 1056|   551k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 4.11k, False: 546k]
  ------------------
 1057|  4.11k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  4.11k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  4.11k|      io_->readOrThrow(buf.data(), 4);
 1060|  4.11k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 868, False: 3.24k]
  ------------------
 1061|    868|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    868|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  4.11k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 1.44k, False: 2.67k]
  |  Branch (1064:31): [True: 2.50k, False: 167]
  ------------------
 1065|  3.94k|#ifndef SUPPRESS_WARNINGS
 1066|  3.94k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.94k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.94k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.94k|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|  3.94k|#endif
 1069|  3.94k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|  3.94k|      } else
 1071|    167|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|   546k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 2.55k, False: 544k]
  ------------------
 1073|  2.55k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  2.55k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  2.55k|      io_->readOrThrow(buf.data(), 2);
 1076|  2.55k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 571, False: 1.98k]
  ------------------
 1077|    571|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    571|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  2.55k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 1.16k, False: 1.39k]
  |  Branch (1080:31): [True: 935, False: 461]
  ------------------
 1081|  2.09k|#ifndef SUPPRESS_WARNINGS
 1082|  2.09k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.09k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.09k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.09k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  2.09k|#endif
 1085|  2.09k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  2.09k|      } else
 1087|    461|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|   544k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 3.00k, False: 541k]
  ------------------
 1089|  3.00k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  3.00k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  3.00k|      io_->readOrThrow(buf.data(), 4);
 1092|  3.00k|      io_->readOrThrow(buf2.data(), 4);
 1093|  3.00k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 1.23k, False: 1.77k]
  ------------------
 1094|  1.23k|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|  1.23k|#define _(String) (String)
  ------------------
 1095|  1.23k|            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|  3.00k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 1.79k, False: 1.21k]
  |  Branch (1098:31): [True: 863, False: 347]
  ------------------
 1099|  2.65k|#ifndef SUPPRESS_WARNINGS
 1100|  2.65k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.65k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.65k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.65k|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|  2.65k|#endif
 1103|  2.65k|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|  2.65k|      } else
 1105|    349|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|   541k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 3.06k, False: 538k]
  ------------------
 1107|  3.06k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  3.06k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  3.06k|      io_->readOrThrow(buf.data(), 2);
 1110|  3.06k|      io_->readOrThrow(buf2.data(), 2);
 1111|  3.06k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 1.21k, False: 1.84k]
  ------------------
 1112|  1.21k|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|  1.21k|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|  1.21k|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  3.06k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 1.46k, False: 1.59k]
  |  Branch (1115:31): [True: 1.24k, False: 348]
  ------------------
 1116|  2.71k|#ifndef SUPPRESS_WARNINGS
 1117|  2.71k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.71k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.71k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.71k|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|  2.71k|#endif
 1120|  2.71k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|  2.71k|      } else
 1122|    348|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  3.06k|    }
 1124|   570k|  }
 1125|       |
 1126|  6.28k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  6.28k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  2.20k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  2.20k|  size_t current_position = io_->tell();
 1131|  2.20k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  2.20k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 2.20k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  2.20k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  32.7k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 32.7k, False: 0]
  |  Branch (1136:25): [True: 32.1k, False: 666]
  ------------------
 1137|  32.1k|    io_->readOrThrow(buf.data(), 4);
 1138|  32.1k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 1.53k, False: 30.5k]
  ------------------
 1139|  1.53k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 53, False: 1.48k]
  ------------------
 1140|     53|        break;
 1141|  1.48k|      io_->readOrThrow(buf.data(), 4);
 1142|  1.48k|      io_->readOrThrow(buf.data(), 4);
 1143|  1.48k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  1.48k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 78, False: 1.40k]
  ------------------
 1146|     78|        currentStream_ = Video;
 1147|  1.40k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 495, False: 913]
  ------------------
 1148|    495|        currentStream_ = Audio;
 1149|    913|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 22, False: 891]
  ------------------
 1150|     22|        currentStream_ = Hint;
 1151|    891|      else
 1152|    891|        currentStream_ = GenMediaHeader;
 1153|  1.48k|      break;
 1154|  1.53k|    }
 1155|  32.1k|  }
 1156|       |
 1157|  2.20k|  io_->seek(current_position, BasicIo::beg);
 1158|  2.20k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|    335|void QuickTimeVideo::timeToSampleDecoder() {
 1161|    335|  DataBuf buf(4 + 1);
 1162|    335|  io_->readOrThrow(buf.data(), 4);
 1163|    335|  io_->readOrThrow(buf.data(), 4);
 1164|    335|  uint64_t totalframes = 0;
 1165|    335|  uint64_t timeOfFrames = 0;
 1166|    335|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|    965|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 630, False: 335]
  ------------------
 1169|    630|    io_->readOrThrow(buf.data(), 4);
 1170|    630|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|    630|    totalframes = Safe::add(totalframes, temp);
 1172|    630|    io_->readOrThrow(buf.data(), 4);
 1173|    630|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|    630|  }
 1175|    335|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 212, False: 123]
  ------------------
 1176|    212|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 17, False: 195]
  ------------------
 1177|     17|      timeOfFrames = 1;
 1178|    212|    xmpData_["Xmp.video.FrameRate"] =
 1179|    212|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    212|  }
 1181|    335|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|    805|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|    805|  DataBuf buf(100);
 1185|    805|  size_t cur_pos = io_->tell();
 1186|    805|  io_->readOrThrow(buf.data(), 4);
 1187|    805|  io_->readOrThrow(buf.data(), 4);
 1188|    805|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|  28.8k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 28.1k, False: 687]
  ------------------
 1191|  28.1k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 13.6k, False: 14.4k]
  ------------------
 1192|  13.6k|      imageDescDecoder();
 1193|  14.4k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 14.3k, False: 118]
  ------------------
 1194|  14.3k|      audioDescDecoder();
 1195|    118|    else
 1196|    118|      break;
 1197|  28.1k|  }
 1198|    805|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|    805|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  14.3k|void QuickTimeVideo::audioDescDecoder() {
 1202|  14.3k|  DataBuf buf(40);
 1203|  14.3k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  14.3k|  buf.data()[4] = '\0';
 1205|  14.3k|  io_->readOrThrow(buf.data(), 4);
 1206|  14.3k|  size_t size = 82;
 1207|       |
 1208|  14.3k|  const TagVocabulary* td;
 1209|       |
 1210|   300k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 286k, False: 14.3k]
  ------------------
 1211|   286k|    io_->readOrThrow(buf.data(), 4);
 1212|   286k|    switch (i) {
 1213|  14.3k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 14.3k, False: 272k]
  ------------------
 1214|  14.3k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  14.3k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 255, False: 14.0k]
  ------------------
 1216|    255|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    255|#define _(String) (String)
  ------------------
 1217|  14.0k|        else
 1218|  14.0k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  14.3k|        break;
 1220|  14.3k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 14.3k, False: 272k]
  ------------------
 1221|  14.3k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  14.3k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 377, False: 13.9k]
  ------------------
 1223|    377|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    377|#define _(String) (String)
  ------------------
 1224|  14.3k|        break;
 1225|  14.3k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 14.3k, False: 272k]
  ------------------
 1226|  14.3k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  14.3k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  14.3k|        break;
 1229|  14.3k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 14.3k, False: 272k]
  ------------------
 1230|  14.3k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  14.3k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  14.3k|        break;
 1233|   229k|      default:
  ------------------
  |  Branch (1233:7): [True: 229k, False: 57.4k]
  ------------------
 1234|   229k|        break;
 1235|   286k|    }
 1236|   286k|  }
 1237|  14.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  14.3k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  13.6k|void QuickTimeVideo::imageDescDecoder() {
 1241|  13.6k|  DataBuf buf(40);
 1242|  13.6k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  13.6k|  buf.data()[4] = '\0';
 1244|  13.6k|  io_->readOrThrow(buf.data(), 4);
 1245|  13.6k|  size_t size = 82;
 1246|       |
 1247|  13.6k|  const TagVocabulary* td;
 1248|       |
 1249|   163k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 149k, False: 13.5k]
  ------------------
 1250|   149k|    io_->readOrThrow(buf.data(), 4);
 1251|       |
 1252|   149k|    switch (i) {
 1253|  13.6k|      case codec:
  ------------------
  |  Branch (1253:7): [True: 13.6k, False: 136k]
  ------------------
 1254|  13.6k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1255|  13.6k|        if (td)
  ------------------
  |  Branch (1255:13): [True: 673, False: 12.9k]
  ------------------
 1256|    673|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    673|#define _(String) (String)
  ------------------
 1257|  12.9k|        else
 1258|  12.9k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1259|  13.6k|        break;
 1260|  13.6k|      case VendorID:
  ------------------
  |  Branch (1260:7): [True: 13.6k, False: 136k]
  ------------------
 1261|  13.6k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1262|  13.6k|        if (td)
  ------------------
  |  Branch (1262:13): [True: 546, False: 13.0k]
  ------------------
 1263|    546|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    546|#define _(String) (String)
  ------------------
 1264|  13.6k|        break;
 1265|  13.6k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1265:7): [True: 13.6k, False: 136k]
  ------------------
 1266|  13.6k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1267|  13.6k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1268|  13.6k|        break;
 1269|  13.6k|      case XResolution:
  ------------------
  |  Branch (1269:7): [True: 13.6k, False: 136k]
  ------------------
 1270|  13.6k|        xmpData_["Xmp.video.XResolution"] =
 1271|  13.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1272|  13.6k|        break;
 1273|  13.6k|      case YResolution:
  ------------------
  |  Branch (1273:7): [True: 13.6k, False: 136k]
  ------------------
 1274|  13.6k|        xmpData_["Xmp.video.YResolution"] =
 1275|  13.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1276|  13.6k|        io_->readOrThrow(buf.data(), 3);
 1277|  13.6k|        size -= 3;
 1278|  13.6k|        break;
 1279|  13.6k|      case CompressorName:
  ------------------
  |  Branch (1279:7): [True: 13.6k, False: 136k]
  ------------------
 1280|  13.6k|        io_->readOrThrow(buf.data(), 32);
 1281|  13.6k|        size -= 32;
 1282|  13.6k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1283|  13.6k|        break;
 1284|  68.1k|      default:
  ------------------
  |  Branch (1284:7): [True: 68.1k, False: 81.7k]
  ------------------
 1285|  68.1k|        break;
 1286|   149k|    }
 1287|   149k|  }
 1288|  13.5k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1289|  13.5k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1290|  13.5k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1292|    771|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1293|    771|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1294|    771|  DataBuf buf(4 + 1);
 1295|    771|  io_->readOrThrow(buf.data(), 4);
 1296|    771|  io_->readOrThrow(buf.data(), 4);
 1297|    771|  uint32_t noOfEntries;
 1298|       |
 1299|    771|  noOfEntries = buf.read_uint32(0, bigEndian);
 1300|       |
 1301|  2.25k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1301:24): [True: 1.58k, False: 677]
  |  Branch (1301:43): [True: 1.48k, False: 94]
  ------------------
 1302|  1.48k|    decodeBlock(recursion_depth + 1);
 1303|  1.48k|  }
 1304|    771|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1306|  5.49k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1307|  5.49k|  DataBuf buf(3);
 1308|  5.49k|  std::memset(buf.data(), 0x0, buf.size());
 1309|  5.49k|  buf.data()[2] = '\0';
 1310|  5.49k|  currentStream_ = Video;
 1311|       |
 1312|  5.49k|  const TagDetails* td;
 1313|       |
 1314|  48.8k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1314:19): [True: 43.3k, False: 5.49k]
  ------------------
 1315|  43.3k|    io_->readOrThrow(buf.data(), 2);
 1316|       |
 1317|  43.3k|    switch (i) {
 1318|  5.17k|      case GraphicsMode:
  ------------------
  |  Branch (1318:7): [True: 5.17k, False: 38.2k]
  ------------------
 1319|  5.17k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1320|  5.17k|        if (td)
  ------------------
  |  Branch (1320:13): [True: 4.44k, False: 730]
  ------------------
 1321|  4.44k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  4.44k|#define _(String) (String)
  ------------------
 1322|  5.17k|        break;
 1323|  4.14k|      case OpColor:
  ------------------
  |  Branch (1323:7): [True: 4.14k, False: 39.2k]
  ------------------
 1324|  4.14k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1325|  4.14k|        break;
 1326|  34.0k|      default:
  ------------------
  |  Branch (1326:7): [True: 34.0k, False: 9.31k]
  ------------------
 1327|  34.0k|        break;
 1328|  43.3k|    }
 1329|  43.3k|  }
 1330|  5.49k|  io_->readOrThrow(buf.data(), size % 2);
 1331|  5.49k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1333|  11.9k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1334|  11.9k|  size_t cur_pos = io_->tell();
 1335|  11.9k|  DataBuf buf(100);
 1336|  11.9k|  std::memset(buf.data(), 0x0, buf.size());
 1337|  11.9k|  buf.data()[4] = '\0';
 1338|       |
 1339|  11.9k|  const TagVocabulary* tv;
 1340|       |
 1341|  71.9k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1341:19): [True: 59.9k, False: 11.9k]
  ------------------
 1342|  59.9k|    io_->readOrThrow(buf.data(), 4);
 1343|       |
 1344|  59.9k|    switch (i) {
  ------------------
  |  Branch (1344:13): [True: 35.9k, False: 23.9k]
  ------------------
 1345|  11.9k|      case HandlerClass:
  ------------------
  |  Branch (1345:7): [True: 11.9k, False: 47.9k]
  ------------------
 1346|  11.9k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1347|  11.9k|        if (tv) {
  ------------------
  |  Branch (1347:13): [True: 637, False: 11.3k]
  ------------------
 1348|    637|          if (currentStream_ == Video)
  ------------------
  |  Branch (1348:15): [True: 207, False: 430]
  ------------------
 1349|    207|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    207|#define _(String) (String)
  ------------------
 1350|    430|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1350:20): [True: 222, False: 208]
  ------------------
 1351|    222|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    222|#define _(String) (String)
  ------------------
 1352|    637|        }
 1353|  11.9k|        break;
 1354|  11.9k|      case HandlerType:
  ------------------
  |  Branch (1354:7): [True: 11.9k, False: 47.9k]
  ------------------
 1355|  11.9k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1356|  11.9k|        if (tv) {
  ------------------
  |  Branch (1356:13): [True: 7.91k, False: 4.07k]
  ------------------
 1357|  7.91k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1357:15): [True: 313, False: 7.59k]
  ------------------
 1358|    313|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    313|#define _(String) (String)
  ------------------
 1359|  7.59k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1359:20): [True: 468, False: 7.13k]
  ------------------
 1360|    468|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    468|#define _(String) (String)
  ------------------
 1361|  7.91k|        }
 1362|  11.9k|        break;
 1363|  11.9k|      case HandlerVendorID:
  ------------------
  |  Branch (1363:7): [True: 11.9k, False: 47.9k]
  ------------------
 1364|  11.9k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1365|  11.9k|        if (tv) {
  ------------------
  |  Branch (1365:13): [True: 5.26k, False: 6.71k]
  ------------------
 1366|  5.26k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1366:15): [True: 226, False: 5.04k]
  ------------------
 1367|    226|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    226|#define _(String) (String)
  ------------------
 1368|  5.04k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1368:20): [True: 519, False: 4.52k]
  ------------------
 1369|    519|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    519|#define _(String) (String)
  ------------------
 1370|  5.26k|        }
 1371|  11.9k|        break;
 1372|  59.9k|    }
 1373|  59.9k|  }
 1374|  11.9k|  io_->seek(cur_pos + size, BasicIo::beg);
 1375|  11.9k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1377|  7.02k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1378|  7.02k|  DataBuf buf(5);
 1379|  7.02k|  std::memset(buf.data(), 0x0, buf.size());
 1380|  7.02k|  buf.data()[4] = '\0';
 1381|  7.02k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1382|  7.02k|  const TagVocabulary* td;
 1383|       |
 1384|   137k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1384:19): [True: 130k, False: 7.02k]
  ------------------
 1385|   130k|    io_->readOrThrow(buf.data(), 4);
 1386|   130k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1387|       |
 1388|   130k|    switch (i) {
 1389|  6.70k|      case 0:
  ------------------
  |  Branch (1389:7): [True: 6.70k, False: 124k]
  ------------------
 1390|  6.70k|        if (td)
  ------------------
  |  Branch (1390:13): [True: 6.08k, False: 615]
  ------------------
 1391|  6.08k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  6.08k|#define _(String) (String)
  ------------------
 1392|  6.70k|        break;
 1393|  2.38k|      case 1:
  ------------------
  |  Branch (1393:7): [True: 2.38k, False: 128k]
  ------------------
 1394|  2.38k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1395|  2.38k|        break;
 1396|   121k|      default:
  ------------------
  |  Branch (1396:7): [True: 121k, False: 9.08k]
  ------------------
 1397|   121k|        if (td)
  ------------------
  |  Branch (1397:13): [True: 1.88k, False: 119k]
  ------------------
 1398|  1.88k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.88k|#define _(String) (String)
  ------------------
 1399|   119k|        else
 1400|   119k|          v->read(Exiv2::toString(buf.data()));
 1401|   121k|        break;
 1402|   130k|    }
 1403|   130k|  }
 1404|  7.02k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1405|  7.02k|  io_->readOrThrow(buf.data(), size % 4);
 1406|  7.02k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1408|  1.38k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1409|  1.38k|  DataBuf buf(5);
 1410|  1.38k|  std::memset(buf.data(), 0x0, buf.size());
 1411|  1.38k|  buf.data()[4] = '\0';
 1412|  1.38k|  int64_t time_scale = 1;
 1413|       |
 1414|  7.55k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1414:19): [True: 6.17k, False: 1.38k]
  ------------------
 1415|  6.17k|    io_->readOrThrow(buf.data(), 4);
 1416|       |
 1417|  6.17k|    switch (i) {
 1418|  1.31k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1418:7): [True: 1.31k, False: 4.85k]
  ------------------
 1419|  1.31k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1419:13): [True: 739, False: 578]
  ------------------
 1420|    739|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1421|    578|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1421:18): [True: 324, False: 254]
  ------------------
 1422|    324|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1423|  1.31k|        break;
 1424|    551|      case MediaCreateDate:
  ------------------
  |  Branch (1424:7): [True: 551, False: 5.62k]
  ------------------
 1425|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1426|    551|        if (currentStream_ == Video)
  ------------------
  |  Branch (1426:13): [True: 74, False: 477]
  ------------------
 1427|     74|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1428|    477|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1428:18): [True: 289, False: 188]
  ------------------
 1429|    289|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1430|    551|        break;
 1431|    551|      case MediaModifyDate:
  ------------------
  |  Branch (1431:7): [True: 551, False: 5.62k]
  ------------------
 1432|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1433|    551|        if (currentStream_ == Video)
  ------------------
  |  Branch (1433:13): [True: 74, False: 477]
  ------------------
 1434|     74|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1435|    477|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1435:18): [True: 289, False: 188]
  ------------------
 1436|    289|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1437|    551|        break;
 1438|    546|      case MediaTimeScale:
  ------------------
  |  Branch (1438:7): [True: 546, False: 5.62k]
  ------------------
 1439|    546|        if (currentStream_ == Video)
  ------------------
  |  Branch (1439:13): [True: 70, False: 476]
  ------------------
 1440|     70|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1441|    476|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1441:18): [True: 289, False: 187]
  ------------------
 1442|    289|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1443|    546|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1444|    546|        mdhdTimeScale_ = time_scale;
 1445|    546|        break;
 1446|    545|      case MediaDuration:
  ------------------
  |  Branch (1446:7): [True: 545, False: 5.62k]
  ------------------
 1447|    545|        if (currentStream_ == Video)
  ------------------
  |  Branch (1447:13): [True: 70, False: 475]
  ------------------
 1448|     70|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1448:49): [True: 70, False: 0]
  ------------------
 1449|    475|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1449:18): [True: 289, False: 186]
  ------------------
 1450|    289|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1450:49): [True: 289, False: 0]
  ------------------
 1451|    545|        break;
 1452|    545|      case MediaLanguageCode:
  ------------------
  |  Branch (1452:7): [True: 545, False: 5.62k]
  ------------------
 1453|    545|        if (currentStream_ == Video)
  ------------------
  |  Branch (1453:13): [True: 70, False: 475]
  ------------------
 1454|     70|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1455|    475|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1455:18): [True: 289, False: 186]
  ------------------
 1456|    289|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1457|    545|        break;
 1458|       |
 1459|  2.11k|      default:
  ------------------
  |  Branch (1459:7): [True: 2.11k, False: 4.05k]
  ------------------
 1460|  2.11k|        break;
 1461|  6.17k|    }
 1462|  6.17k|  }
 1463|  1.38k|  io_->readOrThrow(buf.data(), size % 4);
 1464|  1.38k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1466|    475|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1467|    475|  DataBuf buf(5);
 1468|    475|  std::memset(buf.data(), 0x0, buf.size());
 1469|    475|  buf.data()[4] = '\0';
 1470|    475|  int64_t temp = 0;
 1471|       |
 1472|  10.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1472:19): [True: 9.91k, False: 475]
  ------------------
 1473|  9.91k|    io_->readOrThrow(buf.data(), 4);
 1474|       |
 1475|  9.91k|    switch (i) {
 1476|    435|      case TrackHeaderVersion:
  ------------------
  |  Branch (1476:7): [True: 435, False: 9.48k]
  ------------------
 1477|    435|        if (currentStream_ == Video)
  ------------------
  |  Branch (1477:13): [True: 119, False: 316]
  ------------------
 1478|    119|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1479|    316|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1479:18): [True: 36, False: 280]
  ------------------
 1480|     36|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1481|    435|        break;
 1482|    400|      case TrackCreateDate:
  ------------------
  |  Branch (1482:7): [True: 400, False: 9.51k]
  ------------------
 1483|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1484|    400|        if (currentStream_ == Video)
  ------------------
  |  Branch (1484:13): [True: 119, False: 281]
  ------------------
 1485|    119|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1486|    281|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1486:18): [True: 36, False: 245]
  ------------------
 1487|     36|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1488|    400|        break;
 1489|    400|      case TrackModifyDate:
  ------------------
  |  Branch (1489:7): [True: 400, False: 9.51k]
  ------------------
 1490|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1491|    400|        if (currentStream_ == Video)
  ------------------
  |  Branch (1491:13): [True: 119, False: 281]
  ------------------
 1492|    119|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1493|    281|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1493:18): [True: 36, False: 245]
  ------------------
 1494|     36|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1495|    400|        break;
 1496|    400|      case TrackID:
  ------------------
  |  Branch (1496:7): [True: 400, False: 9.51k]
  ------------------
 1497|    400|        if (currentStream_ == Video)
  ------------------
  |  Branch (1497:13): [True: 119, False: 281]
  ------------------
 1498|    119|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1499|    281|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1499:18): [True: 36, False: 245]
  ------------------
 1500|     36|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1501|    400|        break;
 1502|    399|      case TrackDuration:
  ------------------
  |  Branch (1502:7): [True: 399, False: 9.52k]
  ------------------
 1503|    399|        if (currentStream_ == Video)
  ------------------
  |  Branch (1503:13): [True: 119, False: 280]
  ------------------
 1504|    119|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1504:49): [True: 119, False: 0]
  ------------------
 1505|    280|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1505:18): [True: 36, False: 244]
  ------------------
 1506|     36|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1506:49): [True: 36, False: 0]
  ------------------
 1507|    399|        break;
 1508|    396|      case TrackLayer:
  ------------------
  |  Branch (1508:7): [True: 396, False: 9.52k]
  ------------------
 1509|    396|        if (currentStream_ == Video)
  ------------------
  |  Branch (1509:13): [True: 118, False: 278]
  ------------------
 1510|    118|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1511|    278|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1511:18): [True: 36, False: 242]
  ------------------
 1512|     36|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1513|    396|        break;
 1514|    395|      case TrackVolume:
  ------------------
  |  Branch (1514:7): [True: 395, False: 9.52k]
  ------------------
 1515|    395|        if (currentStream_ == Video)
  ------------------
  |  Branch (1515:13): [True: 118, False: 277]
  ------------------
 1516|    118|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1517|    277|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1517:18): [True: 36, False: 241]
  ------------------
 1518|     36|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1519|    395|        break;
 1520|    337|      case ImageWidth:
  ------------------
  |  Branch (1520:7): [True: 337, False: 9.58k]
  ------------------
 1521|    337|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1521:13): [True: 69, False: 268]
  ------------------
 1522|     69|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1523|     69|          xmpData_["Xmp.video.Width"] = temp;
 1524|     69|          width_ = temp;
 1525|     69|        }
 1526|    337|        break;
 1527|    337|      case ImageHeight:
  ------------------
  |  Branch (1527:7): [True: 337, False: 9.58k]
  ------------------
 1528|    337|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1528:13): [True: 69, False: 268]
  ------------------
 1529|     69|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1530|     69|          xmpData_["Xmp.video.Height"] = temp;
 1531|     69|          height_ = temp;
 1532|     69|        }
 1533|    337|        break;
 1534|  6.42k|      default:
  ------------------
  |  Branch (1534:7): [True: 6.42k, False: 3.49k]
  ------------------
 1535|  6.42k|        break;
 1536|  9.91k|    }
 1537|  9.91k|  }
 1538|    475|  io_->readOrThrow(buf.data(), size % 4);
 1539|    475|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1541|    634|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1542|    634|  DataBuf buf(5);
 1543|    634|  std::memset(buf.data(), 0x0, buf.size());
 1544|    634|  buf.data()[4] = '\0';
 1545|       |
 1546|  7.06k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1546:19): [True: 6.42k, False: 634]
  ------------------
 1547|  6.42k|    io_->readOrThrow(buf.data(), 4);
 1548|       |
 1549|  6.42k|    switch (i) {
 1550|    590|      case MovieHeaderVersion:
  ------------------
  |  Branch (1550:7): [True: 590, False: 5.83k]
  ------------------
 1551|    590|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1552|    590|        break;
 1553|    580|      case CreateDate:
  ------------------
  |  Branch (1553:7): [True: 580, False: 5.84k]
  ------------------
 1554|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1555|    580|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1556|    580|        break;
 1557|    575|      case ModifyDate:
  ------------------
  |  Branch (1557:7): [True: 575, False: 5.85k]
  ------------------
 1558|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1559|    575|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1560|    575|        break;
 1561|    565|      case TimeScale:
  ------------------
  |  Branch (1561:7): [True: 565, False: 5.86k]
  ------------------
 1562|    565|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1563|    565|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1564|    565|        break;
 1565|    564|      case Duration:
  ------------------
  |  Branch (1565:7): [True: 564, False: 5.86k]
  ------------------
 1566|    564|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1566:13): [True: 564, False: 0]
  ------------------
 1567|    564|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1568|    564|        }
 1569|    564|        break;
 1570|    564|      case PreferredRate:
  ------------------
  |  Branch (1570:7): [True: 564, False: 5.86k]
  ------------------
 1571|    564|        xmpData_["Xmp.video.PreferredRate"] =
 1572|    564|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1573|    564|        break;
 1574|    564|      case PreferredVolume:
  ------------------
  |  Branch (1574:7): [True: 564, False: 5.86k]
  ------------------
 1575|    564|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1576|    564|        break;
 1577|     37|      case PreviewTime:
  ------------------
  |  Branch (1577:7): [True: 37, False: 6.39k]
  ------------------
 1578|     37|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1579|     37|        break;
 1580|     37|      case PreviewDuration:
  ------------------
  |  Branch (1580:7): [True: 37, False: 6.39k]
  ------------------
 1581|     37|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1582|     37|        break;
 1583|     37|      case PosterTime:
  ------------------
  |  Branch (1583:7): [True: 37, False: 6.39k]
  ------------------
 1584|     37|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1585|     37|        break;
 1586|     34|      case SelectionTime:
  ------------------
  |  Branch (1586:7): [True: 34, False: 6.39k]
  ------------------
 1587|     34|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1588|     34|        break;
 1589|     34|      case SelectionDuration:
  ------------------
  |  Branch (1589:7): [True: 34, False: 6.39k]
  ------------------
 1590|     34|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1591|     34|        break;
 1592|     34|      case CurrentTime:
  ------------------
  |  Branch (1592:7): [True: 34, False: 6.39k]
  ------------------
 1593|     34|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1594|     34|        break;
 1595|     33|      case NextTrackID:
  ------------------
  |  Branch (1595:7): [True: 33, False: 6.39k]
  ------------------
 1596|     33|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1597|     33|        break;
 1598|  2.18k|      default:
  ------------------
  |  Branch (1598:7): [True: 2.18k, False: 4.24k]
  ------------------
 1599|  2.18k|        break;
 1600|  6.42k|    }
 1601|  6.42k|  }
 1602|    634|  io_->readOrThrow(buf.data(), size % 4);
 1603|    634|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1605|  3.76k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool /*create*/) {
 1606|  3.76k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io));
 1607|  3.76k|  if (!image->good()) {
  ------------------
  |  Branch (1607:7): [True: 12, False: 3.75k]
  ------------------
 1608|     12|    return nullptr;
 1609|     12|  }
 1610|  3.75k|  return image;
 1611|  3.76k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1613|  19.3k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1614|  19.3k|  auto buf = DataBuf(12);
 1615|  19.3k|  iIo.read(buf.data(), 12);
 1616|       |
 1617|  19.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 19.3k]
  |  Branch (1617:22): [True: 306, False: 19.0k]
  ------------------
 1618|    306|    return false;
 1619|    306|  }
 1620|  19.0k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1621|       |
 1622|  19.0k|  bool matched = false;
 1623|       |
 1624|  97.4k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1624:24): [True: 97.4k, False: 4.75k]
  ------------------
 1625|  97.4k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1626|  97.4k|    if (tmp == 0) {
  ------------------
  |  Branch (1626:9): [True: 14.2k, False: 83.1k]
  ------------------
 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|  14.2k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1630:11): [True: 11.2k, False: 2.97k]
  ------------------
 1631|  11.2k|        matched = true;
 1632|  11.2k|      }
 1633|  14.2k|      break;
 1634|  14.2k|    }
 1635|  97.4k|  }
 1636|       |
 1637|  19.0k|  if (!advance || !matched) {
  ------------------
  |  Branch (1637:7): [True: 19.0k, False: 0]
  |  Branch (1637:19): [True: 0, False: 0]
  ------------------
 1638|  19.0k|    iIo.seek(0L, BasicIo::beg);
 1639|  19.0k|  }
 1640|       |
 1641|  19.0k|  return matched;
 1642|  19.3k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|  1.65M|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|  1.65M|  const char ignoreList[13][5] = {
  505|  1.65M|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|  1.65M|  };
  507|       |
  508|  1.65M|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 21.5M, False: 1.65M]
  ------------------
  509|  21.5M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 1.59k, False: 21.5M]
  ------------------
  510|  1.59k|      return true;
  511|       |
  512|  1.65M|  return false;
  513|  1.65M|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  1.08M|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  1.08M|  const char ignoreList[8][5] = {
  524|  1.08M|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  1.08M|  };
  526|       |
  527|  1.08M|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 8.65M, False: 538k]
  ------------------
  528|  8.65M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 545k, False: 8.11M]
  ------------------
  529|   545k|      return true;
  530|       |
  531|   538k|  return false;
  532|  1.08M|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  41.3M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  41.3M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  41.3M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  41.3M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  47.0M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  3.48k|static std::string readString(BasicIo& io, size_t size) {
  628|  3.48k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  3.48k|  Exiv2::DataBuf str(size + 1);
  630|  3.48k|  io.readOrThrow(str.data(), size);
  631|  3.48k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  3.48k|  return Exiv2::toString(str.data());
  633|  3.48k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  364|    712|RiffVideo::RiffVideo(BasicIo::UniquePtr io) : Image(ImageType::riff, mdNone, std::move(io)) {
  365|    712|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  367|    772|std::string RiffVideo::mimeType() const {
  368|    772|  return "video/riff";
  369|    772|}
_ZN5Exiv29RiffVideo12readMetadataEv:
  374|    712|void RiffVideo::readMetadata() {
  375|    712|  if (io_->open() != 0)
  ------------------
  |  Branch (375:7): [True: 0, False: 712]
  ------------------
  376|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  377|       |
  378|       |  // Ensure that this is the correct image type
  379|    712|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (379:7): [True: 0, False: 712]
  ------------------
  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|    712|  IoCloser closer(*io_);
  386|    712|  clearMetadata();
  387|       |
  388|    712|  xmpData_["Xmp.video.FileSize"] = io_->size();
  389|    712|  xmpData_["Xmp.video.MimeType"] = mimeType();
  390|       |
  391|    712|  HeaderReader header(io_);
  392|    712|  xmpData_["Xmp.video.Container"] = header.getId();
  393|       |
  394|    712|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  395|       |
  396|    712|  decodeBlocks();
  397|    712|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  399|  8.32k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  400|  8.32k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  401|  8.32k|  id_ = readStringTag(io);
  402|  8.32k|  size_ = readDWORDTag(io);
  403|  8.32k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  405|  51.8k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  406|  51.8k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (406:7): [True: 21.9k, False: 29.9k]
  ------------------
  407|  21.9k|    return false;
  408|       |
  409|  29.9k|  return Internal::upper(str1) == str2;
  410|  51.8k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  412|    845|void RiffVideo::readList(const HeaderReader& header_) {
  413|    845|  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|    845|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (420:7): [True: 310, False: 535]
  ------------------
  421|    310|    readInfoListChunk(header_.getSize());
  422|    535|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (422:12): [True: 137, False: 398]
  ------------------
  423|    137|    readMoviList(header_.getSize());
  424|    137|  }
  425|    845|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  427|  6.61k|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|  6.61k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (434:7): [True: 628, False: 5.98k]
  ------------------
  435|    628|    readAviHeader();
  436|  5.98k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (436:12): [True: 675, False: 5.31k]
  ------------------
  437|    675|    readStreamHeader();
  438|  5.31k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (438:12): [True: 677, False: 4.63k]
  ------------------
  439|    677|    readStreamFormat(header_.getSize());
  440|  4.63k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (440:12): [True: 649, False: 3.98k]
  ------------------
  441|    649|    streamType_ = Audio;
  442|    649|    readStreamFormat(header_.getSize());
  443|  3.98k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (443:14): [True: 415, False: 3.57k]
  ------------------
  444|    415|    readStreamData(header_.getSize());
  445|  3.57k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (445:12): [True: 198, False: 3.37k]
  ------------------
  446|    198|    StreamName(header_.getSize());
  447|  3.37k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (447:12): [True: 212, False: 3.16k]
  ------------------
  448|    212|    readVPRPChunk(header_.getSize());
  449|  3.16k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (449:12): [True: 234, False: 2.92k]
  ------------------
  450|    234|    readIndexChunk(header_.getSize());
  451|  2.92k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (451:12): [True: 179, False: 2.75k]
  ------------------
  452|    179|    readDataChunk(header_.getSize());
  453|  2.75k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (453:12): [True: 69, False: 2.68k]
  ------------------
  454|     69|    readJunk(header_.getSize());
  455|  2.68k|  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|  2.68k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  462|  2.68k|  }
  463|  6.61k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  465|    712|void RiffVideo::decodeBlocks() {
  466|  7.61k|  do {
  467|  7.61k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (467:35): [True: 845, False: 6.76k]
  ------------------
  468|    845|      readList(header);
  469|  6.76k|    } else {
  470|  6.76k|      readChunk(header);
  471|  6.76k|    }
  472|  7.61k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (472:12): [True: 6.92k, False: 683]
  |  Branch (472:27): [True: 6.89k, False: 29]
  ------------------
  473|    712|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  475|    628|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|    628|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  496|    628|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  497|    628|  double frame_rate = 1000000. / TimeBetweenFrames;
  498|       |
  499|    628|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  500|       |
  501|    628|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  502|    628|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  503|       |
  504|    628|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  505|    628|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  506|       |
  507|    628|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  508|    628|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  509|       |
  510|    628|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  511|       |
  512|    628|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  513|       |
  514|    628|  uint32_t width = readDWORDTag(io_);
  515|    628|  xmpData_["Xmp.video.Width"] = width;
  516|       |
  517|    628|  uint32_t height = readDWORDTag(io_);
  518|    628|  xmpData_["Xmp.video.Height"] = height;
  519|       |
  520|    628|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  521|    628|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  522|       |
  523|    628|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  524|       |
  525|    628|  fillDuration(frame_rate, frame_count);
  526|    628|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  528|    675|void RiffVideo::readStreamHeader() {
  529|    675|  std::string stream = readStringTag(io_);
  530|    675|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (530:17): [True: 159, False: 516]
  ------------------
  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|    675|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  555|       |
  556|    675|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  557|    675|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  558|       |
  559|    675|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  560|       |
  561|    675|  if (divisor) {
  ------------------
  |  Branch (561:7): [True: 536, False: 139]
  ------------------
  562|    536|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  563|    536|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (563:14): [True: 103, False: 433]
  ------------------
  564|    536|  }
  565|    675|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  566|       |
  567|    675|  if (divisor) {
  ------------------
  |  Branch (567:7): [True: 526, False: 149]
  ------------------
  568|    526|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  569|    526|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (569:14): [True: 103, False: 423]
  ------------------
  570|    526|  }
  571|       |
  572|    675|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  573|       |
  574|    675|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (574:12): [True: 148, False: 527]
  ------------------
  575|       |
  576|    675|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (576:12): [True: 143, False: 532]
  ------------------
  577|    675|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  578|    675|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  580|  1.32k|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.32k|  if (streamType_ == Video) {
  ------------------
  |  Branch (611:7): [True: 631, False: 695]
  ------------------
  612|    631|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  613|    631|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  614|    631|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  615|    631|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  616|    631|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  617|    631|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  618|    631|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  619|    631|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  620|    631|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (620:18): [True: 440, False: 191]
  ------------------
  621|    440|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  622|    191|    else
  623|    191|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  624|    631|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (624:18): [True: 242, False: 389]
  ------------------
  625|    242|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  626|    389|    else
  627|    389|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  628|    695|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (628:14): [True: 653, False: 42]
  ------------------
  629|    653|    uint16_t format_tag = readWORDTag(io_);
  630|    653|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (630:67): [True: 273, False: 380]
  ------------------
  631|    273|      xmpData_["Xmp.audio.Compressor"] = it->second;
  632|    380|    else
  633|    380|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  634|       |
  635|    653|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  636|    653|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  637|    653|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  638|    653|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  639|    653|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  640|    653|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (640:9): [True: 40, False: 613]
  ------------------
  641|     40|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  642|    653|  } else {
  643|     42|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  644|     42|  }
  645|  1.32k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  647|    415|void RiffVideo::readStreamData(uint64_t size_) const {
  648|    415|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  649|    415|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  651|    198|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|    198|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  654|    198|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  656|    310|void RiffVideo::readInfoListChunk(uint64_t size_) {
  657|    310|  uint64_t current_size = DWORD;
  658|  2.79k|  while (current_size < size_) {
  ------------------
  |  Branch (658:10): [True: 2.48k, False: 310]
  ------------------
  659|  2.48k|    std::string type = readStringTag(io_);
  660|  2.48k|    size_t size = readDWORDTag(io_);
  661|  2.48k|    std::string content = readStringTag(io_, size);
  662|  2.48k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end())
  ------------------
  |  Branch (662:50): [True: 309, False: 2.18k]
  ------------------
  663|    309|      xmpData_[it->second] = content;
  664|  2.48k|    current_size += DWORD * 2;
  665|  2.48k|    current_size += size;
  666|  2.48k|  }
  667|    310|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  669|    137|void RiffVideo::readMoviList(uint64_t size_) const {
  670|    137|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  671|    137|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  673|    212|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|    212|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  697|    212|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  699|    234|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|    234|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  717|    234|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  719|    179|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|    179|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  731|    179|  if (size_ % 2 != 0)
  ------------------
  |  Branch (731:7): [True: 138, False: 41]
  ------------------
  732|    138|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  733|    179|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  735|     69|void RiffVideo::readJunk(uint64_t size_) const {
  736|     69|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  737|     69|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  739|  1.26k|std::string RiffVideo::getStreamType(uint32_t stream) {
  740|  1.26k|  if (stream == 1)
  ------------------
  |  Branch (740:7): [True: 91, False: 1.17k]
  ------------------
  741|     91|    return "Mono";
  742|  1.17k|  if (stream == 2)
  ------------------
  |  Branch (742:7): [True: 121, False: 1.05k]
  ------------------
  743|    121|    return "Stereo";
  744|  1.05k|  if (stream == 5)
  ------------------
  |  Branch (744:7): [True: 86, False: 966]
  ------------------
  745|     86|    return "5.1 Surround Sound";
  746|    966|  if (stream == 7)
  ------------------
  |  Branch (746:7): [True: 242, False: 724]
  ------------------
  747|    242|    return "7.1 Surround Sound";
  748|    724|  return "Mono";
  749|    966|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  751|    592|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  752|    592|  if (frame_rate == 0)
  ------------------
  |  Branch (752:7): [True: 0, False: 592]
  ------------------
  753|      0|    return;
  754|       |
  755|    592|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  756|    592|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  757|    592|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  758|    592|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  760|    712|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, bool /*create*/) {
  761|    712|  auto image = std::make_unique<RiffVideo>(std::move(io));
  762|    712|  if (!image->good()) {
  ------------------
  |  Branch (762:7): [True: 0, False: 712]
  ------------------
  763|      0|    return nullptr;
  764|      0|  }
  765|    712|  return image;
  766|    712|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  768|  8.80k|bool isRiffType(BasicIo& iIo, bool advance) {
  769|  8.80k|  constexpr int len = 4;
  770|  8.80k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  771|  8.80k|  std::array<byte, len> buf;
  772|  8.80k|  iIo.read(buf.data(), len);
  773|  8.80k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (773:7): [True: 0, False: 8.80k]
  |  Branch (773:22): [True: 306, False: 8.49k]
  ------------------
  774|    306|    return false;
  775|    306|  }
  776|  8.49k|  bool matched = buf == RiffVideoId;
  777|  8.49k|  if (!advance || !matched) {
  ------------------
  |  Branch (777:7): [True: 8.49k, False: 0]
  |  Branch (777:19): [True: 0, False: 0]
  ------------------
  778|  8.49k|    iIo.seek(-1 * len, BasicIo::cur);
  779|  8.49k|  }
  780|  8.49k|  return matched;
  781|  8.80k|}

_ZN5Exiv28Rw2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   29|    110|Rw2Image::Rw2Image(BasicIo::UniquePtr io) : Image(ImageType::rw2, mdExif | mdIptc | mdXmp, std::move(io)) {
   30|    110|}  // Rw2Image::Rw2Image
_ZNK5Exiv28Rw2Image8mimeTypeEv:
   32|    365|std::string Rw2Image::mimeType() const {
   33|    365|  return "image/x-panasonic-rw2";
   34|    365|}
_ZNK5Exiv28Rw2Image10pixelWidthEv:
   36|     74|uint32_t Rw2Image::pixelWidth() const {
   37|     74|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.PanasonicRaw.SensorWidth"));
   38|     74|  if (imageWidth == exifData_.end() || imageWidth->count() == 0)
  ------------------
  |  Branch (38:7): [True: 45, False: 29]
  |  Branch (38:7): [True: 64, False: 10]
  |  Branch (38:40): [True: 19, False: 10]
  ------------------
   39|     64|    return 0;
   40|     10|  return imageWidth->toUint32();
   41|     74|}
_ZNK5Exiv28Rw2Image11pixelHeightEv:
   43|     74|uint32_t Rw2Image::pixelHeight() const {
   44|     74|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.PanasonicRaw.SensorHeight"));
   45|     74|  if (imageHeight == exifData_.end() || imageHeight->count() == 0)
  ------------------
  |  Branch (45:7): [True: 58, False: 16]
  |  Branch (45:7): [True: 64, False: 10]
  |  Branch (45:41): [True: 6, False: 10]
  ------------------
   46|     64|    return 0;
   47|     10|  return imageHeight->toUint32();
   48|     74|}
_ZN5Exiv28Rw2Image12readMetadataEv:
   81|    110|void Rw2Image::readMetadata() {
   82|       |#ifdef EXIV2_DEBUG_MESSAGES
   83|       |  std::cerr << "Reading RW2 file " << io_->path() << "\n";
   84|       |#endif
   85|    110|  if (io_->open() != 0) {
  ------------------
  |  Branch (85:7): [True: 0, False: 110]
  ------------------
   86|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   87|      0|  }
   88|    110|  IoCloser closer(*io_);
   89|       |  // Ensure that this is the correct image type
   90|    110|  if (!isRw2Type(*io_, false)) {
  ------------------
  |  Branch (90:7): [True: 0, False: 110]
  ------------------
   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|    110|  clearMetadata();
   96|    110|  ByteOrder bo = Rw2Parser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
   97|    110|  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|    110|  PreviewManager loader(*this);
  102|    110|  PreviewPropertiesList list = loader.getPreviewProperties();
  103|       |  // Todo: What if there are more preview images?
  104|    110|  if (list.size() > 1) {
  ------------------
  |  Branch (104:7): [True: 0, False: 110]
  ------------------
  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|    110|  if (list.size() != 1)
  ------------------
  |  Branch (109:7): [True: 97, False: 13]
  ------------------
  110|     97|    return;
  111|     13|  ExifData exifData;
  112|     13|  PreviewImage preview = loader.getPreviewImage(*list.begin());
  113|     13|  auto image = ImageFactory::open(preview.pData(), preview.size());
  114|     13|  if (!image) {
  ------------------
  |  Branch (114:7): [True: 0, False: 13]
  ------------------
  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|     13|  image->readMetadata();
  121|     13|  ExifData& prevData = image->exifData();
  122|     13|  if (!prevData.empty()) {
  ------------------
  |  Branch (122:7): [True: 0, False: 13]
  ------------------
  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|     13|  static constexpr auto filteredTags = std::array{
  139|     13|      "Exif.Photo.ComponentsConfiguration",
  140|     13|      "Exif.Photo.CompressedBitsPerPixel",
  141|     13|      "Exif.Panasonic.ColorEffect",
  142|     13|      "Exif.Panasonic.Contrast",
  143|     13|      "Exif.Panasonic.NoiseReduction",
  144|     13|      "Exif.Panasonic.ColorMode",
  145|     13|      "Exif.Panasonic.OpticalZoomMode",
  146|     13|      "Exif.Panasonic.Contrast",
  147|     13|      "Exif.Panasonic.Saturation",
  148|     13|      "Exif.Panasonic.Sharpness",
  149|     13|      "Exif.Panasonic.FilmMode",
  150|     13|      "Exif.Panasonic.SceneMode",
  151|     13|      "Exif.Panasonic.WBRedLevel",
  152|     13|      "Exif.Panasonic.WBGreenLevel",
  153|     13|      "Exif.Panasonic.WBBlueLevel",
  154|     13|      "Exif.Photo.ColorSpace",
  155|     13|      "Exif.Photo.PixelXDimension",
  156|     13|      "Exif.Photo.PixelYDimension",
  157|     13|      "Exif.Photo.SceneType",
  158|     13|      "Exif.Photo.CustomRendered",
  159|     13|      "Exif.Photo.DigitalZoomRatio",
  160|     13|      "Exif.Photo.SceneCaptureType",
  161|     13|      "Exif.Photo.GainControl",
  162|     13|      "Exif.Photo.Contrast",
  163|     13|      "Exif.Photo.Saturation",
  164|     13|      "Exif.Photo.Sharpness",
  165|     13|      "Exif.Image.PrintImageMatching",
  166|     13|      "Exif.Image.YCbCrPositioning",
  167|     13|  };
  168|     56|  for (auto&& filteredTag : filteredTags) {
  ------------------
  |  Branch (168:27): [True: 56, False: 13]
  ------------------
  169|     56|    auto pos = prevData.findKey(ExifKey(filteredTag));
  170|     56|    if (pos != prevData.end()) {
  ------------------
  |  Branch (170:9): [True: 0, False: 56]
  ------------------
  171|       |#ifdef EXIV2_DEBUG_MESSAGES
  172|       |      std::cerr << "Exif tag " << pos->key() << " removed\n";
  173|       |#endif
  174|      0|      prevData.erase(pos);
  175|      0|    }
  176|     56|  }
  177|       |
  178|       |  // Add the remaining tags
  179|     13|  for (const auto& pos : prevData) {
  ------------------
  |  Branch (179:24): [True: 0, False: 13]
  ------------------
  180|      0|    exifData_.add(pos);
  181|      0|  }
  182|       |
  183|     13|}  // Rw2Image::readMetadata
_ZN5Exiv29Rw2Parser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  190|    110|ByteOrder Rw2Parser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  191|    110|  Rw2Header rw2Header;
  192|    110|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::pana, TiffMapping::findDecoder,
  193|    110|                                  &rw2Header);
  194|    110|}
_ZN5Exiv214newRw2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  198|    110|Image::UniquePtr newRw2Instance(BasicIo::UniquePtr io, bool /*create*/) {
  199|    110|  auto image = std::make_unique<Rw2Image>(std::move(io));
  200|    110|  if (!image->good()) {
  ------------------
  |  Branch (200:7): [True: 0, False: 110]
  ------------------
  201|      0|    return nullptr;
  202|      0|  }
  203|    110|  return image;
  204|    110|}
_ZN5Exiv29isRw2TypeERNS_7BasicIoEb:
  206|  20.8k|bool isRw2Type(BasicIo& iIo, bool advance) {
  207|  20.8k|  const int32_t len = 24;
  208|  20.8k|  byte buf[len];
  209|  20.8k|  iIo.read(buf, len);
  210|  20.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (210:7): [True: 0, False: 20.8k]
  |  Branch (210:22): [True: 215, False: 20.6k]
  ------------------
  211|    215|    return false;
  212|    215|  }
  213|  20.6k|  Rw2Header header;
  214|  20.6k|  bool rc = header.read(buf, len);
  215|  20.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (215:7): [True: 20.6k, False: 0]
  |  Branch (215:19): [True: 0, False: 0]
  ------------------
  216|  20.6k|    iIo.seek(-len, BasicIo::cur);
  217|  20.6k|  }
  218|  20.6k|  return rc;
  219|  20.8k|}

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

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

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

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

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

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

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.63M|const TagInfo* ifdTagList() {
 1779|  1.63M|  return ifdTagInfo;
 1780|  1.63M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|  11.0k|const TagInfo* exifTagList() {
 2217|  11.0k|  return exifTagInfo;
 2218|  11.0k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|  1.93k|const TagInfo* gpsTagList() {
 2433|  1.93k|  return gpsTagInfo;
 2434|  1.93k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|    246|const TagInfo* iopTagList() {
 2508|    246|  return iopTagInfo;
 2509|    246|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  9.62k|const TagInfo* mnTagList() {
 2524|  9.62k|  return mnTagInfo;
 2525|  9.62k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|   578k|bool isMakerIfd(IfdId ifdId) {
 2528|   578k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 578k, False: 0]
  ------------------
 2529|   578k|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|   578k|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  1.66M|bool isExifIfd(IfdId ifdId) {
 2534|  1.66M|  switch (ifdId) {
 2535|   407k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 407k, False: 1.25M]
  ------------------
 2536|   414k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 7.25k, False: 1.65M]
  ------------------
 2537|   415k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 1.49k, False: 1.66M]
  ------------------
 2538|   416k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 246, False: 1.66M]
  ------------------
 2539|   499k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 83.3k, False: 1.58M]
  ------------------
 2540|   530k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 31.0k, False: 1.63M]
  ------------------
 2541|   531k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 885, False: 1.66M]
  ------------------
 2542|   531k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 1.66M]
  ------------------
 2543|   686k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 154k, False: 1.51M]
  ------------------
 2544|   746k|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 60.1k, False: 1.60M]
  ------------------
 2545|   858k|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 112k, False: 1.55M]
  ------------------
 2546|   982k|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 123k, False: 1.54M]
  ------------------
 2547|   996k|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 14.4k, False: 1.65M]
  ------------------
 2548|  1.00M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 12.8k, False: 1.65M]
  ------------------
 2549|  1.02M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 11.5k, False: 1.65M]
  ------------------
 2550|  1.03M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 9.48k, False: 1.65M]
  ------------------
 2551|  1.04M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 10.4k, False: 1.65M]
  ------------------
 2552|  1.08M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 45.5k, False: 1.62M]
  ------------------
 2553|  1.08M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 662, False: 1.66M]
  ------------------
 2554|  1.08M|      return true;
 2555|   578k|    default:
  ------------------
  |  Branch (2555:5): [True: 578k, False: 1.08M]
  ------------------
 2556|   578k|      return false;
 2557|  1.66M|  }
 2558|  1.66M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  2.35M|const TagInfo* tagList(IfdId ifdId) {
 2569|  2.35M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 2.35M, False: 0]
  ------------------
 2570|  2.35M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 2.35M, False: 0]
  ------------------
 2571|  2.35M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  2.35M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  1.66M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  1.66M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 1.66M, False: 0]
  ------------------
 2577|  1.66M|    int idx = 0;
 2578|  94.8M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 94.2M, False: 586k]
  ------------------
 2579|  94.2M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.07M, False: 93.2M]
  ------------------
 2580|  1.07M|        break;
 2581|  94.2M|    }
 2582|  1.66M|    return ti + idx;
 2583|  1.66M|  }
 2584|      0|  return nullptr;
 2585|  1.66M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   686k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   686k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 686k]
  ------------------
 2589|      0|    return nullptr;
 2590|   686k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 686k, False: 0]
  ------------------
 2591|  22.0M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 22.0M, False: 0]
  ------------------
 2592|  22.0M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 686k, False: 21.3M]
  ------------------
 2593|   686k|        return ti + idx;
 2594|   686k|      }
 2595|  22.0M|    }
 2596|   686k|  }
 2597|      0|  return nullptr;
 2598|   686k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  1.79M|IfdId groupId(const std::string& groupName) {
 2601|  1.79M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 1.79M, False: 0]
  ------------------
 2602|  1.79M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  1.79M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|   849k|const char* groupName(IfdId ifdId) {
 2613|   849k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 849k, False: 0]
  ------------------
 2614|   849k|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|   849k|}
_ZN5Exiv28Internal7fnumberEf:
 2647|     19|float fnumber(float apertureValue) {
 2648|     19|  float result = std::exp2(apertureValue / 2.F);
 2649|     19|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 19]
  ------------------
 2650|      0|    result = 3.5F;
 2651|      0|  }
 2652|     19|  return result;
 2653|     19|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|     19|URational exposureTime(float shutterSpeedValue) {
 2656|     19|  URational ur(1, 1);
 2657|     19|  const double tmp = std::exp2(shutterSpeedValue);
 2658|     19|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 0, False: 19]
  ------------------
 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|     19|  } else {
 2665|     19|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     19|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 19, False: 0]
  |  Branch (2667:19): [True: 19, False: 0]
  ------------------
 2668|     19|      ur.first = static_cast<uint32_t>(x);
 2669|     19|    }
 2670|     19|  }
 2671|     19|  return ur;
 2672|     19|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   686k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   686k|  auto ti = tagInfo(tagName, ifdId);
 2676|   686k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 686k, False: 0]
  |  Branch (2676:13): [True: 686k, False: 0]
  ------------------
 2677|   686k|    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|  8.50k|const TagInfo* tagList(const std::string& groupName) {
 3295|  8.50k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  8.50k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 8.50k]
  |  Branch (3296:14): [True: 0, False: 8.50k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  8.50k|  return ii->tagList_();
 3300|  8.50k|}

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

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

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

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|   262k|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|   262k|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|   393k|  [[nodiscard]] uint32_t extendedTag() const {
   86|   393k|    return extendedTag_;
   87|   393k|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|   131k|  [[nodiscard]] IfdId group() const {
   90|   131k|    return group_;
   91|   131k|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  1.34M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  1.34M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  1.20M|  void setStart(const byte* pStart) {
  217|  1.20M|    pStart_ = const_cast<byte*>(pStart);
  218|  1.20M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|  24.0M|  [[nodiscard]] uint16_t tag() const {
  241|  24.0M|    return tag_;
  242|  24.0M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  5.37M|  [[nodiscard]] IfdId group() const {
  245|  5.37M|    return group_;
  246|  5.37M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  1.24M|  [[nodiscard]] byte* start() const {
  249|  1.24M|    return pStart_;
  250|  1.24M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|   839k|  void setOffset(size_t offset) {
  417|   839k|    offset_ = offset;
  418|   839k|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|   196k|  [[nodiscard]] TiffType tiffType() const {
  459|   196k|    return tiffType_;
  460|   196k|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  7.91k|  [[nodiscard]] size_t offset() const {
  466|  7.91k|    return offset_;
  467|  7.91k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|   735k|  [[nodiscard]] const byte* pData() const {
  477|   735k|    return pData_;
  478|   735k|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  2.80M|  [[nodiscard]] const Value* pValue() const {
  481|  2.80M|    return pValue_.get();
  482|  2.80M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|   831k|  void setIdx(int idx) {
  502|   831k|    idx_ = idx;
  503|   831k|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|   346k|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|   346k|    return storage_;
  542|   346k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  45.3k|  [[nodiscard]] uint16_t szTag() const {
  624|  45.3k|    return szTag_;
  625|  45.3k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  45.3k|  [[nodiscard]] IfdId szGroup() const {
  628|  45.3k|    return szGroup_;
  629|  45.3k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  51.4k|  [[nodiscard]] uint16_t dtTag() const {
  790|  51.4k|    return dtTag_;
  791|  51.4k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  51.4k|  [[nodiscard]] IfdId dtGroup() const {
  794|  51.4k|    return dtGroup_;
  795|  51.4k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  14.1k|  [[nodiscard]] bool hasNext() const {
  843|  14.1k|    return hasNext_;
  844|  14.1k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  2.74k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  2.74k|    imageByteOrder_ = byteOrder;
 1108|  2.74k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|   626k|  bool operator==(size_t idx) const {
 1218|   626k|    return idx_ == idx;
 1219|   626k|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|   347k|  [[nodiscard]] size_t tagStep() const {
 1235|   347k|    return elDefaultDef_.size(0, group_);
 1236|   347k|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|   349k|  void setDecoded(bool decoded) {
 1311|   349k|    decoded_ = decoded;
 1312|   349k|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  1.39M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  1.39M|    return arrayCfg_;
 1320|  1.39M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|    874|  [[nodiscard]] const ArrayDef* def() const {
 1323|    874|    return arrayDef_;
 1324|    874|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|    874|  [[nodiscard]] size_t defSize() const {
 1327|    874|    return defSize_;
 1328|    874|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|  4.31k|  [[nodiscard]] bool decoded() const {
 1331|  4.31k|    return decoded_;
 1332|  4.31k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|   346k|  void setElDef(const ArrayDef& def) {
 1405|   346k|    elDef_ = def;
 1406|   346k|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|   346k|  void setElByteOrder(ByteOrder byteOrder) {
 1411|   346k|    elByteOrder_ = byteOrder;
 1412|   346k|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|   351k|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|   351k|    return &elDef_;
 1422|   351k|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|   351k|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|   351k|    return elByteOrder_;
 1428|   351k|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  13.3k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  13.3k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  13.3k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     20|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     20|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     20|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     85|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     85|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     85|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    503|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    503|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    503|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    117|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    117|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    117|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    165|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    165|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    165|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    302|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    302|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    302|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  10.2k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  10.2k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  10.2k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.61k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.61k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.61k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.49k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.49k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.49k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    899|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    899|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    899|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.6k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.6k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.6k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  22.2k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  22.2k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  22.2k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.87k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.87k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.87k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.03k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.03k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.72k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.72k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.72k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.88k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.88k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.88k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.18k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.18k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.18k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    531|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    531|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    531|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  5.57k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  5.57k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  5.57k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.55k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.55k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.55k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    624|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    624|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    624|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    354|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    354|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    354|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    412|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    412|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    412|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     99|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     99|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     99|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    739|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    739|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    739|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    478|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    478|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    478|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.30k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.30k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.30k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.73k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.73k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.73k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    531|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    531|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    531|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    410|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    410|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    410|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.59k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.59k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.59k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.82k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.82k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.82k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.68k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.68k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.68k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.87k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.87k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.87k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    963|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    963|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    963|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    472|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    472|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    472|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.39k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.39k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.39k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.63k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.63k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.63k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    527|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    527|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    527|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    346|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    346|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    346|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    382|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    382|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    382|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    244|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    244|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    244|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    355|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    355|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    355|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    697|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    697|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    697|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    292|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    292|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    292|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__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_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    442|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    442|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    442|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    293|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    293|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    293|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    333|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    333|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    333|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    929|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    929|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    929|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    397|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    397|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    397|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     57|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     57|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     57|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    209|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    209|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    209|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    215|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    215|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    215|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    272|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    272|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    272|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    762|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    762|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    762|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    320|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    320|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    320|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     74|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     74|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     74|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    235|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    235|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    235|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    127|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    127|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    127|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    321|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    321|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    321|}
_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|     93|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     93|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     93|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    141|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    141|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    141|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    161|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    161|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    161|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    110|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    110|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    110|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    612|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    612|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    612|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     58|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     58|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     58|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  3.16k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  3.16k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  3.16k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.75k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.75k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.75k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    335|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    335|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    335|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    332|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    332|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    332|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    362|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    362|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    362|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  2.06k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  2.06k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  2.06k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  6.10k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  6.10k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  6.10k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    276|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    276|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    276|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    140|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    140|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    140|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     87|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     87|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     87|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    194|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    194|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    194|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    105|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    105|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    105|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    109|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    109|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    109|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     70|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     70|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     70|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    204|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    204|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    204|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    223|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    223|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    223|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_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|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     47|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     47|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     47|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     78|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     78|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     78|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     75|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     75|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     75|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    106|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    106|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    106|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    327|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    327|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    327|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    339|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    339|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    339|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    528|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    528|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    528|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     51|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     51|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     51|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    313|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    313|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    313|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__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_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     39|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     39|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     39|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     98|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     98|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     98|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    112|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    112|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    112|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     78|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     78|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     78|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    106|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    106|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    106|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    291|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    291|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    291|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     74|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     74|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     74|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    100|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    100|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    100|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     79|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     79|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     79|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    157|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    157|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    157|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    117|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    117|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    117|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     84|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     84|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     84|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    318|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    318|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    318|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     29|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     29|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     29|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    531|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    531|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    531|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    531|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    207|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    207|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    207|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    328|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    328|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    328|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     28|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     28|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     28|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     72|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     72|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     72|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    108|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    108|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    108|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    126|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    126|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    126|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    126|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    150|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    150|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    150|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    122|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    122|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    122|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     88|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     88|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     86|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     86|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     86|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     86|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     86|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     86|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     86|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     98|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     98|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     98|}
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|     94|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     94|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     94|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    155|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    155|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    155|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     44|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     44|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     44|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     50|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     50|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     50|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    114|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    114|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    114|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     27|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     27|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     27|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     27|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__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_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     34|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     34|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     34|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     34|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     72|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     72|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     72|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     72|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    126|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    126|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    126|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    126|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    161|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    161|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    161|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    161|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     31|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     31|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     31|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     31|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     38|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     38|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     38|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     38|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     30|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     30|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     30|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     30|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     24|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     24|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     24|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     24|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     22|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     22|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     22|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     22|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     39|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     39|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     39|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    119|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    119|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    119|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     84|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     84|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     84|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    100|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    100|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    100|}
_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|     72|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     72|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     72|}
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|     66|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     66|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     66|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     34|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     34|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     34|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     34|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    119|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    119|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    119|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    119|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    136|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    136|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    136|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    136|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    319|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    319|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    319|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    319|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__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_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     59|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     59|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     59|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     59|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     48|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     48|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     48|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     48|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     37|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     37|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     37|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     76|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     76|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     76|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     76|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    108|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    108|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    108|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    108|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     42|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     42|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     42|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     34|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     34|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     34|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     24|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     24|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     24|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     24|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     99|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     99|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     99|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  1.34M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  43.6k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  8.85k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  5.25k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|   131k|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|   131k|  return ifdId_ == md.ifdId();
   31|   131k|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|   829k|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|   829k|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|   829k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 8.61k, False: 821k]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  8.61k|    decoderFct = td->decoderFct_;
 1996|  8.61k|  }
 1997|   829k|  return decoderFct;
 1998|   829k|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|   131k|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|   131k|  EncoderFct encoderFct = nullptr;
 2002|   131k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 131k]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|      0|    encoderFct = td->encoderFct_;
 2005|      0|  }
 2006|   131k|  return encoderFct;
 2007|   131k|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  1.32M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  1.32M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  1.32M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  1.32M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 1.14M, False: 184k]
  ------------------
 2014|  1.14M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  1.14M|  }
 2016|  1.32M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 1.32M, False: 210]
  |  Branch (2016:7): [True: 1.31M, False: 8.13k]
  |  Branch (2016:37): [True: 1.31M, False: 7.92k]
  ------------------
 2017|  1.31M|    return i->second(tag, group);
 2018|  1.31M|  }
 2019|       |#ifdef EXIV2_DEBUG_MESSAGES
 2020|       |  if (i == tiffGroupTable_.end())
 2021|       |    std::cerr << "Warning: No TIFF structure entry found for ";
 2022|       |  else
 2023|       |    std::cerr << "Warning: No TIFF component creator found for ";
 2024|       |  std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0') << std::hex << std::right << extendedTag
 2025|       |            << ", group " << groupName(group) << "\n";
 2026|       |#endif
 2027|  8.13k|  return nullptr;
 2028|  1.32M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|   131k|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|   131k|  TiffPath ret;
 2032|   262k|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 262k, Folded]
  ------------------
 2033|   262k|    ret.emplace(extendedTag, group);
 2034|   262k|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|   262k|    assert(ts != tiffTreeTable_.end());
 2036|   262k|    extendedTag = ts->second.second;
 2037|   262k|    group = ts->second.first;
 2038|   262k|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 131k, False: 131k]
  ------------------
 2039|   131k|      break;
 2040|   131k|    }
 2041|   262k|  }
 2042|   131k|  return ret;
 2043|   131k|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  10.6k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  10.6k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  10.6k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 10.4k, False: 239]
  ------------------
 2050|  10.4k|    ph = std::make_unique<TiffHeader>();
 2051|  10.4k|    pHeader = ph.get();
 2052|  10.4k|  }
 2053|       |
 2054|  10.6k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 10.0k, False: 545]
  ------------------
 2055|  10.0k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  10.0k|    rootDir->accept(decoder);
 2057|  10.0k|  }
 2058|  10.6k|  return pHeader->byteOrder();
 2059|       |
 2060|  10.6k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  4.00k|                                     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.00k|  WriteMethod writeMethod = wmIntrusive;
 2074|  4.00k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  4.00k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  4.00k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 0, False: 4.00k]
  ------------------
 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.00k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 4.00k, False: 0]
  ------------------
 2084|  4.00k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  4.00k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 0, False: 4.00k]
  ------------------
 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.00k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  4.00k|                        findEncoderFct);
 2093|  4.00k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  4.00k|    DataBuf header = pHeader->write();
 2096|  4.00k|    auto tempIo = MemIo();
 2097|  4.00k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  4.00k|    auto imageIdx(std::string::npos);
 2099|  4.00k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  4.00k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 0, False: 4.00k]
  ------------------
 2101|      0|      pOffsetWriter->writeOffsets(tempIo);
 2102|  4.00k|    io.transfer(tempIo);  // may throw
 2103|  4.00k|#ifndef SUPPRESS_WARNINGS
 2104|  4.00k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  4.00k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 4.00k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  4.00k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  4.00k|#endif
 2106|  4.00k|  }
 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.00k|#endif
 2112|  4.00k|  return writeMethod;
 2113|  4.00k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  14.6k|                                                 TiffHeaderBase* pHeader) {
 2117|  14.6k|  TiffComponent::UniquePtr rootDir;
 2118|  14.6k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 4.32k, False: 10.3k]
  |  Branch (2118:17): [True: 0, False: 10.3k]
  ------------------
 2119|  4.32k|    return rootDir;
 2120|  10.3k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 130, False: 10.1k]
  |  Branch (2120:38): [True: 100, False: 10.0k]
  ------------------
 2121|    230|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    230|  }
 2123|  10.0k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  10.0k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 10.0k, False: 0]
  ------------------
 2125|  10.0k|    rootDir->setStart(pData + pHeader->offset());
 2126|  10.0k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  10.0k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  10.0k|    rootDir->accept(reader);
 2129|  10.0k|    reader.postProcess();
 2130|  10.0k|  }
 2131|  10.0k|  return rootDir;
 2132|       |
 2133|  10.3k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  4.00k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  4.00k|  PrimaryGroups ret;
 2137|  4.00k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 4.00k, False: 0]
  ------------------
 2138|  4.00k|    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.00k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   255k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   255k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   200k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   200k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 200k]
  |  Branch (2165:17): [True: 29, False: 200k]
  ------------------
 2166|     29|    return false;
 2167|       |
 2168|   200k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 13.8k, False: 186k]
  |  Branch (2168:26): [True: 13.6k, False: 201]
  ------------------
 2169|  13.6k|    byteOrder_ = littleEndian;
 2170|   186k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 24.3k, False: 162k]
  |  Branch (2170:33): [True: 24.1k, False: 263]
  ------------------
 2171|  24.1k|    byteOrder_ = bigEndian;
 2172|   162k|  } else {
 2173|   162k|    return false;
 2174|   162k|  }
 2175|  37.7k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|  37.7k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 37.7k, False: 37]
  |  Branch (2176:19): [True: 37.6k, False: 64]
  |  Branch (2176:33): [True: 1.73k, False: 35.9k]
  ------------------
 2177|  1.73k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  36.0k|  tag_ = t;
 2179|  36.0k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  36.0k|  return true;
 2182|  37.7k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  4.00k|DataBuf TiffHeaderBase::write() const {
 2185|  4.00k|  DataBuf buf(8);
 2186|  4.00k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 4.00k, False: 0]
  ------------------
 2187|  4.00k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 4.00k, False: 0]
  ------------------
 2188|  4.00k|      buf.write_uint8(0, 'I');
 2189|  4.00k|      break;
 2190|      0|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 0, False: 4.00k]
  ------------------
 2191|      0|      buf.write_uint8(0, 'M');
 2192|      0|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 4.00k]
  ------------------
 2194|      0|      break;
 2195|  4.00k|  }
 2196|  4.00k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  4.00k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  4.00k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  4.00k|  return buf;
 2200|  4.00k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|  47.5k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|  47.5k|  return byteOrder_;
 2220|  47.5k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  9.63k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  9.63k|  byteOrder_ = byteOrder;
 2224|  9.63k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  20.6k|uint32_t TiffHeaderBase::offset() const {
 2227|  20.6k|  return offset_;
 2228|  20.6k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  8.79k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  8.79k|  offset_ = offset;
 2232|  8.79k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  10.0k|uint16_t TiffHeaderBase::tag() const {
 2239|  10.0k|  return tag_;
 2240|  10.0k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|   209k|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|   209k|  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|   209k|  return result;
 2335|   209k|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   183k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   183k|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|   209k|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|   209k|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 0, False: 209k]
  ------------------
 2248|      0|    return false;
 2249|      0|  }
 2250|       |  //! List of TIFF image tags
 2251|   209k|  switch (tag) {
 2252|      0|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 0, False: 209k]
  ------------------
 2253|      0|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 0, False: 209k]
  ------------------
 2254|  8.74k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 8.74k, False: 200k]
  ------------------
 2255|  76.5k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 67.8k, False: 141k]
  ------------------
 2256|  82.9k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 6.39k, False: 203k]
  ------------------
 2257|  83.2k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 239, False: 209k]
  ------------------
 2258|  83.7k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 484, False: 209k]
  ------------------
 2259|  83.8k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 147, False: 209k]
  ------------------
 2260|  93.2k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 9.39k, False: 200k]
  ------------------
 2261|  93.2k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 36, False: 209k]
  ------------------
 2262|  93.3k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 79, False: 209k]
  ------------------
 2263|   100k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 6.88k, False: 202k]
  ------------------
 2264|   100k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 259, False: 209k]
  ------------------
 2265|   100k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 103, False: 209k]
  ------------------
 2266|   100k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 310, False: 209k]
  ------------------
 2267|   100k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 85, False: 209k]
  ------------------
 2268|   101k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 124, False: 209k]
  ------------------
 2269|   101k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 154, False: 209k]
  ------------------
 2270|   101k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 70, False: 209k]
  ------------------
 2271|   101k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 165, False: 209k]
  ------------------
 2272|   101k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 132, False: 209k]
  ------------------
 2273|   101k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 110, False: 209k]
  ------------------
 2274|   101k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 72, False: 209k]
  ------------------
 2275|   101k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 65, False: 209k]
  ------------------
 2276|   102k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 378, False: 209k]
  ------------------
 2277|   102k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 70, False: 209k]
  ------------------
 2278|   102k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 132, False: 209k]
  ------------------
 2279|   102k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 93, False: 209k]
  ------------------
 2280|   102k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 109, False: 209k]
  ------------------
 2281|   103k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 790, False: 208k]
  ------------------
 2282|   104k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 713, False: 208k]
  ------------------
 2283|   104k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 80, False: 209k]
  ------------------
 2284|   105k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 1.06k, False: 208k]
  ------------------
 2285|   105k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 250, False: 209k]
  ------------------
 2286|   105k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 84, False: 209k]
  ------------------
 2287|   106k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 406, False: 209k]
  ------------------
 2288|   106k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 135, False: 209k]
  ------------------
 2289|   106k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 86, False: 209k]
  ------------------
 2290|   106k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 81, False: 209k]
  ------------------
 2291|   106k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 70, False: 209k]
  ------------------
 2292|   106k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 79, False: 209k]
  ------------------
 2293|   106k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 104, False: 209k]
  ------------------
 2294|   106k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 257, False: 209k]
  ------------------
 2295|   106k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 118, False: 209k]
  ------------------
 2296|   107k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 308, False: 209k]
  ------------------
 2297|   107k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 421, False: 209k]
  ------------------
 2298|   110k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 2.38k, False: 207k]
  ------------------
 2299|   117k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 7.37k, False: 202k]
  ------------------
 2300|   129k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 12.4k, False: 197k]
  ------------------
 2301|   130k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 116, False: 209k]
  ------------------
 2302|   130k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 92, False: 209k]
  ------------------
 2303|   130k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 264, False: 209k]
  ------------------
 2304|   130k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 123, False: 209k]
  ------------------
 2305|   130k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 133, False: 209k]
  ------------------
 2306|   130k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 51, False: 209k]
  ------------------
 2307|   130k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 207, False: 209k]
  ------------------
 2308|   130k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 61, False: 209k]
  ------------------
 2309|   131k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 216, False: 209k]
  ------------------
 2310|   131k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 51, False: 209k]
  ------------------
 2311|   131k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 26, False: 209k]
  ------------------
 2312|   131k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 62, False: 209k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|   131k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 18, False: 209k]
  ------------------
 2315|   131k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 66, False: 209k]
  ------------------
 2316|   131k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 20, False: 209k]
  ------------------
 2317|   131k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 18, False: 209k]
  ------------------
 2318|   131k|      return true;
 2319|  78.2k|    default:
  ------------------
  |  Branch (2319:5): [True: 78.2k, False: 131k]
  ------------------
 2320|  78.2k|      return false;
 2321|   209k|  }
 2322|   209k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  1.75M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  1.75M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 1.03M, False: 721k]
  ------------------
   88|  1.03M|    return tit->size_;
   89|   721k|  return 0;
   90|  1.75M|}
_ZN5Exiv27DataBufC2Em:
   92|  1.40M|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|  1.40M|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  46.7k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  46.7k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  9.28k|void DataBuf::alloc(size_t size) {
   99|  9.28k|  pData_.resize(size);
  100|  9.28k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   611k|void DataBuf::resize(size_t size) {
  103|   611k|  pData_.resize(size);
  104|   611k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  26.0k|void DataBuf::reset() {
  107|  26.0k|  pData_.clear();
  108|  26.0k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|   806k|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|   806k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 806k]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|   806k|  return pData_[offset];
  115|   806k|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|  2.00M|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|  2.00M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 2.00M]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|  2.00M|  pData_[offset] = x;
  122|  2.00M|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   710k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   710k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 710k]
  |  Branch (125:28): [True: 2, False: 710k]
  ------------------
  126|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      2|  }
  128|   710k|  return getUShort(&pData_[offset], byteOrder);
  129|   710k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  4.00k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  4.00k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 4.00k]
  |  Branch (132:28): [True: 0, False: 4.00k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  4.00k|  us2Data(&pData_[offset], x, byteOrder);
  136|  4.00k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  138|  2.28M|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  139|  2.28M|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 2.28M]
  |  Branch (139:28): [True: 3, False: 2.28M]
  ------------------
  140|      4|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      4|  }
  142|  2.28M|  return getULong(&pData_[offset], byteOrder);
  143|  2.28M|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  4.00k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  4.00k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 4.00k]
  |  Branch (146:28): [True: 0, False: 4.00k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  4.00k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  4.00k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  3.33k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  3.33k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 3.33k]
  |  Branch (153:28): [True: 0, False: 3.33k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  3.33k|  return getULongLong(&pData_[offset], byteOrder);
  157|  3.33k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   234k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   234k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 234k]
  |  Branch (167:34): [True: 0, False: 234k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   234k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   234k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  11.7M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  11.7M|  return const_cast<byte*>(c_data(offset));
  175|  11.7M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  11.9M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  11.9M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 17.4k, False: 11.8M]
  |  Branch (178:25): [True: 775, False: 11.8M]
  ------------------
  179|  18.1k|    return nullptr;
  180|  18.1k|  }
  181|  11.8M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 11.8M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  11.8M|  return &pData_[offset];
  185|  11.8M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  59.5k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  59.5k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  59.5k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|  6.05k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|  6.05k|  return os << r.first << "/" << r.second;
  212|  6.05k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|  4.05k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|  4.05k|  return os << r.first << "/" << r.second;
  241|  4.05k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  3.37M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  3.37M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  3.37M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  6.83M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  6.83M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 2.36M, False: 4.46M]
  ------------------
  253|  2.36M|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|  2.36M|  }
  255|  4.46M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  6.83M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  39.4k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  39.4k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 3.09k, False: 36.3k]
  ------------------
  260|  3.09k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  3.09k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  3.09k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  3.09k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  3.09k|  }
  265|  36.3k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  36.3k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  36.3k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  36.3k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  39.4k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|  1.26M|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|  1.26M|  uint32_t nominator = getULong(buf, byteOrder);
  273|  1.26M|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|  1.26M|  return {nominator, denominator};
  275|  1.26M|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|   478k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|   478k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 465k, False: 13.8k]
  ------------------
  279|   465k|    return buf[1] << 8 | buf[0];
  280|   465k|  }
  281|  13.8k|  return buf[0] << 8 | buf[1];
  282|   478k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|   677k|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|   677k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 292k, False: 385k]
  ------------------
  286|   292k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|   292k|  }
  288|   385k|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|   677k|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|  71.7k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|  71.7k|  int32_t nominator = getLong(buf, byteOrder);
  293|  71.7k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|  71.7k|  return {nominator, denominator};
  295|  71.7k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  22.1k|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|  22.1k|#ifdef __cpp_lib_bit_cast
  302|  22.1k|  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|  22.1k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|  32.3k|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|  32.3k|#ifdef __cpp_lib_bit_cast
  318|  32.3k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 2.33k, False: 29.9k]
  ------------------
  319|  2.33k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  2.33k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  2.33k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  2.33k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|  29.9k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|  29.9k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|  29.9k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|  29.9k|                               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|  32.3k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|   305k|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|   305k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 305k, False: 328]
  ------------------
  350|   305k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|   305k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|   305k|  } else {
  353|    328|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|    328|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|    328|  }
  356|   305k|  return 2;
  357|   305k|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|  2.05M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|  2.05M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 2.05M, False: 741]
  ------------------
  361|  2.05M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|  2.05M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|  2.05M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|  2.05M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|  2.05M|  } else {
  366|    741|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|    741|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|    741|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|    741|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|    741|  }
  371|  2.05M|  return 4;
  372|  2.05M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|   917k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|   917k|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|   917k|  o += ul2Data(buf + o, l.second, byteOrder);
  392|   917k|  return o;
  393|   917k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|  2.73k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|  2.73k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 2.49k, False: 243]
  ------------------
  397|  2.49k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|  2.49k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|  2.49k|  } else {
  400|    243|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|    243|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|    243|  }
  403|  2.73k|  return 2;
  404|  2.73k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|   722k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|   722k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 721k, False: 737]
  ------------------
  408|   721k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|   721k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|   721k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|   721k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|   721k|  } 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|   722k|  return 4;
  419|   722k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|  33.9k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|  33.9k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|  33.9k|  o += l2Data(buf + o, l.second, byteOrder);
  424|  33.9k|  return o;
  425|  33.9k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|  9.24k|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|  9.24k|#ifdef __cpp_lib_bit_cast
  432|  9.24k|  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|  9.24k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|  6.45k|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|  6.45k|  union {
  448|  6.45k|    uint64_t ull_;
  449|  6.45k|    double d_;
  450|  6.45k|  } u;
  451|  6.45k|  u.d_ = d;
  452|  6.45k|  uint64_t m = 0xff;
  453|  6.45k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 6.11k, False: 341]
  ------------------
  454|  6.11k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|  6.11k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|  6.11k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|  6.11k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|  6.11k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|  6.11k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|  6.11k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|  6.11k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|  6.11k|  } else {
  463|    341|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|    341|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|    341|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|    341|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|    341|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|    341|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|    341|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|    341|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|    341|  }
  472|  6.45k|  return 8;
  473|  6.45k|}
_ZN5Exiv219floatToRationalCastEf:
  651|     19|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|     19|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|     19|  int32_t den;
  658|     19|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 19, False: 0]
  ------------------
  659|     19|    den = 1000000;
  660|     19|  } 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|     19|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|     19|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|     19|  return {nom / g, den / g};
  673|     19|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|  22.2M|  bool operator==(Exiv2::TypeId typeId) const {
   35|  22.2M|    return typeId_ == typeId;
   36|  22.2M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  1.50M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  1.50M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|   939k|Value::UniquePtr Value::create(TypeId typeId) {
   23|   939k|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 939k]
  ------------------
   25|  2.71k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 2.71k, False: 936k]
  ------------------
   26|   243k|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 240k, False: 698k]
  ------------------
   27|   243k|      return std::make_unique<DataValue>(typeId);
   28|  12.8k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 12.8k, False: 926k]
  ------------------
   29|  12.8k|      return std::make_unique<AsciiValue>();
   30|  26.4k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 26.4k, False: 913k]
  ------------------
   31|  26.4k|      return std::make_unique<ValueType<uint16_t>>();
   32|  49.8k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 49.8k, False: 889k]
  ------------------
   33|  52.3k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 2.43k, False: 937k]
  ------------------
   34|  52.3k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  6.89k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 6.89k, False: 932k]
  ------------------
   36|  6.89k|      return std::make_unique<ValueType<URational>>();
   37|  6.91k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 6.91k, False: 932k]
  ------------------
   38|  6.91k|      return std::make_unique<DataValue>();
   39|  75.9k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 75.9k, False: 863k]
  ------------------
   40|  75.9k|      return std::make_unique<ValueType<int16_t>>();
   41|  12.2k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 12.2k, False: 927k]
  ------------------
   42|  12.2k|      return std::make_unique<ValueType<int32_t>>();
   43|  2.25k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 2.25k, False: 937k]
  ------------------
   44|  2.25k|      return std::make_unique<ValueType<Rational>>();
   45|  1.97k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 1.97k, False: 937k]
  ------------------
   46|  1.97k|      return std::make_unique<ValueType<float>>();
   47|  4.84k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 4.84k, False: 934k]
  ------------------
   48|  4.84k|      return std::make_unique<ValueType<double>>();
   49|  31.8k|    case string:
  ------------------
  |  Branch (49:5): [True: 31.8k, False: 907k]
  ------------------
   50|  31.8k|      return std::make_unique<StringValue>();
   51|  6.51k|    case date:
  ------------------
  |  Branch (51:5): [True: 6.51k, False: 933k]
  ------------------
   52|  6.51k|      return std::make_unique<DateValue>();
   53|  11.0k|    case time:
  ------------------
  |  Branch (53:5): [True: 11.0k, False: 928k]
  ------------------
   54|  11.0k|      return std::make_unique<TimeValue>();
   55|    223|    case comment:
  ------------------
  |  Branch (55:5): [True: 223, False: 939k]
  ------------------
   56|    223|      return std::make_unique<CommentValue>();
   57|  41.1k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 41.1k, False: 898k]
  ------------------
   58|  41.1k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 939k]
  ------------------
   60|  7.02k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 7.02k, False: 932k]
  ------------------
   61|  7.02k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 939k]
  ------------------
   62|  7.02k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 939k]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|   395k|    default:
  ------------------
  |  Branch (65:5): [True: 395k, False: 544k]
  ------------------
   66|   395k|      return std::make_unique<DataValue>(typeId);
   67|   939k|  }
   68|   939k|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|  2.37k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|  2.37k|  return -1;
   72|  2.37k|}
_ZNK5Exiv25Value8toStringEv:
   74|  17.8k|std::string Value::toString() const {
   75|  17.8k|  std::ostringstream os;
   76|  17.8k|  write(os);
   77|  17.8k|  ok_ = !os.fail();
   78|  17.8k|  return os.str();
   79|  17.8k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  20.5k|size_t Value::sizeDataArea() const {
   86|  20.5k|  return 0;
   87|  20.5k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|     41|DataBuf Value::dataArea() const {
   90|     41|  return {nullptr, 0};
   91|     41|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|   645k|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|   645k|}
_ZNK5Exiv29DataValue5countEv:
  100|   999k|size_t DataValue::count() const {
  101|   999k|  return size();
  102|   999k|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|   645k|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|   645k|  value_.assign(buf, buf + len);
  107|   645k|  return 0;
  108|   645k|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|   110k|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|   110k|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|   110k|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  1.31M|size_t DataValue::size() const {
  128|  1.31M|  return value_.size();
  129|  1.31M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  1.71M|DataValue* DataValue::clone_() const {
  132|  1.71M|  return new DataValue(*this);
  133|  1.71M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.09k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.09k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.75k, False: 341]
  ------------------
  137|  1.75k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.75k|    os << static_cast<int>(value_.back());
  139|  1.75k|  }
  140|  2.09k|  return os;
  141|  2.09k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  41.3k|int64_t DataValue::toInt64(size_t n) const {
  149|  41.3k|  ok_ = true;
  150|  41.3k|  return value_.at(n);
  151|  41.3k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|   188k|uint32_t DataValue::toUint32(size_t n) const {
  154|   188k|  ok_ = true;
  155|   188k|  return value_.at(n);
  156|   188k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  4.18k|int StringValueBase::read(const std::string& buf) {
  173|  4.18k|  value_ = buf;
  174|  4.18k|  return 0;
  175|  4.18k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  39.6k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  39.6k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 39.6k, False: 0]
  ------------------
  180|  39.6k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  39.6k|  return 0;
  182|  39.6k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  2.45k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  2.45k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 1.00k, False: 1.45k]
  ------------------
  186|  1.00k|    return 0;
  187|       |  // byteOrder not needed
  188|  1.45k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  2.45k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|  86.8k|size_t StringValueBase::count() const {
  192|  86.8k|  return size();
  193|  86.8k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|  92.8k|size_t StringValueBase::size() const {
  196|  92.8k|  return value_.size();
  197|  92.8k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  51.7k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  51.7k|  ok_ = true;
  205|  51.7k|  return value_.at(n);
  206|  51.7k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  25.8k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  25.8k|  ok_ = true;
  210|  25.8k|  return value_.at(n);
  211|  25.8k|}
_ZN5Exiv211StringValueC2Ev:
  223|  31.8k|StringValue::StringValue() : StringValueBase(string) {
  224|  31.8k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|  63.4k|StringValue* StringValue::clone_() const {
  230|  63.4k|  return new StringValue(*this);
  231|  63.4k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  12.9k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  12.9k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  2.55k|int AsciiValue::read(const std::string& buf) {
  240|  2.55k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  2.55k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 6, False: 2.54k]
  |  Branch (242:25): [True: 2.54k, False: 0]
  ------------------
  243|  2.55k|    value_ += '\0';
  244|  2.55k|  }
  245|  2.55k|  return 0;
  246|  2.55k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|  31.6k|AsciiValue* AsciiValue::clone_() const {
  249|  31.6k|  return new AsciiValue(*this);
  250|  31.6k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  7.62k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  7.62k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  7.62k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 1.10k, False: 6.52k]
  ------------------
  256|  1.10k|    pos = value_.size();
  257|  7.62k|  return os << value_.substr(0, pos);
  258|  7.62k|}
_ZN5Exiv212CommentValueC2Ev:
  292|    223|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|    223|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|    223|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|    223|  byteOrder_ = byteOrder;
  331|    223|  return StringValueBase::read(buf, len, byteOrder);
  332|    223|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|    447|CommentValue* CommentValue::clone_() const {
  411|    447|  return new CommentValue(*this);
  412|    447|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  14.1k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  14.1k|  xmpArrayType_ = xmpArrayType;
  416|  14.1k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  4.21k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  4.21k|  xmpStruct_ = xmpStruct;
  420|  4.21k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|    792|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|    792|  return xmpArrayType_;
  424|    792|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  13.2k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  13.2k|  XmpArrayType xa = xaNone;
  428|  13.2k|  switch (typeId) {
  429|    125|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 125, False: 13.0k]
  ------------------
  430|    125|      xa = xaAlt;
  431|    125|      break;
  432|    497|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 497, False: 12.7k]
  ------------------
  433|    497|      xa = xaBag;
  434|    497|      break;
  435|  9.49k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 9.49k, False: 3.73k]
  ------------------
  436|  9.49k|      xa = xaSeq;
  437|  9.49k|      break;
  438|  3.10k|    default:
  ------------------
  |  Branch (438:5): [True: 3.10k, False: 10.1k]
  ------------------
  439|  3.10k|      break;
  440|  13.2k|  }
  441|  13.2k|  return xa;
  442|  13.2k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|    778|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|    778|  return xmpStruct_;
  446|    778|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   148k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   148k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   527k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   527k|  std::string b = buf;
  478|   527k|  std::string type;
  479|   527k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 2.89k, False: 524k]
  ------------------
  480|  2.89k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  2.89k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  2.89k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 2.57k, False: 319]
  |  Branch (483:26): [True: 1.88k, False: 692]
  ------------------
  484|  1.88k|      type = type.substr(1);
  485|  2.89k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 2.24k, False: 649]
  |  Branch (485:26): [True: 633, False: 1.61k]
  ------------------
  486|    633|      type.pop_back();
  487|  2.89k|    b.clear();
  488|  2.89k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 1.45k, False: 1.44k]
  ------------------
  489|  1.45k|      b = buf.substr(pos + 1);
  490|  2.89k|  }
  491|   527k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 2.24k, False: 525k]
  ------------------
  492|  2.24k|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 215, False: 2.03k]
  ------------------
  493|    215|      setXmpArrayType(XmpValue::xaAlt);
  494|  2.03k|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 194, False: 1.83k]
  ------------------
  495|    194|      setXmpArrayType(XmpValue::xaBag);
  496|  1.83k|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 529, False: 1.30k]
  ------------------
  497|    529|      setXmpArrayType(XmpValue::xaSeq);
  498|  1.30k|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 838, False: 469]
  ------------------
  499|    838|      setXmpStruct();
  500|    838|    } else {
  501|    469|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    469|    }
  503|  2.24k|  }
  504|   527k|  value_ = std::move(b);
  505|   527k|  return 0;
  506|   527k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|    785|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|    785|  bool del = false;
  524|    785|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 7, False: 778]
  ------------------
  525|      7|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 7, False: 0]
  ------------------
  526|      7|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 7, False: 0]
  ------------------
  527|      7|        os << "type=\"Alt\"";
  528|      7|        break;
  529|      0|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 0, False: 7]
  ------------------
  530|      0|        os << "type=\"Bag\"";
  531|      0|        break;
  532|      0|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 0, False: 7]
  ------------------
  533|      0|        os << "type=\"Seq\"";
  534|      0|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 7]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|      7|    }
  538|      7|    del = true;
  539|    778|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 0, False: 778]
  ------------------
  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|    785|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 7, False: 778]
  |  Branch (549:14): [True: 0, False: 7]
  ------------------
  550|      0|    os << " ";
  551|    785|  return os << value_;
  552|    785|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   299k|XmpTextValue* XmpTextValue::clone_() const {
  571|   299k|  return new XmpTextValue(*this);
  572|   299k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  9.84k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  9.84k|  setXmpArrayType(xmpArrayType(typeId));
  576|  9.84k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   133k|int XmpArrayValue::read(const std::string& buf) {
  579|   133k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 110k, False: 22.9k]
  ------------------
  580|   110k|    value_.push_back(buf);
  581|   133k|  return 0;
  582|   133k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|     79|size_t XmpArrayValue::count() const {
  589|     79|  return value_.size();
  590|     79|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|     76|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|     76|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 72, False: 4]
  ------------------
  594|     72|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|     72|    os << value_.back();
  596|     72|  }
  597|     76|  return os;
  598|     76|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|  3.96k|std::string XmpArrayValue::toString(size_t n) const {
  601|  3.96k|  ok_ = true;
  602|  3.96k|  return value_.at(n);
  603|  3.96k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  18.7k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  18.7k|  return new XmpArrayValue(*this);
  623|  18.7k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|    971|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|    971|}
_ZNK5Exiv212LangAltValue5countEv:
  679|     37|size_t LangAltValue::count() const {
  680|     37|  return value_.size();
  681|     37|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|      6|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|      6|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|      6|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 6]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|      6|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 6, False: 6]
  ------------------
  694|      6|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 6, False: 0]
  ------------------
  695|      6|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 6]
  ------------------
  696|      0|        os << ", ";
  697|      6|      os << "lang=\"" << lang << "\" " << s;
  698|      6|      first = false;
  699|      6|    }
  700|      6|  }
  701|      6|  return os;
  702|      6|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|     85|std::string LangAltValue::toString(size_t /*n*/) const {
  705|     85|  return toString("x-default");
  706|     85|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|     85|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|     85|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 48, False: 37]
  ------------------
  710|     48|    ok_ = true;
  711|     48|    return i->second;
  712|     48|  }
  713|     37|  ok_ = false;
  714|     37|  return "";
  715|     85|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  1.96k|LangAltValue* LangAltValue::clone_() const {
  738|  1.96k|  return new LangAltValue(*this);
  739|  1.96k|}
_ZN5Exiv29DateValueC2Ev:
  741|  6.51k|DateValue::DateValue() : Value(date) {
  742|  6.51k|  date_ = {};
  743|  6.51k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  6.51k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  6.51k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  6.51k|  return read(str);
  752|  6.51k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  6.51k|int DateValue::read(const std::string& buf) {
  755|       |  // ISO 8601 date formats:
  756|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  757|  6.51k|  size_t monthPos = 0;
  758|  6.51k|  size_t dayPos = 0;
  759|       |
  760|  6.51k|  auto printWarning = [] {
  761|  6.51k|#ifndef SUPPRESS_WARNINGS
  762|  6.51k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  6.51k|#endif
  764|  6.51k|  };
  765|       |
  766|  6.51k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 266, False: 6.25k]
  ------------------
  767|    266|    printWarning();
  768|    266|    return 1;
  769|    266|  }
  770|       |
  771|  6.25k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 3.19k, False: 3.05k]
  |  Branch (771:28): [True: 2.09k, False: 1.10k]
  |  Branch (771:45): [True: 854, False: 1.24k]
  |  Branch (771:63): [True: 3.04k, False: 2.35k]
  ------------------
  772|  3.89k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 854, False: 3.04k]
  ------------------
  773|    854|      monthPos = 5;
  774|    854|      dayPos = 8;
  775|  3.04k|    } else {
  776|  3.04k|      monthPos = 4;
  777|  3.04k|      dayPos = 6;
  778|  3.04k|    }
  779|       |
  780|  3.89k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  3.89k|      for (size_t i = start; i < start + count; ++i) {
  782|  3.89k|        if (!std::isdigit(buf[i])) {
  783|  3.89k|          printWarning();
  784|  3.89k|          return 1;
  785|  3.89k|        }
  786|  3.89k|      }
  787|  3.89k|      dest = std::stoul(buf.substr(start, count));
  788|  3.89k|      return 0;
  789|  3.89k|    };
  790|       |
  791|  3.89k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 1.01k, False: 2.88k]
  |  Branch (791:42): [True: 1.04k, False: 1.84k]
  |  Branch (791:83): [True: 475, False: 1.36k]
  ------------------
  792|  2.52k|      printWarning();
  793|  2.52k|      return 1;
  794|  2.52k|    }
  795|       |
  796|  1.36k|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 485, False: 884]
  |  Branch (796:29): [True: 430, False: 454]
  ------------------
  797|    915|      date_.month = 0;
  798|    915|      date_.day = 0;
  799|    915|      printWarning();
  800|    915|      return 1;
  801|    915|    }
  802|    454|    return 0;
  803|  1.36k|  }
  804|  2.35k|  printWarning();
  805|  2.35k|  return 1;
  806|  6.25k|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|    545|DateValue* DateValue::clone_() const {
  835|    545|  return new DateValue(*this);
  836|    545|}
_ZN5Exiv29TimeValueC2Ev:
  877|  11.0k|TimeValue::TimeValue() : Value(time) {
  878|  11.0k|  time_ = {};
  879|  11.0k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  11.0k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  11.0k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  11.0k|  return read(str);
  888|  11.0k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  11.0k|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|  11.0k|  auto printWarning = [] {
  896|  11.0k|#ifndef SUPPRESS_WARNINGS
  897|  11.0k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  11.0k|#endif
  899|  11.0k|    return 1;
  900|  11.0k|  };
  901|       |
  902|  11.0k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 510, False: 10.5k]
  ------------------
  903|    510|    return printWarning();
  904|       |
  905|  10.5k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 155k, False: 6.56k]
  ------------------
  906|   155k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 152k, False: 3.14k]
  |  Branch (906:21): [True: 148k, False: 3.41k]
  |  Branch (906:33): [True: 143k, False: 5.61k]
  |  Branch (906:45): [True: 141k, False: 1.65k]
  |  Branch (906:57): [True: 3.94k, False: 137k]
  ------------------
  907|  3.94k|      return printWarning();
  908|       |
  909|  6.56k|  size_t mpos;
  910|  6.56k|  size_t spos;
  911|  6.56k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 2.05k, False: 4.51k]
  ------------------
  912|  2.05k|    mpos = 3;
  913|  2.05k|    spos = 6;
  914|  4.51k|  } else {
  915|  4.51k|    mpos = 2;
  916|  4.51k|    spos = 4;
  917|  4.51k|  }
  918|       |
  919|  6.56k|  try {
  920|  6.56k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  6.56k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 352, False: 6.21k]
  |  Branch (921:19): [True: 145, False: 6.06k]
  ------------------
  922|    473|      return printWarning();
  923|  6.09k|    time_.hour = hi;
  924|  6.09k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 5.47k, False: 619]
  ------------------
  925|  5.47k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  5.47k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 95, False: 5.37k]
  |  Branch (926:21): [True: 324, False: 5.05k]
  ------------------
  927|    369|        return printWarning();
  928|  5.10k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  5.10k|    } else {
  930|    619|      time_.minute = 0;
  931|    619|    }
  932|  5.72k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 4.58k, False: 1.13k]
  ------------------
  933|  4.58k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  4.58k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 551, False: 4.03k]
  |  Branch (934:21): [True: 394, False: 3.64k]
  ------------------
  935|    918|        return printWarning();
  936|  3.66k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  3.66k|    } else {
  938|  1.13k|      time_.second = 0;
  939|  1.13k|    }
  940|       |
  941|  4.80k|    auto fpos = buf.find('+');
  942|  4.80k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 3.17k, False: 1.63k]
  ------------------
  943|  3.17k|      fpos = buf.find('-');
  944|       |
  945|  4.80k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 3.57k, False: 1.23k]
  ------------------
  946|  3.57k|      auto format = buf.substr(fpos, buf.size());
  947|  3.57k|      auto posColon = format.find(':');
  948|  3.57k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (948:11): [True: 2.17k, False: 1.39k]
  ------------------
  949|       |        // Extended format
  950|  2.17k|        auto tzhi = std::stoi(format.substr(0, 3));
  951|  2.17k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (951:13): [True: 155, False: 2.02k]
  |  Branch (951:27): [True: 90, False: 1.93k]
  ------------------
  952|    224|          return printWarning();
  953|  1.95k|        time_.tzHour = tzhi;
  954|  1.95k|        if (format.size() > 3) {
  ------------------
  |  Branch (954:13): [True: 1.80k, False: 143]
  ------------------
  955|  1.80k|          int minute = std::stoi(format.substr(3));
  956|  1.80k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (956:15): [True: 363, False: 1.44k]
  |  Branch (956:29): [True: 381, False: 1.06k]
  ------------------
  957|    521|            return printWarning();
  958|  1.28k|          time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (958:28): [True: 207, False: 1.08k]
  ------------------
  959|  1.28k|        }
  960|  1.95k|      } else {
  961|       |        // Basic format
  962|  1.39k|        auto tzhi = std::stoi(format.substr(0, posColon));
  963|  1.39k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (963:13): [True: 141, False: 1.25k]
  |  Branch (963:27): [True: 147, False: 1.10k]
  ------------------
  964|    170|          return printWarning();
  965|  1.22k|        time_.tzHour = tzhi;
  966|  1.22k|        int minute = std::stoi(format.substr(posColon + 1));
  967|  1.22k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (967:13): [True: 418, False: 806]
  |  Branch (967:27): [True: 179, False: 627]
  ------------------
  968|    382|          return printWarning();
  969|    842|        time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (969:26): [True: 358, False: 484]
  ------------------
  970|    842|      }
  971|  3.57k|    }
  972|  4.80k|  } catch (std::exception&) {
  973|       |    // std::stoi might throw an exception if the syntax is invalid.
  974|    560|    return printWarning();
  975|    560|  }
  976|  2.94k|  return 0;
  977|  6.56k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1012|  3.49k|TimeValue* TimeValue::clone_() const {
 1013|  3.49k|  return new TimeValue(*this);
 1014|  3.49k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  8.59k|  auto printWarning = [] {
  761|  8.59k|#ifndef SUPPRESS_WARNINGS
  762|  8.59k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  8.59k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.59k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.59k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  8.59k|#endif
  764|  8.59k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  8.62k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  27.4k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 21.3k, False: 6.09k]
  ------------------
  782|  21.3k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 2.52k, False: 18.8k]
  ------------------
  783|  2.52k|          printWarning();
  784|  2.52k|          return 1;
  785|  2.52k|        }
  786|  21.3k|      }
  787|  6.09k|      dest = std::stoul(buf.substr(start, count));
  788|  6.09k|      return 0;
  789|  8.62k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  8.07k|  auto printWarning = [] {
  896|  8.07k|#ifndef SUPPRESS_WARNINGS
  897|  8.07k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  8.07k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.07k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.07k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  8.07k|#endif
  899|  8.07k|    return 1;
  900|  8.07k|  };

_ZN5Exiv29WebPImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   77|    391|WebPImage::WebPImage(BasicIo::UniquePtr io) : Image(ImageType::webp, mdNone, std::move(io)) {
   78|    391|}  // WebPImage::WebPImage
_ZNK5Exiv29WebPImage8mimeTypeEv:
   80|     42|std::string WebPImage::mimeType() const {
   81|     42|  return "image/webp";
   82|     42|}
_ZN5Exiv29WebPImage12readMetadataEv:
  475|    391|void WebPImage::readMetadata() {
  476|    391|  if (io_->open() != 0)
  ------------------
  |  Branch (476:7): [True: 0, False: 391]
  ------------------
  477|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  478|    391|  IoCloser closer(*io_);
  479|       |  // Ensure that this is the correct image type
  480|    391|  if (!isWebPType(*io_, true)) {
  ------------------
  |  Branch (480:7): [True: 0, False: 391]
  ------------------
  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|    391|  clearMetadata();
  486|       |
  487|    391|  byte data[12];
  488|    391|  DataBuf chunkId(5);
  489|    391|  chunkId.write_uint8(4, '\0');
  490|       |
  491|    391|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  492|       |
  493|    391|  const uint32_t filesize = Safe::add(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian), 8U);
  494|    391|  Internal::enforce(filesize <= io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  495|       |
  496|    391|  WebPImage::decodeChunks(filesize);
  497|       |
  498|    391|}  // WebPImage::readMetadata
_ZN5Exiv29WebPImage12decodeChunksEj:
  500|    364|void WebPImage::decodeChunks(uint32_t filesize) {
  501|    364|  DataBuf chunkId(5);
  502|    364|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  503|    364|  bool has_canvas_data = false;
  504|       |
  505|       |#ifdef EXIV2_DEBUG_MESSAGES
  506|       |  std::cout << "Reading metadata" << '\n';
  507|       |#endif
  508|       |
  509|    364|  chunkId.write_uint8(4, '\0');
  510|  1.48k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (510:10): [True: 1.17k, False: 303]
  |  Branch (510:25): [True: 1.11k, False: 61]
  ------------------
  511|  1.11k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  512|  1.11k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  513|       |
  514|  1.11k|    const uint32_t size = Exiv2::getULong(size_buff.data(), littleEndian);
  515|       |
  516|       |    // Check that `size` is within bounds.
  517|  1.11k|    Internal::enforce(io_->tell() <= filesize, Exiv2::ErrorCode::kerCorruptedMetadata);
  518|  1.11k|    Internal::enforce(size <= (filesize - io_->tell()), Exiv2::ErrorCode::kerCorruptedMetadata);
  519|       |
  520|  1.11k|    if (DataBuf payload(size); payload.empty()) {
  ------------------
  |  Branch (520:32): [True: 294, False: 824]
  ------------------
  521|    294|      io_->seek(size, BasicIo::cur);
  522|    824|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_canvas_data) {
  ------------------
  |  Branch (522:16): [True: 23, False: 801]
  |  Branch (522:66): [True: 17, False: 6]
  ------------------
  523|     17|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  524|       |
  525|     17|      has_canvas_data = true;
  526|     17|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  527|       |
  528|     17|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  529|       |
  530|       |      // Fetch width
  531|     17|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  532|     17|      size_buf.back() = 0;
  533|     17|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  534|       |
  535|       |      // Fetch height
  536|     17|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  537|     17|      size_buf.back() = 0;
  538|     17|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  539|    807|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_canvas_data) {
  ------------------
  |  Branch (539:16): [True: 31, False: 776]
  |  Branch (539:65): [True: 21, False: 10]
  ------------------
  540|     21|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  541|       |
  542|     21|      has_canvas_data = true;
  543|     21|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  544|     21|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  545|       |
  546|       |      // Fetch width""
  547|     21|      std::copy_n(payload.begin() + 6, 2, size_buf.begin());
  548|     21|      size_buf[2] = 0;
  549|     21|      size_buf[3] = 0;
  550|     21|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  551|       |
  552|       |      // Fetch height
  553|     21|      std::copy_n(payload.begin() + 8, 2, size_buf.begin());
  554|     21|      size_buf[2] = 0;
  555|     21|      size_buf[3] = 0;
  556|     21|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  557|    786|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_canvas_data) {
  ------------------
  |  Branch (557:16): [True: 21, False: 765]
  |  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|    765|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_canvas_data) {
  ------------------
  |  Branch (576:16): [True: 0, False: 765]
  |  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|    765|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (593:16): [True: 19, False: 746]
  ------------------
  594|     19|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  595|     19|      this->setIccProfile(std::move(payload));
  596|    746|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (596:16): [True: 365, False: 381]
  ------------------
  597|    365|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  598|       |
  599|    365|      std::array<byte, 2> size_buff2;
  600|       |      // 4 meaningful bytes + 2 padding bytes
  601|    365|      auto exifLongHeader = std::array<byte, 6>{0xFF, 0x01, 0xFF, 0xE1, 0x00, 0x00};
  602|    365|      auto exifShortHeader = std::array<byte, 6>{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  603|    365|      const byte exifTiffLEHeader[] = {0x49, 0x49, 0x2A};        // "MM*"
  604|    365|      const byte exifTiffBEHeader[] = {0x4D, 0x4D, 0x00, 0x2A};  // "II\0*"
  605|    365|      size_t offset = 0;
  606|    365|      bool s_header = false;
  607|    365|      bool le_header = false;
  608|    365|      bool be_header = false;
  609|    365|      size_t pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 4);
  610|       |
  611|    365|      if (pos == std::string::npos) {
  ------------------
  |  Branch (611:11): [True: 342, False: 23]
  ------------------
  612|    342|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 6);
  613|    342|        if (pos != std::string::npos) {
  ------------------
  |  Branch (613:13): [True: 0, False: 342]
  ------------------
  614|      0|          s_header = true;
  615|      0|        }
  616|    342|      }
  617|    365|      if (pos == std::string::npos) {
  ------------------
  |  Branch (617:11): [True: 342, False: 23]
  ------------------
  618|    342|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffLEHeader, 3);
  619|    342|        if (pos != std::string::npos) {
  ------------------
  |  Branch (619:13): [True: 78, False: 264]
  ------------------
  620|     78|          le_header = true;
  621|     78|        }
  622|    342|      }
  623|    365|      if (pos == std::string::npos) {
  ------------------
  |  Branch (623:11): [True: 264, False: 101]
  ------------------
  624|    264|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffBEHeader, 4);
  625|    264|        if (pos != std::string::npos) {
  ------------------
  |  Branch (625:13): [True: 59, False: 205]
  ------------------
  626|     59|          be_header = true;
  627|     59|        }
  628|    264|      }
  629|       |
  630|    365|      if (s_header) {
  ------------------
  |  Branch (630:11): [True: 0, False: 365]
  ------------------
  631|      0|        offset += 6;
  632|      0|      }
  633|    365|      if (be_header || le_header) {
  ------------------
  |  Branch (633:11): [True: 59, False: 306]
  |  Branch (633:24): [True: 78, False: 228]
  ------------------
  634|    137|        offset += 12;
  635|    137|      }
  636|       |
  637|    365|      const size_t sizePayload = Safe::add(payload.size(), offset);
  638|    365|      DataBuf rawExifData(sizePayload);
  639|       |
  640|    365|      if (s_header) {
  ------------------
  |  Branch (640:11): [True: 0, False: 365]
  ------------------
  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|    365|      if (be_header || le_header) {
  ------------------
  |  Branch (646:11): [True: 59, False: 306]
  |  Branch (646:24): [True: 78, False: 228]
  ------------------
  647|    137|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  648|    137|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  649|    137|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  650|    137|        std::copy(exifShortHeader.begin(), exifShortHeader.end(), rawExifData.begin() + 6);
  651|    137|      }
  652|       |
  653|    365|      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|    365|      if (pos != std::string::npos) {
  ------------------
  |  Branch (660:11): [True: 160, False: 205]
  ------------------
  661|    160|        XmpData xmpData;
  662|    160|        ByteOrder bo = ExifParser::decode(exifData_, payload.c_data(pos), payload.size() - pos);
  663|    160|        setByteOrder(bo);
  664|    205|      } else {
  665|    205|#ifndef SUPPRESS_WARNINGS
  666|    205|        EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    205|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 205]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    205|  LogMsg(LogMsg::warn).os()
  ------------------
  667|    205|#endif
  668|    205|        exifData_.clear();
  669|    205|      }
  670|    381|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (670:16): [True: 25, False: 356]
  ------------------
  671|     25|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  672|     25|      xmpPacket_.assign(payload.c_str(), payload.size());
  673|     25|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (673:11): [True: 25, False: 0]
  |  Branch (673:34): [True: 25, False: 0]
  ------------------
  674|     25|#ifndef SUPPRESS_WARNINGS
  675|     25|        EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  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()
  ------------------
  676|     25|#endif
  677|     25|      } 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|    356|    } else {
  684|    356|      io_->seek(size, BasicIo::cur);
  685|    356|    }
  686|       |
  687|  1.11k|    if (io_->tell() % 2)
  ------------------
  |  Branch (687:9): [True: 225, False: 893]
  ------------------
  688|    225|      io_->seek(+1, BasicIo::cur);
  689|  1.11k|  }
  690|    364|}
_ZN5Exiv215newWebPInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  694|    391|Image::UniquePtr newWebPInstance(BasicIo::UniquePtr io, bool /*create*/) {
  695|    391|  auto image = std::make_unique<WebPImage>(std::move(io));
  696|    391|  if (!image->good()) {
  ------------------
  |  Branch (696:7): [True: 0, False: 391]
  ------------------
  697|      0|    return nullptr;
  698|      0|  }
  699|    391|  return image;
  700|    391|}
_ZN5Exiv210isWebPTypeERNS_7BasicIoEb:
  702|  21.8k|bool isWebPType(BasicIo& iIo, bool /*advance*/) {
  703|  21.8k|  if (iIo.size() < 12) {
  ------------------
  |  Branch (703:7): [True: 139, False: 21.6k]
  ------------------
  704|    139|    return false;
  705|    139|  }
  706|  21.6k|  const int32_t len = 4;
  707|  21.6k|  constexpr std::array<byte, len> RiffImageId{'R', 'I', 'F', 'F'};
  708|  21.6k|  constexpr std::array<byte, len> WebPImageId{'W', 'E', 'B', 'P'};
  709|  21.6k|  std::array<byte, len> webp;
  710|  21.6k|  std::array<byte, len> data;
  711|  21.6k|  std::array<byte, len> riff;
  712|  21.6k|  iIo.readOrThrow(riff.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  713|  21.6k|  iIo.readOrThrow(data.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  714|  21.6k|  iIo.readOrThrow(webp.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  715|  21.6k|  bool matched_riff = riff == RiffImageId;
  716|  21.6k|  bool matched_webp = webp == WebPImageId;
  717|  21.6k|  iIo.seek(-12, BasicIo::cur);
  718|  21.6k|  return matched_riff && matched_webp;
  ------------------
  |  Branch (718:10): [True: 1.89k, False: 19.7k]
  |  Branch (718:26): [True: 1.17k, False: 719]
  ------------------
  719|  21.8k|}
_ZN5Exiv29WebPImage13equalsWebPTagERKNS_7DataBufEPKc:
  728|  3.67k|bool WebPImage::equalsWebPTag(const Exiv2::DataBuf& buf, const char* str) {
  729|  6.15k|  for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (729:19): [True: 5.67k, False: 484]
  ------------------
  730|  5.67k|    if (toupper(buf.read_uint8(i)) != str[i])
  ------------------
  |  Branch (730:9): [True: 3.19k, False: 2.48k]
  ------------------
  731|  3.19k|      return false;
  732|    484|  return true;
  733|  3.67k|}
_ZN5Exiv29WebPImage15getHeaderOffsetEPKhmS2_m:
  796|  1.31k|size_t WebPImage::getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size) {
  797|  1.31k|  size_t pos = std::string::npos;  // error value
  798|  1.31k|  if (data_size < header_size) {
  ------------------
  |  Branch (798:7): [True: 270, False: 1.04k]
  ------------------
  799|    270|    return pos;
  800|    270|  }
  801|   743k|  for (size_t i = 0; i < data_size - header_size; i++) {
  ------------------
  |  Branch (801:22): [True: 742k, False: 883]
  ------------------
  802|   742k|    if (memcmp(header, &data[i], header_size) == 0) {
  ------------------
  |  Branch (802:9): [True: 160, False: 741k]
  ------------------
  803|    160|      pos = i;
  804|    160|      break;
  805|    160|    }
  806|   742k|  }
  807|  1.04k|  return pos;
  808|  1.31k|}

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

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  6.35k|{
  625|  6.35k|	IgnoreParam(options);
  ------------------
  |  |  117|  6.35k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  6.35k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  6.35k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  6.35k|{
  647|       |
  648|  6.35k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     74|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 74, False: 6.28k]
  ------------------
  649|  6.28k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  6.28k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  6.28k|{
  664|  6.28k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  6.28k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  6.28k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  6.28k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  34.3k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 28.1k, False: 6.28k]
  ------------------
  670|  28.1k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 21.8k, False: 6.27k]
  ------------------
  671|  6.27k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  6.27k|	}
  673|       |
  674|  6.28k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  10.2k|{
  695|  10.2k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  10.2k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.21k, False: 6.01k]
  |  Branch (696:45): [True: 8, False: 4.20k]
  ------------------
  697|      8|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  10.2k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 6.27k, False: 3.94k]
  |  Branch (700:21): [True: 266, False: 6.00k]
  ------------------
  701|    266|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    266|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  9.94k|	} else {
  703|  9.94k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  9.94k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  9.94k|	}
  706|       |
  707|  10.2k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   300k|{
  265|   300k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   300k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 299k, False: 391]
  |  Branch (269:28): [True: 98.8k, False: 200k]
  ------------------
  270|       |
  271|  98.8k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 80.9k, False: 17.8k]
  ------------------
  272|  80.9k|			term = kRDFTerm_li;
  273|  80.9k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 18, False: 17.8k]
  ------------------
  274|     18|			term = kRDFTerm_parseType;
  275|  17.8k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 6.01k, False: 11.8k]
  ------------------
  276|  6.01k|			term = kRDFTerm_Description;
  277|  11.8k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.21k, False: 10.6k]
  ------------------
  278|  1.21k|			term = kRDFTerm_about;
  279|  10.6k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 45, False: 10.6k]
  ------------------
  280|     45|			term = kRDFTerm_resource;
  281|  10.6k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 50, False: 10.5k]
  ------------------
  282|     50|			term = kRDFTerm_RDF;
  283|  10.5k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 21, False: 10.5k]
  ------------------
  284|     21|			term = kRDFTerm_ID;
  285|  10.5k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 34, False: 10.4k]
  ------------------
  286|     34|			term = kRDFTerm_nodeID;
  287|  10.4k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 81, False: 10.4k]
  ------------------
  288|     81|			term = kRDFTerm_datatype;
  289|  10.4k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 34, False: 10.3k]
  ------------------
  290|     34|			term = kRDFTerm_aboutEach;
  291|  10.3k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 10, False: 10.3k]
  ------------------
  292|     10|			term = kRDFTerm_aboutEachPrefix;
  293|  10.3k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 109, False: 10.2k]
  ------------------
  294|    109|			term = kRDFTerm_bagID;
  295|    109|		}
  296|       |
  297|  98.8k|	}
  298|       |
  299|   300k|	return term;
  300|       |
  301|   300k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  9.94k|{
  732|  9.94k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  9.94k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  9.94k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  29.8k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 20.7k, False: 9.10k]
  ------------------
  738|       |
  739|  20.7k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  20.7k|		switch ( attrTerm ) {
  742|       |
  743|     21|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 21, False: 20.7k]
  ------------------
  744|     49|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 28, False: 20.7k]
  ------------------
  745|  1.26k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.21k, False: 19.5k]
  ------------------
  746|       |
  747|  1.26k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 15, False: 1.25k]
  ------------------
  748|  1.25k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.25k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.25k, False: 0]
  |  Branch (750:24): [True: 1.20k, False: 49]
  ------------------
  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.20k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.20k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.20k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.20k, False: 0]
  ------------------
  755|  1.20k|						xmpParent->name = (*currAttr)->value;
  756|  1.20k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 0, False: 0]
  ------------------
  757|      0|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 0, False: 0]
  ------------------
  758|      0|					}
  759|  1.20k|				}
  760|       |
  761|  1.25k|				break;
  762|       |
  763|  19.2k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 19.2k, False: 1.56k]
  ------------------
  764|  19.2k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  19.2k|				break;
  766|       |
  767|    302|			default :
  ------------------
  |  Branch (767:4): [True: 302, False: 20.4k]
  ------------------
  768|    302|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|    302|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  20.7k|		}
  771|       |
  772|  20.7k|	}
  773|       |
  774|  9.94k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   128k|{
  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|   128k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 459, False: 127k]
  ------------------
  371|    459|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    459|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   127k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   127k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   127k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   127k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   127k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 23.0k, False: 104k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  23.0k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  23.0k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  23.0k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  23.0k|#define kXMP_CreateNodes	true
  ------------------
  384|  23.0k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  23.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  10.8k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 10.8k, False: 12.2k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  23.0k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  23.0k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 23.0k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  23.0k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   127k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 46.8k, False: 81.0k]
  ------------------
  398|  46.8k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  46.8k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 35, False: 46.8k]
  ------------------
  399|     35|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  46.8k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   127k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   127k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 127k, False: 72]
  |  Branch (406:26): [True: 10, False: 62]
  ------------------
  407|   127k|		 xmpParent->children.push_back ( newChild );
  408|   127k|	} else {
  409|     63|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     63|	}
  411|   127k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 72, False: 127k]
  ------------------
  412|     72|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     72|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 71, False: 1]
  |  Branch (412:22): [True: 1, False: 0]
  ------------------
  413|      0|		xmpParent->options |= kRDF_HasValueElem;
  414|      0|	}
  415|       |	
  416|   127k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 80.9k, False: 46.8k]
  ------------------
  417|  80.9k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      4|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 4, False: 80.9k]
  ------------------
  418|  80.9k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  80.9k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  80.9k|	}
  423|       |	
  424|   127k|	return newChild;
  425|       |
  426|   127k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  9.10k|{
  787|  9.10k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  9.10k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   282k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 274k, False: 8.93k]
  ------------------
  791|   274k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 188k, False: 85.5k]
  ------------------
  792|  85.5k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 172, False: 85.4k]
  ------------------
  793|    172|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    172|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  85.4k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  85.4k|	}
  797|       |
  798|  9.10k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  85.4k|{
  854|  85.4k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  85.4k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     42|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 42, False: 85.3k]
  ------------------
  856|       |	
  857|  85.3k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 1.93k, False: 83.4k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  1.93k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  83.4k|	} else {
  863|       |
  864|       |		// Look through the attributes for one that isn't rdf:ID or xml:lang, it will usually tell
  865|       |		// what we should be dealing with. The called routines must verify their specific syntax!
  866|       |
  867|  83.4k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  83.4k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  83.4k|		XMP_VarString * attrName = 0;
  870|       |
  871|   148k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 67.1k, False: 81.2k]
  ------------------
  872|  67.1k|			attrName = &((*currAttr)->name);
  873|  67.1k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 2.18k, False: 64.9k]
  |  Branch (873:38): [True: 2.18k, False: 0]
  ------------------
  874|  67.1k|		}
  875|       |
  876|  83.4k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 2.18k, False: 81.2k]
  ------------------
  877|       |
  878|  2.18k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  2.18k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  2.18k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  2.18k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 6, False: 2.17k]
  ------------------
  882|      6|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  2.17k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 2.17k, False: 0]
  ------------------
  884|  2.17k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  2.17k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 0, False: 0]
  ------------------
  886|      0|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|      0|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 0, False: 0]
  ------------------
  888|      0|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|      0|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 0]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|      0|			} else {
  892|      0|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|      0|			}
  894|       |
  895|  81.2k|		} 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|  81.2k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 63.3k, False: 17.8k]
  ------------------
  901|       |
  902|  63.3k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  63.3k|			} else {
  905|       |			
  906|  17.8k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  17.8k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  40.7k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 26.8k, False: 13.8k]
  ------------------
  910|  26.8k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.05k, False: 22.8k]
  ------------------
  911|  26.8k|				}
  912|       |				
  913|  17.8k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 13.8k, False: 4.05k]
  ------------------
  914|  13.8k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  13.8k|				} else {
  916|  4.05k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.05k|				}
  918|       |			
  919|  17.8k|			}
  920|       |
  921|  81.2k|		}
  922|       |		
  923|  83.4k|	}
  924|       |
  925|  85.3k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  85.4k|{
  350|       |
  351|  85.4k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 7, False: 85.3k]
  |  Branch (351:42): [True: 0, False: 85.3k]
  ------------------
  352|  85.3k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  85.4k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  85.3k|{
  334|       |
  335|  85.3k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 85.3k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  85.3k|	return false;
  337|       |
  338|  85.3k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  85.3k|{
  317|       |
  318|  85.3k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 80.9k, False: 4.42k]
  |  Branch (318:40): [True: 35, False: 80.9k]
  ------------------
  319|  85.3k|	return false;
  320|       |
  321|  85.3k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  67.4k|{
 1190|  67.4k|	bool hasPropertyAttrs = false;
 1191|  67.4k|	bool hasResourceAttr  = false;
 1192|  67.4k|	bool hasNodeIDAttr    = false;
 1193|  67.4k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  67.4k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  67.4k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 8, False: 67.4k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  67.4k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  67.4k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   159k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 92.3k, False: 67.4k]
  ------------------
 1205|       |
 1206|  92.3k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  92.3k|		switch ( attrTerm ) {
 1209|       |
 1210|      0|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 0, False: 92.3k]
  ------------------
 1211|       |				// Nothing to do.
 1212|      0|				break;
 1213|       |
 1214|      9|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 9, False: 92.2k]
  ------------------
 1215|      9|				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: 9]
  ------------------
 1216|      9|				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: 9]
  ------------------
 1217|      9|				hasResourceAttr = true;
 1218|      9|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 9, False: 0]
  ------------------
 1219|      9|				break;
 1220|       |
 1221|      3|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 3, False: 92.3k]
  ------------------
 1222|      3|				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: 3]
  ------------------
 1223|      3|				hasNodeIDAttr = true;
 1224|      3|				break;
 1225|       |
 1226|  92.2k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 92.2k, False: 13]
  ------------------
 1227|  92.2k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 699, False: 91.5k]
  ------------------
 1228|    699|					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: 699]
  ------------------
 1229|    699|					hasValueAttr = true;
 1230|    699|					valueNode = *currAttr;
 1231|  91.5k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 28.0k, False: 63.4k]
  ------------------
 1232|  28.0k|					hasPropertyAttrs = true;
 1233|  28.0k|				}
 1234|  92.2k|				break;
 1235|       |
 1236|  92.2k|			default :
  ------------------
  |  Branch (1236:4): [True: 1, False: 92.3k]
  ------------------
 1237|      1|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  92.3k|		}
 1241|       |
 1242|  92.3k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  67.4k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  67.4k|	bool childIsStruct = false;
 1250|       |	
 1251|  67.4k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 707, False: 66.7k]
  ------------------
 1252|    707|		childNode->value = valueNode->value;
 1253|    707|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 8, False: 699]
  ------------------
 1254|  66.7k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 3.39k, False: 63.3k]
  ------------------
 1255|  3.39k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  3.39k|		childIsStruct = true;
 1257|  3.39k|	}
 1258|       |		
 1259|  67.4k|	currAttr = xmlNode.attrs.begin();
 1260|  67.4k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   159k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 92.1k, False: 67.4k]
  ------------------
 1263|       |
 1264|  92.1k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 699, False: 91.4k]
  ------------------
 1265|  91.4k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  91.4k|		switch ( attrTerm ) {
 1268|       |
 1269|      0|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 0, False: 91.4k]
  ------------------
 1270|      3|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 3, False: 91.4k]
  ------------------
 1271|      3|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 91.4k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  91.4k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 91.4k, False: 3]
  ------------------
 1278|  91.4k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 67.5k, False: 23.9k]
  |  Branch (1278:31): [True: 201, False: 23.7k]
  ------------------
 1279|  67.7k|					AddQualifierNode ( childNode, **currAttr );
 1280|  67.7k|				} else {
 1281|  23.7k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  23.7k|				}
 1283|  91.4k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 91.4k]
  ------------------
 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|  91.4k|		}
 1290|       |
 1291|  91.4k|	}
 1292|       |
 1293|  67.4k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  69.3k|{
  484|  69.3k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 8, False: 69.3k]
  ------------------
  485|      8|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  69.3k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  69.3k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  69.3k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  69.3k|	const bool isLang = (name == "xml:lang");
  443|  69.3k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  69.3k|	XMP_Node * newQual = 0;
  446|       |
  447|  69.3k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  69.3k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 4.24k, False: 65.1k]
  ------------------
  450|  4.24k|			xmpParent->qualifiers.push_back ( newQual );
  451|  65.1k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 65.0k, False: 78]
  ------------------
  452|  65.0k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 65.0k, False: 2]
  ------------------
  453|  65.0k|				xmpParent->qualifiers.push_back ( newQual );
  454|  65.0k|			} else {
  455|      2|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|      2|			}
  457|  65.0k|			xmpParent->options |= kXMP_PropHasLang;
  458|  65.0k|		} else {
  459|     78|			XMP_Assert ( isType );
  ------------------
  |  |  142|     78|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|     78|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 73, False: 5]
  ------------------
  461|     73|				xmpParent->qualifiers.push_back ( newQual );
  462|     73|			} else {
  463|      5|				size_t offset = 0;
  464|      5|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 4, False: 1]
  ------------------
  465|      5|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|      5|			}
  467|     78|			xmpParent->options |= kXMP_PropHasType;
  468|     78|		}
  469|       |
  470|  69.3k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  69.3k|	return newQual;
  473|       |
  474|  69.3k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  13.8k|{
 1015|  13.8k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  13.8k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  13.8k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  15.4k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 1.58k, False: 13.8k]
  ------------------
 1021|  1.58k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  1.58k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 1.57k, False: 11]
  ------------------
 1023|  1.57k|			AddQualifierNode ( newChild, **currAttr );
 1024|  1.57k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 0, False: 11]
  |  Branch (1024:41): [True: 6, False: 5]
  ------------------
 1025|      6|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|      6|		} else {
 1027|      5|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  1.58k|	}
 1030|       |	
 1031|  13.8k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  13.8k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  13.8k|	size_t      textSize  = 0;
 1034|       |
 1035|  28.2k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 14.4k, False: 13.8k]
  ------------------
 1036|  14.4k|		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: 14.4k]
  ------------------
 1037|  14.4k|		textSize += (*currChild)->value.size();
 1038|  14.4k|	}
 1039|       |	
 1040|  13.8k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  28.2k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 14.4k, False: 13.8k]
  ------------------
 1043|  14.4k|		newChild->value += (*currChild)->value;
 1044|  14.4k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  13.8k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  4.05k|{
  943|  4.05k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.02k, False: 25]
  |  Branch (943:21): [True: 0, False: 4.02k]
  ------------------
  944|       |	
  945|  4.05k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.05k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.05k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.05k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 4, False: 4.05k]
  ------------------
  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|  4.05k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.05k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  12.2k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 12.2k, False: 35]
  ------------------
  965|  12.2k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.01k, False: 8.18k]
  ------------------
  966|  12.2k|	}
  967|  4.05k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 4.05k]
  ------------------
  968|  4.05k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     70|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 70, False: 3.98k]
  ------------------
  969|       |
  970|  3.98k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 300, False: 3.68k]
  ------------------
  971|    300|		newCompound->options |= kXMP_PropValueIsArray;
  972|  3.68k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.56k, False: 1.12k]
  ------------------
  973|  2.56k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.56k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.00k, False: 114]
  ------------------
  975|  1.00k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.00k|	} else {
  977|    114|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    114|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 76, False: 38]
  ------------------
  979|     76|			XMP_VarString typeName ( (*currChild)->ns );
  980|     76|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|     76|			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: 75]
  ------------------
  982|     75|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|     75|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|     75|		}
  985|    114|	}
  986|       |
  987|  3.98k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  3.98k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 3.98k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  3.98k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 988, False: 2.99k]
  ------------------
  991|    988|		DetectAltText ( newCompound );
  992|    988|	}
  993|       |
  994|  11.7k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 7.84k, False: 3.93k]
  ------------------
  995|  7.84k|		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: 7.80k]
  ------------------
  996|  7.80k|	}
  997|       |
  998|  3.98k|}	// 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|  2.97k|{
  568|  2.97k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  2.97k|	size_t unitCount = 0;
  570|       |
  571|  2.97k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  2.97k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 2.97k]
  ------------------
  573|  2.97k|	inUnit = *utf8In;
  574|  2.97k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 2.97k, 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|  2.97k|MultiByte:
  584|  2.97k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  2.97k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  2.97k|{
  517|  2.97k|	UTF8Unit  inUnit = *utf8In;
  518|  2.97k|	size_t    unitCount = 0;
  519|  2.97k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  2.97k|	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|  2.97k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  9.27k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 6.29k, False: 2.97k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  2.97k|	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: 2.97k]
  |  Branch (538:28): [True: 0, False: 2.97k]
  ------------------
  539|  2.97k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 2.97k]
  ------------------
  540|  2.97k|	unitCount = bytesNeeded;
  541|       |	
  542|  2.97k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  2.97k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  6.29k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 3.31k, False: 2.97k]
  ------------------
  546|  3.31k|		inUnit = *utf8Pos;
  547|  3.31k|		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: 3.31k]
  ------------------
  548|  3.31k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  3.31k|	}
  550|       |	
  551|  2.97k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 0, False: 2.97k]
  ------------------
  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|  2.97k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  2.97k|Done:	
  559|  2.97k|	*utf8Read = unitCount;
  560|  2.97k|	return;
  561|       |	
  562|  2.97k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   603k|{
   88|       |
   89|   603k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   603k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   603k|	const XMP_Uns8 * namePos   = nameStart;
   92|   603k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   603k|	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: 603k]
  ------------------
   97|       |
   98|   603k|	cp = *namePos;
   99|   603k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 603k, False: 157]
  ------------------
  100|   603k|		++namePos;
  101|   603k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 603k]
  ------------------
  102|   603k|	} else {
  103|    157|		cp = GetCodePoint ( &namePos );
  104|    157|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 157]
  ------------------
  105|    157|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  14.0M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 13.4M, False: 603k]
  ------------------
  110|  13.4M|		cp = *namePos;
  111|  13.4M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 13.4M, False: 996]
  ------------------
  112|  13.4M|			++namePos;
  113|  13.4M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 124k, False: 13.3M]
  |  Branch (113:38): [True: 0, False: 124k]
  ------------------
  114|  13.4M|		} else {
  115|    996|			cp = GetCodePoint ( &namePos );
  116|    996|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 247, False: 749]
  |  Branch (116:41): [True: 0, False: 247]
  ------------------
  117|    996|		}
  118|  13.4M|	}
  119|       |
  120|   603k|	return;
  121|       |
  122|   603k|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|  14.0M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  14.0M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 13.6M, False: 399k]
  |  Branch (33:23): [True: 13.6M, False: 0]
  |  Branch (33:40): [True: 275k, False: 124k]
  |  Branch (33:55): [True: 266k, False: 9.05k]
  |  Branch (33:71): [True: 9.05k, False: 124k]
  ------------------
   34|   124k|	return false;
   35|  14.0M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  1.15k|{
   20|  1.15k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  1.15k|	XMP_Uns32 cp;
   22|  1.15k|	size_t u8Len;
   23|  1.15k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  1.15k|	*utf8Str_io = u8Ptr + u8Len;
   25|  1.15k|	return cp;
   26|  1.15k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  1.15k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  1.15k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 1.04k, False: 104]
  |  Branch (43:24): [True: 164, False: 885]
  |  Branch (43:43): [True: 885, False: 104]
  |  Branch (43:59): [True: 156, False: 729]
  ------------------
   44|    833|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 729, False: 104]
  |  Branch (44:24): [True: 299, False: 430]
  |  Branch (44:43): [True: 287, False: 247]
  |  Branch (44:60): [True: 0, False: 287]
  ------------------
   45|       |
   46|    534|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 287, False: 247]
  |  Branch (46:25): [True: 204, False: 83]
  |  Branch (46:46): [True: 83, False: 247]
  |  Branch (46:64): [True: 0, False: 83]
  ------------------
   47|    330|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 83, False: 247]
  |  Branch (47:26): [True: 0, False: 83]
  |  Branch (47:46): [True: 83, False: 247]
  |  Branch (47:64): [True: 0, False: 83]
  ------------------
   48|    330|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 83, False: 247]
  |  Branch (48:26): [True: 83, False: 0]
  |  Branch (48:46): [True: 0, False: 247]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    247|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 247]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 247]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    247|	return false;
   52|       |
   53|    247|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   124k|{
   59|       |	// ASCII following characters for an XML name.
   60|   124k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 66.3k, False: 57.8k]
  |  Branch (60:23): [True: 66.3k, False: 0]
  |  Branch (60:39): [True: 52.0k, False: 5.74k]
  |  Branch (60:54): [True: 5.74k, False: 0]
  ------------------
   61|      0|	return false;
   62|   124k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    247|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    247|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 104, False: 143]
  |  Branch (69:24): [True: 143, False: 0]
  |  Branch (69:41): [True: 143, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    247|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  28.5k|{
   88|       |
   89|  28.5k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  28.5k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  28.5k|	const XMP_Uns8 * namePos   = nameStart;
   92|  28.5k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  28.5k|	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: 28.5k]
  ------------------
   97|       |
   98|  28.5k|	cp = *namePos;
   99|  28.5k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 28.4k, False: 106]
  ------------------
  100|  28.4k|		++namePos;
  101|  28.4k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 28.4k]
  ------------------
  102|  28.4k|	} else {
  103|    106|		cp = GetCodePoint ( &namePos );
  104|    106|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 106]
  ------------------
  105|    106|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  1.93M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 1.90M, False: 28.5k]
  ------------------
  110|  1.90M|		cp = *namePos;
  111|  1.90M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 1.90M, False: 1.71k]
  ------------------
  112|  1.90M|			++namePos;
  113|  1.90M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 9.17k, False: 1.89M]
  |  Branch (113:38): [True: 0, False: 9.17k]
  ------------------
  114|  1.90M|		} else {
  115|  1.71k|			cp = GetCodePoint ( &namePos );
  116|  1.71k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 1.10k, False: 610]
  |  Branch (116:41): [True: 0, False: 1.10k]
  ------------------
  117|  1.71k|		}
  118|  1.90M|	}
  119|       |
  120|  28.5k|	return;
  121|       |
  122|  28.5k|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|  1.92M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  1.92M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 1.87M, False: 53.8k]
  |  Branch (33:23): [True: 1.87M, False: 0]
  |  Branch (33:40): [True: 44.6k, False: 9.17k]
  |  Branch (33:55): [True: 42.9k, False: 1.70k]
  |  Branch (33:71): [True: 1.70k, False: 9.17k]
  ------------------
   34|  9.17k|	return false;
   35|  1.92M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  1.82k|{
   20|  1.82k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  1.82k|	XMP_Uns32 cp;
   22|  1.82k|	size_t u8Len;
   23|  1.82k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  1.82k|	*utf8Str_io = u8Ptr + u8Len;
   25|  1.82k|	return cp;
   26|  1.82k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  1.82k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  1.82k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 832, False: 993]
  |  Branch (43:24): [True: 93, False: 739]
  |  Branch (43:43): [True: 739, False: 993]
  |  Branch (43:59): [True: 58, False: 681]
  ------------------
   44|  1.67k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 681, False: 993]
  |  Branch (44:24): [True: 199, False: 482]
  |  Branch (44:43): [True: 366, False: 1.10k]
  |  Branch (44:60): [True: 0, False: 366]
  ------------------
   45|       |
   46|  1.47k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 366, False: 1.10k]
  |  Branch (46:25): [True: 313, False: 53]
  |  Branch (46:46): [True: 53, False: 1.10k]
  |  Branch (46:64): [True: 0, False: 53]
  ------------------
   47|  1.16k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 53, False: 1.10k]
  |  Branch (47:26): [True: 0, False: 53]
  |  Branch (47:46): [True: 53, False: 1.10k]
  |  Branch (47:64): [True: 0, False: 53]
  ------------------
   48|  1.16k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 53, False: 1.10k]
  |  Branch (48:26): [True: 53, False: 0]
  |  Branch (48:46): [True: 0, False: 1.10k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  1.10k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 1.10k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 1.10k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  1.10k|	return false;
   52|       |
   53|  1.10k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  9.17k|{
   59|       |	// ASCII following characters for an XML name.
   60|  9.17k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 4.20k, False: 4.97k]
  |  Branch (60:23): [True: 4.20k, False: 0]
  |  Branch (60:39): [True: 3.65k, False: 1.31k]
  |  Branch (60:54): [True: 1.31k, False: 0]
  ------------------
   61|      0|	return false;
   62|  9.17k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  1.10k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  1.10k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 993, False: 116]
  |  Branch (69:24): [True: 116, False: 0]
  |  Branch (69:41): [True: 116, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  1.10k|}

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

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

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

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

_ZN13XMP_AutoMutexC2Ev:
  222|   302k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   302k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   302k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|  59.8k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 59.8k, False: 242k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   242k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   422k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   271k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|  20.5k|		: options(_options), name(_name), parent(_parent)
  435|  20.5k|	{
  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|  20.5k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   128k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   128k|	{
  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|   128k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  69.3k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  69.3k|	{
  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|  69.3k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   228k|	{
  479|   368k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 139k, False: 228k]
  ------------------
  480|   139k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 139k, False: 0]
  ------------------
  481|   139k|		}
  482|   228k|		children.clear();
  483|   228k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   228k|	{
  487|   298k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 69.7k, False: 228k]
  ------------------
  488|  69.7k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 69.7k, False: 0]
  ------------------
  489|  69.7k|		}
  490|   228k|		qualifiers.clear();
  491|   228k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  10.2k|	{
  495|  10.2k|		options = 0;
  496|  10.2k|		name.erase();
  497|  10.2k|		value.erase();
  498|  10.2k|		this->RemoveChildren();
  499|  10.2k|		this->RemoveQualifiers();
  500|  10.2k|	}
_ZN8XMP_NodeD2Ev:
  502|   218k|	virtual ~XMP_Node() { RemoveChildren(); RemoveQualifiers(); };

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  8.63k|{
 1097|  8.63k|	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: 8.63k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  8.63k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 8.63k]
  ------------------
 1099|       |	
 1100|  8.63k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  8.63k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  8.63k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 8.63k, False: 0]
  ------------------
 1105|  8.63k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 8.63k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  8.63k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  8.63k|	}
 1108|       |	
 1109|  8.63k|	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|  8.63k|	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|  8.63k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 8.63k, False: 0]
  ------------------
 1127|       |
 1128|  8.63k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 8.63k, False: 0]
  |  Branch (1128:39): [True: 8.62k, False: 17]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  8.62k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  8.62k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     17|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     17|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 17, False: 0]
  ------------------
 1139|       |
 1140|     17|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     17|				buffer += pendingOverlap;
 1142|     17|				xmpSize -= pendingOverlap;
 1143|     17|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     17|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 17]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     17|				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|     17|			}
 1153|       |
 1154|  8.63k|		}
 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|  8.63k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  8.63k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  8.63k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 8.63k]
  ------------------
 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|  8.63k|		} 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|  8.65k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 17, False: 8.63k]
  ------------------
 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|     17|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     17|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 17, False: 0]
  ------------------
 1190|       |				
 1191|     17|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     17|				parser.pendingCount += pendingOverlap;
 1193|     17|				buffer += pendingOverlap;
 1194|     17|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     17|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 17]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     17|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     17|				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|     17|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 17, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     17|					parser.pendingCount = 0;
 1208|       |
 1209|     17|				} 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|     17|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  8.63k|			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|  8.63k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 8.63k]
  ------------------
 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|  8.63k|		}
 1258|       |		
 1259|  8.63k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 8.62k, False: 17]
  ------------------
 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|  8.62k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  8.62k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 6.35k, False: 2.26k]
  ------------------
 1269|       |
 1270|  6.35k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  6.35k|				NormalizeDCArrays ( &this->tree );
 1272|  6.35k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 6.35k]
  ------------------
 1273|  6.35k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  6.35k|				size_t schemaNum = 0;
 1277|  15.8k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 9.46k, False: 6.35k]
  ------------------
 1278|  9.46k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  9.46k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 9.46k, False: 0]
  ------------------
 1280|  9.46k|						++schemaNum;
 1281|  9.46k|					} 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|  9.46k|				}
 1286|       |				
 1287|  6.35k|			}
 1288|       |
 1289|  8.62k|			delete this->xmlParser;
 1290|  8.62k|			this->xmlParser = 0;
 1291|       |
 1292|  8.62k|		}
 1293|       |		
 1294|  8.63k|	} catch ( ... ) {
 1295|       |
 1296|  1.60k|		delete this->xmlParser;
 1297|  1.60k|		this->xmlParser = 0;
 1298|  1.60k|		prevTkVer = 0;
 1299|  1.60k|		this->tree.ClearNode();
 1300|  1.60k|		throw;
 1301|       |
 1302|  1.60k|	}
 1303|       |	
 1304|  8.63k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  8.63k|{
  811|  8.63k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 8.63k]
  ------------------
  812|       |	
  813|  8.63k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  8.63k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 8.63k]
  ------------------
  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|  8.63k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 8.63k, 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|  8.63k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 8.63k, 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|  8.63k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  8.65k|{
  977|  8.65k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  8.65k|	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|  8.65k|	std::string copy;
  992|       |		
  993|  59.0M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 59.0M, False: 8.65k]
  ------------------
  994|       |
  995|  59.0M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 58.8M, False: 261k]
  |  Branch (995:30): [True: 58.5M, False: 241k]
  |  Branch (995:52): [True: 57.5M, False: 1.04M]
  ------------------
  996|  57.5M|			copy.push_back(*spanEnd);
  997|  57.5M|			continue;	// A regular ASCII character.
  998|  57.5M|		}
  999|       |
 1000|  1.55M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 6.72k, False: 1.54M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  6.72k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  6.72k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 6.72k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  6.72k|				copy.append((const char*)spanEnd, uniLen);
 1010|  6.72k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  6.72k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|  1.54M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 261k, False: 1.28M]
  |  Branch (1026:36): [True: 235k, False: 1.04M]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   496k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   496k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   493k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   263k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 2.65k, False: 493k]
  |  Branch (1030:31): [True: 229k, False: 263k]
  |  Branch (1030:52): [True: 28.9k, False: 235k]
  ------------------
 1031|   261k|				copy.push_back(*spanEnd);
 1032|   261k|				continue;
 1033|   261k|			}
 1034|       |
 1035|   235k|			copy.push_back(' ');
 1036|       |		
 1037|  1.04M|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|  1.04M|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|  1.04M|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|  1.04M|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|  1.04M|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 55, False: 1.04M]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     55|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 55, False: 0]
  ------------------
 1048|     55|					copy.push_back('&');
 1049|     55|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     55|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|  1.04M|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 43.8k, False: 1.00M]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  43.8k|				copy.push_back(' ');
 1058|  43.8k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|  1.00M|			} else {
 1061|  1.00M|				copy.push_back('&');
 1062|  1.00M|			}
 1063|       |
 1064|  1.04M|		}
 1065|       |		
 1066|  1.55M|	}
 1067|       |	
 1068|  8.65k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  8.65k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  8.65k|	copy.push_back(' ');
 1070|  8.65k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  8.65k|	return length;
 1072|       |
 1073|  8.65k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  6.72k|{
  868|  6.72k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  6.72k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  6.72k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 6.72k]
  ------------------
  870|  6.72k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 6.72k]
  ------------------
  871|       |	
  872|  6.72k|	int byteCount = 2;
  873|  6.72k|	XMP_Uns8 firstByte = *charStart;
  874|  10.1k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 3.41k, False: 6.72k]
  ------------------
  875|       |	
  876|  6.72k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 6.72k]
  ------------------
  877|       |
  878|  16.8k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 10.1k, False: 6.72k]
  ------------------
  879|  10.1k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 10.1k]
  ------------------
  880|  10.1k|	}
  881|       |	
  882|  6.72k|	return byteCount;
  883|       |	
  884|  6.72k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|  1.04M|{
  898|  1.04M|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|  1.04M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|  1.04M|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 1.04M]
  ------------------
  900|  1.04M|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|  1.04M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|  1.04M|	size_t tailLen = bufEnd - escStart;
  903|  1.04M|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 55, False: 1.04M]
  ------------------
  904|       |	
  905|  1.04M|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 782k, False: 265k]
  ------------------
  906|       |	
  907|   265k|	XMP_Uns8 escValue = 0;
  908|   265k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   265k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 249k, False: 16.6k]
  |  Branch (910:27): [True: 904, False: 248k]
  ------------------
  911|    904|		escValue = *escPos - '0';
  912|    904|		++escPos;
  913|   265k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 242k, False: 22.5k]
  |  Branch (913:34): [True: 1.06k, False: 241k]
  ------------------
  914|  1.06k|		escValue = *escPos - 'A' + 10;
  915|  1.06k|		++escPos;
  916|   263k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 235k, False: 28.2k]
  |  Branch (916:34): [True: 167k, False: 67.9k]
  ------------------
  917|   167k|		escValue = *escPos - 'a' + 10;
  918|   167k|		++escPos;
  919|   167k|	}
  920|       |	
  921|   265k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 210k, False: 54.9k]
  |  Branch (921:27): [True: 267, False: 210k]
  ------------------
  922|    267|		escValue = (escValue << 4) + (*escPos - '0');
  923|    267|		++escPos;
  924|   265k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 199k, False: 66.4k]
  |  Branch (924:34): [True: 1.19k, False: 198k]
  ------------------
  925|  1.19k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  1.19k|		++escPos;
  927|   264k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 192k, False: 72.1k]
  |  Branch (927:34): [True: 104k, False: 88.1k]
  ------------------
  928|   104k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|   104k|		++escPos;
  930|   104k|	}
  931|       |	
  932|   265k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 265k]
  ------------------
  933|   265k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 215k, False: 50.8k]
  ------------------
  934|       |	
  935|  50.8k|	size_t escLen = escPos - escStart + 1;
  936|  50.8k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 5.29k, False: 45.5k]
  ------------------
  937|       |	
  938|  45.5k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  45.5k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  45.1k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  44.2k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 410, False: 45.1k]
  |  Branch (938:29): [True: 849, False: 44.2k]
  |  Branch (938:50): [True: 405, False: 43.8k]
  ------------------
  939|       |	
  940|  43.8k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  45.5k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  8.62k|{
  152|  8.62k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  8.62k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 151, False: 8.47k]
  ------------------
  155|  8.62k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 2.26k, False: 6.35k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  6.35k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  6.35k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  6.35k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  6.35k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 6.35k]
  ------------------
  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|  7.24k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.75k, False: 5.48k]
  ------------------
  168|  1.75k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.75k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 760, False: 997]
  |  Branch (169:42): [True: 116, False: 881]
  ------------------
  170|    876|				verStr = currAttr->value.c_str();
  171|    876|				break;
  172|    876|			}
  173|  1.75k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  6.35k|	unsigned long part;
  178|  21.7k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 16.1k, False: 5.61k]
  |  Branch (178:29): [True: 3.54k, False: 12.6k]
  |  Branch (178:48): [True: 11.8k, False: 744]
  ------------------
  179|       |	
  180|  6.35k|	part = 0;
  181|  9.55k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.93k, False: 5.61k]
  |  Branch (181:28): [True: 3.31k, False: 622]
  |  Branch (181:48): [True: 3.19k, False: 122]
  ------------------
  182|  3.19k|		part = (part * 10) + (*verStr - '0');
  183|  3.19k|		++verStr;
  184|  3.19k|	}
  185|  6.35k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 69, False: 6.29k]
  ------------------
  186|  6.35k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  6.35k|	part = 0;
  189|  6.35k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 388, False: 5.97k]
  ------------------
  190|  9.31k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 3.69k, False: 5.61k]
  |  Branch (190:28): [True: 3.12k, False: 571]
  |  Branch (190:48): [True: 2.95k, False: 172]
  ------------------
  191|  2.95k|		part = (part * 10) + (*verStr - '0');
  192|  2.95k|		++verStr;
  193|  2.95k|	}
  194|  6.35k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 76, False: 6.28k]
  ------------------
  195|  6.35k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  6.35k|	part = 0;
  198|  6.35k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 117, False: 6.24k]
  ------------------
  199|  8.84k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 3.22k, False: 5.61k]
  |  Branch (199:28): [True: 2.70k, False: 524]
  |  Branch (199:48): [True: 2.48k, False: 216]
  ------------------
  200|  2.48k|		part = (part * 10) + (*verStr - '0');
  201|  2.48k|		++verStr;
  202|  2.48k|	}
  203|  6.35k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 77, False: 6.28k]
  ------------------
  204|  6.35k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  6.35k|	part = 0;
  207|  6.35k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 280, False: 6.07k]
  ------------------
  208|  7.41k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.79k, False: 5.61k]
  |  Branch (208:28): [True: 1.47k, False: 318]
  |  Branch (208:48): [True: 1.05k, False: 422]
  ------------------
  209|  1.05k|		part = (part * 10) + (*verStr - '0');
  210|  1.05k|		++verStr;
  211|  1.05k|	}
  212|  6.35k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 24, False: 6.33k]
  ------------------
  213|  6.35k|	thiz->prevTkVer += part;
  214|       |	
  215|  6.35k|	return rootNode;
  216|       |	
  217|  6.35k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  2.28k|{
  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|  7.90k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 5.84k, False: 2.06k]
  ------------------
  116|  5.84k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  5.84k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 4.90k, False: 936]
  ------------------
  118|    936|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 219, False: 717]
  |  Branch (118:44): [True: 0, False: 717]
  ------------------
  119|    936|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  2.06k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 2.06k, False: 0]
  ------------------
  122|  5.91k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 3.97k, False: 1.93k]
  ------------------
  123|  3.97k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  3.97k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 3.53k, False: 446]
  ------------------
  125|    446|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 123, False: 323]
  ------------------
  126|    446|		}
  127|  2.06k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  3.83k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 1.91k, False: 1.92k]
  ------------------
  131|  1.91k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  1.91k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 19, False: 1.89k]
  ------------------
  133|  1.91k|	}
  134|       |	
  135|  1.92k|	return 0;
  136|       |
  137|  1.93k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  4.77k|{
  232|  4.77k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.77k|#define kXMP_ExistingOnly	false
  ------------------
  233|  4.77k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 3.59k, False: 1.17k]
  ------------------
  234|       |	
  235|  4.77k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 3.59k, False: 1.17k]
  ------------------
  236|  3.59k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  3.59k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  3.59k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 564, False: 3.02k]
  ------------------
  240|       |		
  241|  3.02k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 128, False: 2.90k]
  ------------------
  242|  2.90k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 54, False: 2.84k]
  ------------------
  243|    182|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  2.84k|		} else if (
  245|  2.84k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 168, False: 2.67k]
  ------------------
  246|  2.67k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 76, False: 2.60k]
  ------------------
  247|  2.60k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 1, False: 2.60k]
  ------------------
  248|    245|			arrayForm = kXMP_PropArrayIsAltText;
  249|  2.60k|		} else if (
  250|  2.60k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 38, False: 2.56k]
  ------------------
  251|  2.56k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 146, False: 2.41k]
  ------------------
  252|  2.41k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 21, False: 2.39k]
  ------------------
  253|  2.39k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 8, False: 2.38k]
  ------------------
  254|  2.38k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 18, False: 2.37k]
  ------------------
  255|  2.37k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 20, False: 2.35k]
  ------------------
  256|    251|			arrayForm = kXMP_PropValueIsArray;
  257|    251|		}
  258|  3.02k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 2.35k, False: 678]
  ------------------
  259|       |		
  260|    678|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    678|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    678|		dcSchema->children[propNum] = newArray;
  263|    678|		newArray->children.push_back ( currProp );
  264|    678|		currProp->parent = newArray;
  265|    678|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    678|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    678|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 245, False: 433]
  |  Branch (267:44): [True: 245, False: 0]
  ------------------
  268|    245|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    245|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    245|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 245, False: 0]
  ------------------
  271|    245|				currProp->qualifiers.push_back ( newLang );
  272|    245|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    245|		}
  276|       |
  277|    678|	}
  278|       |	
  279|  1.17k|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  4.77k|{
  666|  4.77k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  4.77k|	XMP_Node * currSchema = 0;
  671|       |
  672|  4.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.77k|#define kXMP_ExistingOnly	false
  ------------------
  673|  4.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 19, False: 4.75k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     19|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     19|#define kXMP_ExistingOnly	false
  ------------------
  677|     19|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 19]
  ------------------
  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|     19|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     19|#define kXMP_ExistingOnly	false
  ------------------
  682|     19|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 19]
  |  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|     19|	}
  697|       |
  698|  4.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.77k|#define kXMP_ExistingOnly	false
  ------------------
  699|  4.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 53, False: 4.72k]
  ------------------
  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|     53|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|     53|#define kXMP_ExistingOnly	false
  ------------------
  703|     53|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 53]
  ------------------
  704|     53|	}
  705|       |
  706|  4.77k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.77k|#define kXMP_ExistingOnly	false
  ------------------
  707|  4.77k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 1.17k, False: 3.59k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|  1.17k|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.17k|#define kXMP_ExistingOnly	false
  ------------------
  710|  1.17k|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 120, False: 1.05k]
  ------------------
  711|    120|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|    120|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|    120|		}
  714|  1.17k|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  4.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  4.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  4.77k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  4.77k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  4.77k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  4.77k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 553, False: 4.22k]
  ------------------
  732|       |
  733|    553|		bool nameIsUUID = false;
  734|    553|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    553|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    553|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 179, False: 374]
  |  |  ------------------
  ------------------
  737|       |
  738|    179|			nameIsUUID = true;
  739|       |
  740|    374|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 199, False: 175]
  ------------------
  741|       |
  742|    199|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  2.61k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 2.59k, False: 17]
  ------------------
  744|  2.59k|				char ch = nameStr[i];
  745|  2.59k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 91, False: 2.50k]
  ------------------
  746|     91|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 17, False: 74]
  |  Branch (746:23): [True: 18, False: 56]
  |  Branch (746:36): [True: 28, False: 28]
  |  Branch (746:49): [True: 8, False: 20]
  ------------------
  747|     20|					nameIsUUID = false;
  748|     20|					break;
  749|  2.50k|				} else {
  750|  2.50k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 2.46k, False: 41]
  |  Branch (750:27): [True: 640, False: 1.82k]
  |  Branch (750:44): [True: 1.71k, False: 148]
  |  Branch (750:59): [True: 1.70k, False: 14]
  ------------------
  751|    162|					nameIsUUID = false;
  752|    162|					break;
  753|  2.50k|				}
  754|  2.59k|			}
  755|       |
  756|    199|		}
  757|       |		
  758|    553|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 196, False: 357]
  ------------------
  759|       |
  760|    196|			XMP_ExpandedXPath expPath;
  761|    196|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|    196|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|    196|#define kXMP_CreateNodes	true
  ------------------
  763|    196|			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: 196]
  ------------------
  764|       |
  765|    196|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|    196|			idNode->value = tree.name;
  767|    196|			idNode->RemoveChildren();
  768|    196|			idNode->RemoveQualifiers();
  769|       |
  770|    196|			tree.name.erase();
  771|       |
  772|    196|		}
  773|       |
  774|    553|	}
  775|       |
  776|  4.77k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  23.8k|{
  610|  23.8k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  23.8k|#define kXMP_ExistingOnly	false
  ------------------
  611|  23.8k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 20.0k, False: 3.77k]
  ------------------
  612|       |	
  613|  3.77k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.77k|#define kXMP_ExistingOnly	false
  ------------------
  614|  3.77k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 3.13k, False: 640]
  |  Branch (614:27): [True: 583, False: 57]
  ------------------
  615|       |	
  616|     57|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 0, False: 57]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     57|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|    521|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 464, False: 57]
  ------------------
  622|       |
  623|    464|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|    464|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 22, False: 442]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     22|			delete ( currChild );
  629|     22|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|    442|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 92, False: 350]
  ------------------
  632|       |		
  633|     92|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 5, False: 87]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|      5|				delete ( currChild );
  637|      5|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|     87|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|     87|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|     87|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 84, False: 3]
  ------------------
  644|     84|					currChild->qualifiers.push_back ( repairLang );
  645|     84|				} else {
  646|      3|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|      3|				}
  648|     87|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|     87|			}
  651|       |
  652|     92|		}
  653|       |
  654|    464|	}
  655|       |
  656|     57|}	// RepairAltText

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

