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

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

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

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

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

_ZN5Exiv28ExifData5beginEv:
  438|  12.4k|  iterator begin() {
  439|  12.4k|    return exifMetadata_.begin();
  440|  12.4k|  }
_ZN5Exiv28ExifData3endEv:
  442|   508k|  iterator end() {
  443|   508k|    return exifMetadata_.end();
  444|   508k|  }
_ZNK5Exiv28ExifData5beginEv:
  455|  5.78k|  [[nodiscard]] const_iterator begin() const {
  456|  5.78k|    return exifMetadata_.begin();
  457|  5.78k|  }
_ZNK5Exiv28ExifData3endEv:
  459|  1.16M|  [[nodiscard]] const_iterator end() const {
  460|  1.16M|    return exifMetadata_.end();
  461|  1.16M|  }
_ZNK5Exiv28ExifData5emptyEv:
  468|  2.97k|  [[nodiscard]] bool empty() const {
  469|  2.97k|    return exifMetadata_.empty();
  470|  2.97k|  }

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  4.12M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  8.57M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|  74.4k|  Key(const Key&) = default;

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

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  158|  5.80M|  [[nodiscard]] auto begin() noexcept {
  159|  5.80M|    return pData_.begin();
  160|  5.80M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  2.34k|  [[nodiscard]] auto end() noexcept {
  163|  2.34k|    return pData_.end();
  164|  2.34k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  17.1k|  [[nodiscard]] auto begin() const noexcept {
  167|  17.1k|    return pData_.begin();
  168|  17.1k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  17.2k|  [[nodiscard]] auto end() const noexcept {
  171|  17.2k|    return pData_.end();
  172|  17.2k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  1.68M|  [[nodiscard]] size_t size() const {
  175|  1.68M|    return pData_.size();
  176|  1.68M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  24.5k|  [[nodiscard]] bool empty() const {
  208|  24.5k|    return pData_.empty();
  209|  24.5k|  }
_ZN5Exiv27DataBufC2Ev:
  126|   783k|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  9.07k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  54.1k|const T* find(T (&src)[N], const K& key) {
  461|  54.1k|  static_assert(N > 0, "Passed zero length find");
  462|  54.1k|  auto rc = std::find(src, src + N, key);
  463|  54.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 54.1k]
  ------------------
  464|  54.1k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   108k|std::string toString(const T& arg) {
  480|   108k|  return toStringHelper(arg, std::is_integral<T>());
  481|   108k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   108k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   108k|  return std::to_string(arg);
  470|   108k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  4.84M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  4.84M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 3.01M, False: 1.83M]
  ------------------
  242|  3.01M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|  3.01M|  }
  244|  1.83M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  4.84M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|  25.8k|const T* find(T (&src)[N], const K& key) {
  461|  25.8k|  static_assert(N > 0, "Passed zero length find");
  462|  25.8k|  auto rc = std::find(src, src + N, key);
  463|  25.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 22.4k, False: 3.48k]
  ------------------
  464|  25.8k|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  4.69k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  2.31k|const T* find(T (&src)[N], const K& key) {
  461|  2.31k|  static_assert(N > 0, "Passed zero length find");
  462|  2.31k|  auto rc = std::find(src, src + N, key);
  463|  2.31k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.97k, False: 338]
  ------------------
  464|  2.31k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|  72.9k|const T* find(T (&src)[N], const K& key) {
  461|  72.9k|  static_assert(N > 0, "Passed zero length find");
  462|  72.9k|  auto rc = std::find(src, src + N, key);
  463|  72.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 59.6k, False: 13.2k]
  ------------------
  464|  72.9k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|  1.40M|const T* find(T (&src)[N], const K& key) {
  461|  1.40M|  static_assert(N > 0, "Passed zero length find");
  462|  1.40M|  auto rc = std::find(src, src + N, key);
  463|  1.40M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 37, False: 1.40M]
  ------------------
  464|  1.40M|}
_ZN5Exiv24findIKNS_8mimeTypeEiLm6EEEPKT_RAT1__S3_RKT0_:
  460|    132|const T* find(T (&src)[N], const K& key) {
  461|    132|  static_assert(N > 0, "Passed zero length find");
  462|    132|  auto rc = std::find(src, src + N, key);
  463|    132|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 124, False: 8]
  ------------------
  464|    132|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  3.79M|const T* find(T (&src)[N], const K& key) {
  461|  3.79M|  static_assert(N > 0, "Passed zero length find");
  462|  3.79M|  auto rc = std::find(src, src + N, key);
  463|  3.79M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 965k, False: 2.83M]
  ------------------
  464|  3.79M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    197|T stringTo(const std::string& s, bool& ok) {
  496|    197|  std::istringstream is(s);
  497|    197|  T tmp = T();
  498|    197|  ok = static_cast<bool>(is >> tmp);
  499|    197|  std::string rest;
  500|    197|  is >> std::skipws >> rest;
  501|    197|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 52, False: 145]
  ------------------
  502|     52|    ok = false;
  503|    197|  return tmp;
  504|    197|}
_ZN5Exiv28stringToIdEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    172|T stringTo(const std::string& s, bool& ok) {
  496|    172|  std::istringstream is(s);
  497|    172|  T tmp = T();
  498|    172|  ok = static_cast<bool>(is >> tmp);
  499|    172|  std::string rest;
  500|    172|  is >> std::skipws >> rest;
  501|    172|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 44, False: 128]
  ------------------
  502|     44|    ok = false;
  503|    172|  return tmp;
  504|    172|}
_ZN5Exiv28stringToINSt3__14pairIiiEEEET_RKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERb:
  495|    169|T stringTo(const std::string& s, bool& ok) {
  496|    169|  std::istringstream is(s);
  497|    169|  T tmp = T();
  498|    169|  ok = static_cast<bool>(is >> tmp);
  499|    169|  std::string rest;
  500|    169|  is >> std::skipws >> rest;
  501|    169|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 49, False: 120]
  ------------------
  502|     49|    ok = false;
  503|    169|  return tmp;
  504|    169|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  20.9k|std::string toString(const T& arg) {
  480|  20.9k|  return toStringHelper(arg, std::is_integral<T>());
  481|  20.9k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  20.9k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  20.9k|  return std::to_string(arg);
  470|  20.9k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.52k|std::string toString(const T& arg) {
  480|  1.52k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.52k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  1.52k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  1.52k|  return std::to_string(arg);
  470|  1.52k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   186k|std::string toString(const T& arg) {
  480|   186k|  return toStringHelper(arg, std::is_integral<T>());
  481|   186k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   186k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   186k|  return std::to_string(arg);
  470|   186k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  4.02k|std::string toString(const T& arg) {
  480|  4.02k|  return toStringHelper(arg, std::is_integral<T>());
  481|  4.02k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  4.02k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  4.02k|  std::ostringstream os;
  475|  4.02k|  os << arg;
  476|  4.02k|  return os.str();
  477|  4.02k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   175k|std::string toString(const T& arg) {
  480|   175k|  return toStringHelper(arg, std::is_integral<T>());
  481|   175k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   175k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   175k|  std::ostringstream os;
  475|   175k|  os << arg;
  476|   175k|  return os.str();
  477|   175k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  13.8k|std::string toString(const T& arg) {
  480|  13.8k|  return toStringHelper(arg, std::is_integral<T>());
  481|  13.8k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  13.8k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  13.8k|  return std::to_string(arg);
  470|  13.8k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|  2.70k|const T* find(T (&src)[N], const K& key) {
  461|  2.70k|  static_assert(N > 0, "Passed zero length find");
  462|  2.70k|  auto rc = std::find(src, src + N, key);
  463|  2.70k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.33k, False: 1.37k]
  ------------------
  464|  2.70k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.87k|const T* find(T (&src)[N], const K& key) {
  461|  1.87k|  static_assert(N > 0, "Passed zero length find");
  462|  1.87k|  auto rc = std::find(src, src + N, key);
  463|  1.87k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 539, False: 1.33k]
  ------------------
  464|  1.87k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|    577|const T* find(T (&src)[N], const K& key) {
  461|    577|  static_assert(N > 0, "Passed zero length find");
  462|    577|  auto rc = std::find(src, src + N, key);
  463|    577|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 279, False: 298]
  ------------------
  464|    577|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|  79.6k|const T* find(T (&src)[N], const K& key) {
  461|  79.6k|  static_assert(N > 0, "Passed zero length find");
  462|  79.6k|  auto rc = std::find(src, src + N, key);
  463|  79.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.74k, False: 77.9k]
  ------------------
  464|  79.6k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  3.38k|const T* find(T (&src)[N], const K& key) {
  461|  3.38k|  static_assert(N > 0, "Passed zero length find");
  462|  3.38k|  auto rc = std::find(src, src + N, key);
  463|  3.38k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.44k, False: 943]
  ------------------
  464|  3.38k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  13.7k|const T* find(T (&src)[N], const K& key) {
  461|  13.7k|  static_assert(N > 0, "Passed zero length find");
  462|  13.7k|  auto rc = std::find(src, src + N, key);
  463|  13.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 9.19k, False: 4.57k]
  ------------------
  464|  13.7k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  6.13k|const T* find(T (&src)[N], const K& key) {
  461|  6.13k|  static_assert(N > 0, "Passed zero length find");
  462|  6.13k|  auto rc = std::find(src, src + N, key);
  463|  6.13k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.95k, False: 2.18k]
  ------------------
  464|  6.13k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  3.50k|std::string toString(const T& arg) {
  480|  3.50k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.50k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  3.50k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  3.50k|  std::ostringstream os;
  475|  3.50k|  os << arg;
  476|  3.50k|  return os.str();
  477|  3.50k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.45k|std::string toString(const T& arg) {
  480|  1.45k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.45k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  1.45k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  1.45k|  return std::to_string(arg);
  470|  1.45k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   603k|std::string toString(const T& arg) {
  480|   603k|  return toStringHelper(arg, std::is_integral<T>());
  481|   603k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   603k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   603k|  std::ostringstream os;
  475|   603k|  os << arg;
  476|   603k|  return os.str();
  477|   603k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.21k|const T* find(T (&src)[N], const K& key) {
  461|  1.21k|  static_assert(N > 0, "Passed zero length find");
  462|  1.21k|  auto rc = std::find(src, src + N, key);
  463|  1.21k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 640, False: 574]
  ------------------
  464|  1.21k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  9.84k|const T* find(T (&src)[N], const K& key) {
  461|  9.84k|  static_assert(N > 0, "Passed zero length find");
  462|  9.84k|  auto rc = std::find(src, src + N, key);
  463|  9.84k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.99k, False: 3.84k]
  ------------------
  464|  9.84k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  9.84k|const T* find(T (&src)[N], const K& key) {
  461|  9.84k|  static_assert(N > 0, "Passed zero length find");
  462|  9.84k|  auto rc = std::find(src, src + N, key);
  463|  9.84k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 8.98k, False: 854]
  ------------------
  464|  9.84k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  460|   107k|const T* find(T (&src)[N], const K& key) {
  461|   107k|  static_assert(N > 0, "Passed zero length find");
  462|   107k|  auto rc = std::find(src, src + N, key);
  463|   107k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 87.8k, False: 19.3k]
  ------------------
  464|   107k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  33.3k|const T* find(T (&src)[N], const K& key) {
  461|  33.3k|  static_assert(N > 0, "Passed zero length find");
  462|  33.3k|  auto rc = std::find(src, src + N, key);
  463|  33.3k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 10.4k, False: 22.8k]
  ------------------
  464|  33.3k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  5.36k|const T* find(T (&src)[N], const K& key) {
  461|  5.36k|  static_assert(N > 0, "Passed zero length find");
  462|  5.36k|  auto rc = std::find(src, src + N, key);
  463|  5.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.74k, False: 620]
  ------------------
  464|  5.36k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  5.33k|const T* find(T (&src)[N], const K& key) {
  461|  5.33k|  static_assert(N > 0, "Passed zero length find");
  462|  5.33k|  auto rc = std::find(src, src + N, key);
  463|  5.33k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.88k, False: 1.45k]
  ------------------
  464|  5.33k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|    584|const T* find(T (&src)[N], const K& key) {
  461|    584|  static_assert(N > 0, "Passed zero length find");
  462|    584|  auto rc = std::find(src, src + N, key);
  463|    584|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 111, False: 473]
  ------------------
  464|    584|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   189k|const T* find(T (&src)[N], const K& key) {
  461|   189k|  static_assert(N > 0, "Passed zero length find");
  462|   189k|  auto rc = std::find(src, src + N, key);
  463|   189k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 158k, False: 31.0k]
  ------------------
  464|   189k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|   101k|const T* find(T (&src)[N], const K& key) {
  461|   101k|  static_assert(N > 0, "Passed zero length find");
  462|   101k|  auto rc = std::find(src, src + N, key);
  463|   101k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 97.8k, False: 4.13k]
  ------------------
  464|   101k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  5.67k|const T* find(T (&src)[N], const K& key) {
  461|  5.67k|  static_assert(N > 0, "Passed zero length find");
  462|  5.67k|  auto rc = std::find(src, src + N, key);
  463|  5.67k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.27k, False: 4.40k]
  ------------------
  464|  5.67k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  1.98k|const T* find(T (&src)[N], const K& key) {
  461|  1.98k|  static_assert(N > 0, "Passed zero length find");
  462|  1.98k|  auto rc = std::find(src, src + N, key);
  463|  1.98k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 383, False: 1.59k]
  ------------------
  464|  1.98k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  7.28M|const T* find(T (&src)[N], const K& key) {
  461|  7.28M|  static_assert(N > 0, "Passed zero length find");
  462|  7.28M|  auto rc = std::find(src, src + N, key);
  463|  7.28M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 7.28M]
  ------------------
  464|  7.28M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  3.23M|const T* find(T (&src)[N], const K& key) {
  461|  3.23M|  static_assert(N > 0, "Passed zero length find");
  462|  3.23M|  auto rc = std::find(src, src + N, key);
  463|  3.23M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 3.23M]
  ------------------
  464|  3.23M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  1.74M|const T* find(T (&src)[N], const K& key) {
  461|  1.74M|  static_assert(N > 0, "Passed zero length find");
  462|  1.74M|  auto rc = std::find(src, src + N, key);
  463|  1.74M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.72M, False: 19.1k]
  ------------------
  464|  1.74M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  13.4k|const T* find(T (&src)[N], const K& key) {
  461|  13.4k|  static_assert(N > 0, "Passed zero length find");
  462|  13.4k|  auto rc = std::find(src, src + N, key);
  463|  13.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.64k, False: 7.80k]
  ------------------
  464|  13.4k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|    509|const T* find(T (&src)[N], const K& key) {
  461|    509|  static_assert(N > 0, "Passed zero length find");
  462|    509|  auto rc = std::find(src, src + N, key);
  463|    509|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 117, False: 392]
  ------------------
  464|    509|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     31|T stringTo(const std::string& s, bool& ok) {
  496|     31|  std::istringstream is(s);
  497|     31|  T tmp = T();
  498|     31|  ok = static_cast<bool>(is >> tmp);
  499|     31|  std::string rest;
  500|     31|  is >> std::skipws >> rest;
  501|     31|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 22, False: 9]
  ------------------
  502|     22|    ok = false;
  503|     31|  return tmp;
  504|     31|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|     51|const T* find(T (&src)[N], const K& key) {
  461|     51|  static_assert(N > 0, "Passed zero length find");
  462|     51|  auto rc = std::find(src, src + N, key);
  463|     51|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 51, False: 0]
  ------------------
  464|     51|}

_ZNK5Exiv25Value6typeIdEv:
   85|  4.30M|  TypeId typeId() const {
   86|  4.30M|    return type_;
   87|  4.30M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  4.23M|  UniquePtr clone() const {
   94|  4.23M|    return UniquePtr(clone_());
   95|  4.23M|  }
_ZNK5Exiv25Value2okEv:
  181|  5.68k|  bool ok() const {
  182|  5.68k|    return ok_;
  183|  5.68k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  38.9k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  38.9k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 18.3k, False: 20.5k]
  ------------------
  797|  18.3k|      return str1.size() > str2.size();
  798|       |
  799|  20.5k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  20.5k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  38.9k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   556k|inline TypeId getType<uint16_t>() {
 1084|   556k|  return unsignedShort;
 1085|   556k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  4.06k|inline TypeId getType<uint32_t>() {
 1089|  4.06k|  return unsignedLong;
 1090|  4.06k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  9.02k|inline TypeId getType<URational>() {
 1094|  9.02k|  return unsignedRational;
 1095|  9.02k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  17.4k|inline TypeId getType<int16_t>() {
 1099|  17.4k|  return signedShort;
 1100|  17.4k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  7.58k|inline TypeId getType<int32_t>() {
 1104|  7.58k|  return signedLong;
 1105|  7.58k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  3.64k|inline TypeId getType<Rational>() {
 1109|  3.64k|  return signedRational;
 1110|  3.64k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  3.61k|inline TypeId getType<float>() {
 1114|  3.61k|  return tiffFloat;
 1115|  3.61k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  5.91k|inline TypeId getType<double>() {
 1119|  5.91k|  return tiffDouble;
 1120|  5.91k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.88M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.88M|  return getUShort(buf, byteOrder);
 1316|  1.88M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  1.06M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  1.06M|  return getULong(buf, byteOrder);
 1321|  1.06M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|  1.43M|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|  1.43M|  return getURational(buf, byteOrder);
 1326|  1.43M|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   420k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   420k|  return getShort(buf, byteOrder);
 1331|   420k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   302k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   302k|  return getLong(buf, byteOrder);
 1336|   302k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   287k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   287k|  return getRational(buf, byteOrder);
 1341|   287k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|   788k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|   788k|  return getFloat(buf, byteOrder);
 1346|   788k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   226k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   226k|  return getDouble(buf, byteOrder);
 1351|   226k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  19.5k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  19.5k|  return us2Data(buf, t, byteOrder);
 1374|  19.5k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  63.4k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  63.4k|  return ul2Data(buf, t, byteOrder);
 1382|  63.4k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   798k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   798k|  return ur2Data(buf, t, byteOrder);
 1390|   798k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  17.4k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  17.4k|  return s2Data(buf, t, byteOrder);
 1398|  17.4k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   108k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   108k|  return l2Data(buf, t, byteOrder);
 1406|   108k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  44.6k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  44.6k|  return r2Data(buf, t, byteOrder);
 1414|  44.6k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  98.6k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  98.6k|  return f2Data(buf, t, byteOrder);
 1422|  98.6k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|  3.06k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|  3.06k|  return d2Data(buf, t, byteOrder);
 1430|  3.06k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.50k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.50k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.50k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  6.96k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  6.96k|  return float_to_integer_helper<uint32_t>(n);
 1555|  6.96k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  1.49k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  1.49k|  return float_to_integer_helper<int64_t>(n);
 1560|  1.49k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  4.28k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  4.28k|  return float_to_integer_helper<uint32_t>(n);
 1564|  4.28k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  2.00k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  2.00k|  return rational_to_integer_helper<int64_t>(n);
 1569|  2.00k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  7.15k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  7.15k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  7.15k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  3.68k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  3.68k|  return rational_to_integer_helper<int64_t>(n);
 1578|  3.68k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  7.41k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  7.41k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  7.41k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.50k|  I float_to_integer_helper(size_t n) const {
 1213|  1.50k|    const auto v = value_.at(n);
 1214|  1.50k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.18k, False: 322]
  ------------------
 1215|  1.18k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 713, False: 467]
  ------------------
 1216|    713|      return static_cast<I>(std::lround(v));
 1217|    713|    }
 1218|    789|    return 0;
 1219|  1.50k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  6.96k|  I float_to_integer_helper(size_t n) const {
 1213|  6.96k|    const auto v = value_.at(n);
 1214|  6.96k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.82k, False: 1.14k]
  ------------------
 1215|  5.82k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 4.15k, False: 1.66k]
  ------------------
 1216|  4.15k|      return static_cast<I>(std::lround(v));
 1217|  4.15k|    }
 1218|  2.81k|    return 0;
 1219|  6.96k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  1.49k|  I float_to_integer_helper(size_t n) const {
 1213|  1.49k|    const auto v = value_.at(n);
 1214|  1.49k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.27k, False: 223]
  ------------------
 1215|  1.27k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 973, False: 301]
  ------------------
 1216|    973|      return static_cast<I>(std::lround(v));
 1217|    973|    }
 1218|    524|    return 0;
 1219|  1.49k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  4.28k|  I float_to_integer_helper(size_t n) const {
 1213|  4.28k|    const auto v = value_.at(n);
 1214|  4.28k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.71k, False: 571]
  ------------------
 1215|  3.71k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.15k, False: 566]
  ------------------
 1216|  3.15k|      return static_cast<I>(std::lround(v));
 1217|  3.15k|    }
 1218|  1.13k|    return 0;
 1219|  4.28k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  2.00k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.00k|    auto a = value_.at(n).first;
 1225|  2.00k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.00k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 544, False: 1.45k]
  ------------------
 1229|    544|      return 0;
 1230|    544|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.45k|#ifdef __cpp_if_constexpr
 1234|  1.45k|    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.45k|      const auto imin = std::numeric_limits<I>::min();
 1240|  1.45k|      const auto imax = std::numeric_limits<I>::max();
 1241|  1.45k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 1.45k]
  |  Branch (1241:23): [True: 0, False: 1.45k]
  |  Branch (1241:35): [True: 0, False: 1.45k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  1.45k|#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.45k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.00k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  7.15k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.15k|    auto a = value_.at(n).first;
 1225|  7.15k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.15k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.21k, False: 5.94k]
  ------------------
 1229|  1.21k|      return 0;
 1230|  1.21k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.94k|#ifdef __cpp_if_constexpr
 1234|       |    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|       |      const auto imin = std::numeric_limits<I>::min();
 1240|       |      const auto imax = std::numeric_limits<I>::max();
 1241|       |      if (imax < b || a < imin || imax < a) {
 1242|       |        return 0;
 1243|       |      }
 1244|       |#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|  5.94k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  5.94k|      const auto imax = std::numeric_limits<I>::max();
 1257|  5.94k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 471, False: 5.47k]
  ------------------
 1258|    471|        return 0;
 1259|    471|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  5.47k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  5.47k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  5.47k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 5.47k]
  |  Branch (1263:25): [True: 0, False: 5.47k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  5.47k|    }
 1267|       |
 1268|  5.47k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.15k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  3.68k|  I rational_to_integer_helper(size_t n) const {
 1224|  3.68k|    auto a = value_.at(n).first;
 1225|  3.68k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  3.68k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 493, False: 3.18k]
  ------------------
 1229|    493|      return 0;
 1230|    493|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  3.18k|#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|  3.18k|    } 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|  3.18k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  3.18k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 3.18k]
  |  Branch (1251:23): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  3.68k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  7.41k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.41k|    auto a = value_.at(n).first;
 1225|  7.41k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.41k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.77k, False: 5.63k]
  ------------------
 1229|  1.77k|      return 0;
 1230|  1.77k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.63k|#ifdef __cpp_if_constexpr
 1234|  5.63k|    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|  5.63k|      const auto imin = std::numeric_limits<I>::min();
 1240|  5.63k|      const auto imax = std::numeric_limits<I>::max();
 1241|  5.63k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 5.63k]
  |  Branch (1241:23): [True: 0, False: 5.63k]
  |  Branch (1241:35): [True: 0, False: 5.63k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  5.63k|#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|  5.63k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.41k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   556k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   556k|}
_ZN5Exiv25ValueD2Ev:
   43|  6.08M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   554k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   554k|  value_.clear();
 1469|   554k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   554k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 554k, False: 0]
  |  Branch (1470:17): [True: 626, False: 553k]
  ------------------
 1471|    626|    len = (len / ts) * ts;
 1472|  2.44M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.88M, False: 554k]
  ------------------
 1473|  1.88M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.88M|  }
 1475|   554k|  return 0;
 1476|   554k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  2.11k|int ValueType<T>::read(const std::string& buf) {
 1480|  2.11k|  std::istringstream is(buf);
 1481|  2.11k|  T tmp;
 1482|  2.11k|  ValueList val;
 1483|  10.5k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 8.47k, False: 2.11k]
  ------------------
 1484|  8.47k|    val.push_back(tmp);
 1485|  2.11k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 2.11k]
  ------------------
 1486|      0|    return 1;
 1487|  2.11k|  value_ = std::move(val);
 1488|  2.11k|  return 0;
 1489|  2.11k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.93k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.93k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.49k, False: 441]
  ------------------
 1651|  1.49k|    pDataArea_ = Blob(buf, buf + len);
 1652|    441|  else
 1653|    441|    pDataArea_.clear();
 1654|  1.93k|  return 0;
 1655|  1.93k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  5.95k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.95k|  size_t offset = 0;
 1494|  19.5k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 19.5k, False: 5.95k]
  ------------------
 1495|  19.5k|    offset += toData(buf + offset, val, byteOrder);
 1496|  19.5k|  }
 1497|  5.95k|  return offset;
 1498|  5.95k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|  1.87M|size_t ValueType<T>::count() const {
 1502|  1.87M|  return value_.size();
 1503|  1.87M|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  13.6k|size_t ValueType<T>::size() const {
 1507|  13.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  13.6k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    623|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    623|  auto end = value_.end();
 1518|    623|  auto i = value_.begin();
 1519|  3.70k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 3.08k, False: 623]
  ------------------
 1520|  3.08k|    os << std::setprecision(15) << *i;
 1521|  3.08k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 2.66k, False: 417]
  ------------------
 1522|  2.66k|      os << " ";
 1523|  3.08k|  }
 1524|    623|  return os;
 1525|    623|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  1.27M|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  1.27M|  ok_ = true;
 1537|  1.27M|  return static_cast<int64_t>(value_.at(n));
 1538|  1.27M|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|  1.29M|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  1.29M|  ok_ = true;
 1542|  1.29M|  return static_cast<uint32_t>(value_.at(n));
 1543|  1.29M|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  6.12k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.12k|  return pDataArea_.size();
 1641|  6.12k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    803|DataBuf ValueType<T>::dataArea() const {
 1645|    803|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    803|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|  1.13M|ValueType<T>* ValueType<T>::clone_() const {
 1512|  1.13M|  return new ValueType<T>(*this);
 1513|  1.13M|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|  1.13M|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  1.13M|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 4.17k, False: 1.12M]
  ------------------
 1449|  4.17k|    pDataArea_ = rhs.pDataArea_;
 1450|  1.13M|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  2.54M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|   184k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   184k|  value_.clear();
 1469|   184k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   184k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 184k, False: 0]
  |  Branch (1470:17): [True: 60, False: 184k]
  ------------------
 1471|     60|    len = (len / ts) * ts;
 1472|  1.24M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.06M, False: 184k]
  ------------------
 1473|  1.06M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.06M|  }
 1475|   184k|  return 0;
 1476|   184k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    876|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    876|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 473, False: 403]
  ------------------
 1651|    473|    pDataArea_ = Blob(buf, buf + len);
 1652|    403|  else
 1653|    403|    pDataArea_.clear();
 1654|    876|  return 0;
 1655|    876|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  21.0k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  21.0k|  size_t offset = 0;
 1494|  63.4k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 63.4k, False: 21.0k]
  ------------------
 1495|  63.4k|    offset += toData(buf + offset, val, byteOrder);
 1496|  63.4k|  }
 1497|  21.0k|  return offset;
 1498|  21.0k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   257k|size_t ValueType<T>::count() const {
 1502|   257k|  return value_.size();
 1503|   257k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  43.8k|size_t ValueType<T>::size() const {
 1507|  43.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  43.8k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  5.87k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  5.87k|  auto end = value_.end();
 1518|  5.87k|  auto i = value_.begin();
 1519|  1.03M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.02M, False: 5.87k]
  ------------------
 1520|  1.02M|    os << std::setprecision(15) << *i;
 1521|  1.02M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.02M, False: 5.61k]
  ------------------
 1522|  1.02M|      os << " ";
 1523|  1.02M|  }
 1524|  5.87k|  return os;
 1525|  5.87k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  37.6k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  37.6k|  ok_ = true;
 1537|  37.6k|  return static_cast<int64_t>(value_.at(n));
 1538|  37.6k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  41.4k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  41.4k|  ok_ = true;
 1542|  41.4k|  return static_cast<uint32_t>(value_.at(n));
 1543|  41.4k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  5.37k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.37k|  return pDataArea_.size();
 1641|  5.37k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    316|DataBuf ValueType<T>::dataArea() const {
 1645|    316|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    316|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   419k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   419k|  return new ValueType<T>(*this);
 1513|   419k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   419k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   419k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.36k, False: 418k]
  ------------------
 1449|  1.36k|    pDataArea_ = rhs.pDataArea_;
 1450|   419k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  9.02k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  9.02k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  8.98k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.98k|  value_.clear();
 1469|  8.98k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.98k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.98k, False: 0]
  |  Branch (1470:17): [True: 0, False: 8.98k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  1.43M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.43M, False: 8.98k]
  ------------------
 1473|  1.43M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.43M|  }
 1475|  8.98k|  return 0;
 1476|  8.98k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    854|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    854|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 426, False: 428]
  ------------------
 1651|    426|    pDataArea_ = Blob(buf, buf + len);
 1652|    428|  else
 1653|    428|    pDataArea_.clear();
 1654|    854|  return 0;
 1655|    854|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  2.29k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.29k|  size_t offset = 0;
 1494|   798k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 798k, False: 2.29k]
  ------------------
 1495|   798k|    offset += toData(buf + offset, val, byteOrder);
 1496|   798k|  }
 1497|  2.29k|  return offset;
 1498|  2.29k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  25.7k|size_t ValueType<T>::count() const {
 1502|  25.7k|  return value_.size();
 1503|  25.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  5.82k|size_t ValueType<T>::size() const {
 1507|  5.82k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  5.82k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    718|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    718|  auto end = value_.end();
 1518|    718|  auto i = value_.begin();
 1519|  6.18k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.46k, False: 718]
  ------------------
 1520|  5.46k|    os << std::setprecision(15) << *i;
 1521|  5.46k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.94k, False: 521]
  ------------------
 1522|  4.94k|      os << " ";
 1523|  5.46k|  }
 1524|    718|  return os;
 1525|    718|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  2.01k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.01k|  return pDataArea_.size();
 1641|  2.01k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|     12|DataBuf ValueType<T>::dataArea() const {
 1645|     12|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     12|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  27.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  27.3k|  return new ValueType<T>(*this);
 1513|  27.3k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  27.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  27.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.09k, False: 26.3k]
  ------------------
 1449|  1.09k|    pDataArea_ = rhs.pDataArea_;
 1450|  27.3k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  17.4k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  17.4k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  8.92k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.92k|  value_.clear();
 1469|  8.92k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.92k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.92k, False: 0]
  |  Branch (1470:17): [True: 61, False: 8.86k]
  ------------------
 1471|     61|    len = (len / ts) * ts;
 1472|   429k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 420k, False: 8.92k]
  ------------------
 1473|   420k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   420k|  }
 1475|  8.92k|  return 0;
 1476|  8.92k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  8.50k|int ValueType<T>::read(const std::string& buf) {
 1480|  8.50k|  std::istringstream is(buf);
 1481|  8.50k|  T tmp;
 1482|  8.50k|  ValueList val;
 1483|   367k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 358k, False: 8.50k]
  ------------------
 1484|   358k|    val.push_back(tmp);
 1485|  8.50k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 8.50k]
  ------------------
 1486|      0|    return 1;
 1487|  8.50k|  value_ = std::move(val);
 1488|  8.50k|  return 0;
 1489|  8.50k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|  1.51k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.51k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.13k, False: 378]
  ------------------
 1651|  1.13k|    pDataArea_ = Blob(buf, buf + len);
 1652|    378|  else
 1653|    378|    pDataArea_.clear();
 1654|  1.51k|  return 0;
 1655|  1.51k|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  5.00k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.00k|  size_t offset = 0;
 1494|  17.4k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 17.4k, False: 5.00k]
  ------------------
 1495|  17.4k|    offset += toData(buf + offset, val, byteOrder);
 1496|  17.4k|  }
 1497|  5.00k|  return offset;
 1498|  5.00k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  27.6k|size_t ValueType<T>::count() const {
 1502|  27.6k|  return value_.size();
 1503|  27.6k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  10.3k|size_t ValueType<T>::size() const {
 1507|  10.3k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  10.3k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    649|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    649|  auto end = value_.end();
 1518|    649|  auto i = value_.begin();
 1519|   531k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 531k, False: 649]
  ------------------
 1520|   531k|    os << std::setprecision(15) << *i;
 1521|   531k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 530k, False: 334]
  ------------------
 1522|   530k|      os << " ";
 1523|   531k|  }
 1524|    649|  return os;
 1525|    649|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|    801|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|    801|  ok_ = true;
 1537|    801|  return static_cast<int64_t>(value_.at(n));
 1538|    801|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  11.3k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  11.3k|  ok_ = true;
 1542|  11.3k|  return static_cast<uint32_t>(value_.at(n));
 1543|  11.3k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  3.86k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.86k|  return pDataArea_.size();
 1641|  3.86k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    758|DataBuf ValueType<T>::dataArea() const {
 1645|    758|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    758|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  40.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  40.2k|  return new ValueType<T>(*this);
 1513|  40.2k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  40.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  40.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.81k, False: 37.4k]
  ------------------
 1449|  2.81k|    pDataArea_ = rhs.pDataArea_;
 1450|  40.2k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  7.58k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.58k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  7.58k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  7.58k|  value_.clear();
 1469|  7.58k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  7.58k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 7.58k, False: 0]
  |  Branch (1470:17): [True: 74, False: 7.51k]
  ------------------
 1471|     74|    len = (len / ts) * ts;
 1472|   310k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 302k, False: 7.58k]
  ------------------
 1473|   302k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   302k|  }
 1475|  7.58k|  return 0;
 1476|  7.58k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    649|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    649|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 340, False: 309]
  ------------------
 1651|    340|    pDataArea_ = Blob(buf, buf + len);
 1652|    309|  else
 1653|    309|    pDataArea_.clear();
 1654|    649|  return 0;
 1655|    649|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  2.97k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  2.97k|  size_t offset = 0;
 1494|   108k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 108k, False: 2.97k]
  ------------------
 1495|   108k|    offset += toData(buf + offset, val, byteOrder);
 1496|   108k|  }
 1497|  2.97k|  return offset;
 1498|  2.97k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  18.0k|size_t ValueType<T>::count() const {
 1502|  18.0k|  return value_.size();
 1503|  18.0k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|  6.38k|size_t ValueType<T>::size() const {
 1507|  6.38k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  6.38k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    695|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    695|  auto end = value_.end();
 1518|    695|  auto i = value_.begin();
 1519|  71.2k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 70.5k, False: 695]
  ------------------
 1520|  70.5k|    os << std::setprecision(15) << *i;
 1521|  70.5k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 70.0k, False: 491]
  ------------------
 1522|  70.0k|      os << " ";
 1523|  70.5k|  }
 1524|    695|  return os;
 1525|    695|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  1.20k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  1.20k|  ok_ = true;
 1537|  1.20k|  return static_cast<int64_t>(value_.at(n));
 1538|  1.20k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  4.79k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  4.79k|  ok_ = true;
 1542|  4.79k|  return static_cast<uint32_t>(value_.at(n));
 1543|  4.79k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  1.89k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.89k|  return pDataArea_.size();
 1641|  1.89k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    265|DataBuf ValueType<T>::dataArea() const {
 1645|    265|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    265|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  23.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  23.8k|  return new ValueType<T>(*this);
 1513|  23.8k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  23.8k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  23.8k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.14k, False: 22.6k]
  ------------------
 1449|  1.14k|    pDataArea_ = rhs.pDataArea_;
 1450|  23.8k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  3.64k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.64k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  3.64k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  3.64k|  value_.clear();
 1469|  3.64k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  3.64k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 3.64k, False: 0]
  |  Branch (1470:17): [True: 0, False: 3.64k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   291k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 287k, False: 3.64k]
  ------------------
 1473|   287k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   287k|  }
 1475|  3.64k|  return 0;
 1476|  3.64k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    437|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    437|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 203, False: 234]
  ------------------
 1651|    203|    pDataArea_ = Blob(buf, buf + len);
 1652|    234|  else
 1653|    234|    pDataArea_.clear();
 1654|    437|  return 0;
 1655|    437|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  1.84k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.84k|  size_t offset = 0;
 1494|  44.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 44.6k, False: 1.84k]
  ------------------
 1495|  44.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  44.6k|  }
 1497|  1.84k|  return offset;
 1498|  1.84k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  12.1k|size_t ValueType<T>::count() const {
 1502|  12.1k|  return value_.size();
 1503|  12.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  4.26k|size_t ValueType<T>::size() const {
 1507|  4.26k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  4.26k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    656|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    656|  auto end = value_.end();
 1518|    656|  auto i = value_.begin();
 1519|  2.07k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.41k, False: 656]
  ------------------
 1520|  1.41k|    os << std::setprecision(15) << *i;
 1521|  1.41k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 957, False: 459]
  ------------------
 1522|    957|      os << " ";
 1523|  1.41k|  }
 1524|    656|  return os;
 1525|    656|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|    486|size_t ValueType<T>::sizeDataArea() const {
 1640|    486|  return pDataArea_.size();
 1641|    486|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     11|DataBuf ValueType<T>::dataArea() const {
 1645|     11|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     11|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  12.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  12.7k|  return new ValueType<T>(*this);
 1513|  12.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  12.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  12.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 127, False: 12.6k]
  ------------------
 1449|    127|    pDataArea_ = rhs.pDataArea_;
 1450|  12.7k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  3.61k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.61k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  3.61k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  3.61k|  value_.clear();
 1469|  3.61k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  3.61k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 3.61k, False: 0]
  |  Branch (1470:17): [True: 0, False: 3.61k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   792k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 788k, False: 3.61k]
  ------------------
 1473|   788k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   788k|  }
 1475|  3.61k|  return 0;
 1476|  3.61k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    525|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    525|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 214, False: 311]
  ------------------
 1651|    214|    pDataArea_ = Blob(buf, buf + len);
 1652|    311|  else
 1653|    311|    pDataArea_.clear();
 1654|    525|  return 0;
 1655|    525|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  1.83k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  1.83k|  size_t offset = 0;
 1494|  98.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 98.6k, False: 1.83k]
  ------------------
 1495|  98.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  98.6k|  }
 1497|  1.83k|  return offset;
 1498|  1.83k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  9.88k|size_t ValueType<T>::count() const {
 1502|  9.88k|  return value_.size();
 1503|  9.88k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  5.14k|size_t ValueType<T>::size() const {
 1507|  5.14k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  5.14k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    668|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    668|  auto end = value_.end();
 1518|    668|  auto i = value_.begin();
 1519|  70.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 70.0k, False: 668]
  ------------------
 1520|  70.0k|    os << std::setprecision(15) << *i;
 1521|  70.0k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 69.5k, False: 467]
  ------------------
 1522|  69.5k|      os << " ";
 1523|  70.0k|  }
 1524|    668|  return os;
 1525|    668|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|    881|size_t ValueType<T>::sizeDataArea() const {
 1640|    881|  return pDataArea_.size();
 1641|    881|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|     14|DataBuf ValueType<T>::dataArea() const {
 1645|     14|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     14|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  14.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  14.8k|  return new ValueType<T>(*this);
 1513|  14.8k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  14.8k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  14.8k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 381, False: 14.4k]
  ------------------
 1449|    381|    pDataArea_ = rhs.pDataArea_;
 1450|  14.8k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  5.91k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.91k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  5.91k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.91k|  value_.clear();
 1469|  5.91k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.91k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.91k, False: 0]
  |  Branch (1470:17): [True: 0, False: 5.91k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   232k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 226k, False: 5.91k]
  ------------------
 1473|   226k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   226k|  }
 1475|  5.91k|  return 0;
 1476|  5.91k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    584|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    584|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 182, False: 402]
  ------------------
 1651|    182|    pDataArea_ = Blob(buf, buf + len);
 1652|    402|  else
 1653|    402|    pDataArea_.clear();
 1654|    584|  return 0;
 1655|    584|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|    803|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|    803|  size_t offset = 0;
 1494|  3.06k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 3.06k, False: 803]
  ------------------
 1495|  3.06k|    offset += toData(buf + offset, val, byteOrder);
 1496|  3.06k|  }
 1497|    803|  return offset;
 1498|    803|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  13.0k|size_t ValueType<T>::count() const {
 1502|  13.0k|  return value_.size();
 1503|  13.0k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  1.79k|size_t ValueType<T>::size() const {
 1507|  1.79k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.79k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    620|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    620|  auto end = value_.end();
 1518|    620|  auto i = value_.begin();
 1519|  18.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 17.9k, False: 620]
  ------------------
 1520|  17.9k|    os << std::setprecision(15) << *i;
 1521|  17.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 17.4k, False: 421]
  ------------------
 1522|  17.4k|      os << " ";
 1523|  17.9k|  }
 1524|    620|  return os;
 1525|    620|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  1.50k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.50k|  return pDataArea_.size();
 1641|  1.50k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|     12|DataBuf ValueType<T>::dataArea() const {
 1645|     12|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     12|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  15.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  15.6k|  return new ValueType<T>(*this);
 1513|  15.6k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  15.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  15.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 599, False: 15.0k]
  ------------------
 1449|    599|    pDataArea_ = rhs.pDataArea_;
 1450|  15.6k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   541k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  4.06k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.06k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  5.65k|  [[nodiscard]] bool usePacket() const {
  218|  5.65k|    return usePacket_;
  219|  5.65k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  72.4k|  bool usePacket(bool b) {
  223|  72.4k|    bool r = usePacket_;
  224|  72.4k|    usePacket_ = b;
  225|  72.4k|    return r;
  226|  72.4k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  72.4k|  void setPacket(std::string xmpPacket) {
  229|  72.4k|    xmpPacket_ = std::move(xmpPacket);
  230|  72.4k|    usePacket(false);
  231|  72.4k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  60.7k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  37.9k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  37.9k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  37.9k|  return *this;
  406|  37.9k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   175k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   175k|    setValue(Exiv2::toString(value));
  405|   175k|  return *this;
  406|   175k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  13.8k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  13.8k|    setValue(Exiv2::toString(value));
  405|  13.8k|  return *this;
  406|  13.8k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  20.9k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  20.9k|    setValue(Exiv2::toString(value));
  405|  20.9k|  return *this;
  406|  20.9k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  396|  3.50k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  3.50k|    setValue(Exiv2::toString(value));
  405|  3.50k|  return *this;
  406|  3.50k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  5.45k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  5.45k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  5.45k|  return *this;
  406|  5.45k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|  1.45k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  1.45k|    setValue(Exiv2::toString(value));
  405|  1.45k|  return *this;
  406|  1.45k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  4.02k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  4.02k|    setValue(Exiv2::toString(value));
  405|  4.02k|  return *this;
  406|  4.02k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    422|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|    422|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    422|  return *this;
  406|    422|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|   108k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   108k|    setValue(Exiv2::toString(value));
  405|   108k|  return *this;
  406|   108k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  1.52k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  1.52k|    setValue(Exiv2::toString(value));
  405|  1.52k|  return *this;
  406|  1.52k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   175k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   175k|    setValue(Exiv2::toString(value));
  405|   175k|  return *this;
  406|   175k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  46.2k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  46.2k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  46.2k|  return *this;
  406|  46.2k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   186k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   186k|    setValue(Exiv2::toString(value));
  405|   186k|  return *this;
  406|   186k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|    480|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|    480|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    480|  return *this;
  406|    480|}

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

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

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

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

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|  41.1k|  static constexpr auto tagList() {
   39|  41.1k|    return tagInfo_;
   40|  41.1k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|   345k|  static constexpr auto tagListCs() {
   43|   345k|    return tagInfoCs_;
   44|   345k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  22.2k|  static constexpr auto tagListSi() {
   47|  22.2k|    return tagInfoSi_;
   48|  22.2k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  66.2k|  static constexpr auto tagListCf() {
   55|  66.2k|    return tagInfoCf_;
   56|  66.2k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.44k|  static constexpr auto tagListPi() {
   59|  1.44k|    return tagInfoPi_;
   60|  1.44k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    385|  static constexpr auto tagListTi() {
   63|    385|    return tagInfoTi_;
   64|    385|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|  1.70k|  static constexpr auto tagListFi() {
   67|  1.70k|    return tagInfoFi_;
   68|  1.70k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|   100k|  static constexpr auto tagListPa() {
   51|   100k|    return tagInfoPa_;
   52|   100k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    916|  static constexpr auto tagListPr() {
   71|    916|    return tagInfoPr_;
   72|    916|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    254|  static constexpr auto tagListVigCor2() {
  135|    254|    return tagInfoVigCor2_;
  136|    254|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    210|  static constexpr auto tagListLiOp() {
  139|    210|    return tagInfoLiOp_;
  140|    210|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    225|  static constexpr auto tagListAfMiAdj() {
  127|    225|    return tagInfoAfMiAdj_;
  128|    225|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|   213k|  static constexpr auto tagListLe() {
  143|   213k|    return tagInfoLe_;
  144|   213k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    277|  static constexpr auto tagListAm() {
  147|    277|    return tagInfoAm_;
  148|    277|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    457|  static constexpr auto tagListFil() {
  155|    457|    return tagInfoFil_;
  156|    457|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    336|  static constexpr auto tagListMe() {
  151|    336|    return tagInfoMe_;
  152|    336|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    236|  static constexpr auto tagListHdr() {
  159|    236|    return tagInfoHdr_;
  160|    236|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    200|  static constexpr auto tagListAfC() {
  163|    200|    return tagInfoAfC_;
  164|    200|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|  8.46k|  static constexpr auto tagListRawB() {
  167|  8.46k|    return tagInfoRawB_;
  168|  8.46k|  }

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

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

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  53.7k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  53.7k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  53.7k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  53.7k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 53.7k]
  |  Branch (18:17): [True: 0, False: 53.7k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  53.7k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 5.24k, False: 48.4k]
  |  Branch (22:26): [True: 5.16k, False: 74]
  ------------------
   23|  5.16k|    setByteOrder(littleEndian);
   24|  48.5k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 15.6k, False: 32.8k]
  |  Branch (24:33): [True: 15.5k, False: 66]
  ------------------
   25|  15.5k|    setByteOrder(bigEndian);
   26|  32.9k|  } else {
   27|  32.9k|    return false;
   28|  32.9k|  }
   29|  20.7k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 5.24k, False: 15.5k]
  ------------------
   30|  5.24k|    return false;
   31|  15.5k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  15.5k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 15.0k, False: 440]
  ------------------
   33|  15.0k|    return false;
   34|    440|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|    440|  return true;
   37|  15.5k|}

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

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

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

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

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   129k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   129k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 58.5k, False: 70.7k]
  |  Branch (378:31): [True: 15.9k, False: 42.5k]
  ------------------
  379|  15.9k|    return -1;
  380|   113k|  const DataSet* dataSet = records_[recordId];
  381|   113k|  int idx;
  382|  1.64M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 1.53M, False: 105k]
  ------------------
  383|  1.53M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 7.32k, False: 1.52M]
  ------------------
  384|  7.32k|      return -1;
  385|  1.53M|  }
  386|   105k|  return idx;
  387|   113k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  5.75k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  5.75k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 4.96k, False: 786]
  |  Branch (390:31): [True: 0, False: 4.96k]
  ------------------
  391|      0|    return -1;
  392|  5.75k|  const DataSet* dataSet = records_[recordId];
  393|  5.75k|  int idx;
  394|   141k|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 135k, False: 5.75k]
  ------------------
  395|   135k|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 135k]
  ------------------
  396|      0|      return -1;
  397|   135k|  }
  398|  5.75k|  return idx;
  399|  5.75k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  43.0k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  43.0k|  int idx = dataSetIdx(number, recordId);
  403|  43.0k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 7.75k, False: 35.3k]
  ------------------
  404|  7.75k|    return unknownDataSet.type_;
  405|  35.3k|  return records_[recordId][idx].type_;
  406|  43.0k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|  44.2k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|  44.2k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 36.4k, False: 7.75k]
  ------------------
  410|  36.4k|    return records_[recordId][idx].name_;
  411|       |
  412|  7.75k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  7.75k|#define stringFormat std::format
  ------------------
  413|  44.2k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  41.9k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  41.9k|  int idx = dataSetIdx(number, recordId);
  438|  41.9k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 7.75k, False: 34.1k]
  ------------------
  439|  7.75k|    return unknownDataSet.repeatable_;
  440|  34.1k|  return records_[recordId][idx].repeatable_;
  441|  41.9k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  5.75k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  5.75k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 5.75k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  5.75k|    return records_[recordId][idx].number_;
  447|  5.75k|  }
  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|  44.2k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|  44.2k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 23.9k, False: 20.3k]
  |  Branch (454:31): [True: 15.0k, False: 5.31k]
  ------------------
  455|  38.9k|    return recordInfo_[recordId].name_;
  456|  38.9k|  }
  457|       |
  458|  5.31k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  5.31k|#define stringFormat std::format
  ------------------
  459|  44.2k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  5.75k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  5.75k|  uint16_t i;
  470|  6.54k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 6.54k, False: 0]
  ------------------
  471|  6.54k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 5.75k, False: 786]
  ------------------
  472|  5.75k|      break;
  473|  6.54k|  }
  474|  5.75k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 5.75k]
  ------------------
  475|      0|    if (!isHex(recordName, 4, "0x"))
  ------------------
  |  Branch (475:9): [True: 0, False: 0]
  ------------------
  476|      0|      throw Error(ErrorCode::kerInvalidRecord, recordName);
  477|      0|    i = static_cast<uint16_t>(std::stoi(recordName, nullptr, 16));
  478|      0|  }
  479|  5.75k|  return i;
  480|  5.75k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  5.75k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  5.75k|  decomposeKey();
  492|  5.75k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  38.4k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  38.4k|  makeKey();
  496|  38.4k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   289k|uint16_t IptcKey::tag() const {
  523|   289k|  return tag_;
  524|   289k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   108k|uint16_t IptcKey::record() const {
  531|   108k|  return record_;
  532|   108k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|  74.4k|IptcKey::UniquePtr IptcKey::clone() const {
  535|  74.4k|  return UniquePtr(clone_());
  536|  74.4k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|  74.4k|IptcKey* IptcKey::clone_() const {
  539|  74.4k|  return new IptcKey(*this);
  540|  74.4k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  5.75k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  5.75k|  auto posDot1 = key_.find('.');
  545|  5.75k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  5.75k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 5.75k]
  |  Branch (547:39): [True: 0, False: 5.75k]
  ------------------
  548|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  549|      0|  }
  550|       |
  551|       |  // Get the family name, record name and dataSet name parts of the key
  552|  5.75k|  const std::string familyName = key_.substr(0, posDot1);
  553|  5.75k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 5.75k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  5.75k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  5.75k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  5.75k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  5.75k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  5.75k|  recordName = IptcDataSets::recordName(recId);
  565|  5.75k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  5.75k|  tag_ = dataSet;
  568|  5.75k|  record_ = recId;
  569|  5.75k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  5.75k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  38.4k|void IptcKey::makeKey() {
  573|  38.4k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  38.4k|         IptcDataSets::dataSetName(tag_, record_);
  575|  38.4k|}

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

_ZN5Exiv28EpsImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1027|  5.13k|    Image(ImageType::eps, mdXmp, std::move(io), params) {
 1028|       |  // LogMsg::setLevel(LogMsg::debug);
 1029|  5.13k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (1029:7): [True: 0, False: 5.13k]
  |  Branch (1029:26): [True: 0, False: 0]
  ------------------
 1030|       |#ifdef DEBUG
 1031|       |    EXV_DEBUG << "Exiv2::EpsImage:: Creating blank EPS image\n";
 1032|       |#endif
 1033|      0|    IoCloser closer(*io_);
 1034|      0|    if (io_->write(reinterpret_cast<const byte*>(epsBlank.data()), epsBlank.size()) != epsBlank.size()) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 0]
  ------------------
 1035|      0|#ifndef SUPPRESS_WARNINGS
 1036|      0|      EXV_WARNING << "Failed to write blank EPS image.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1037|      0|#endif
 1038|      0|      throw Error(ErrorCode::kerImageWriteFailed);
 1039|      0|    }
 1040|      0|  }
 1041|  5.13k|}
_ZNK5Exiv28EpsImage8mimeTypeEv:
 1043|  5.57k|std::string EpsImage::mimeType() const {
 1044|  5.57k|  return "application/postscript";
 1045|  5.57k|}
_ZN5Exiv28EpsImage12readMetadataEv:
 1051|  5.13k|void EpsImage::readMetadata() {
 1052|       |#ifdef DEBUG
 1053|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Reading EPS file " << io_->path() << "\n";
 1054|       |#endif
 1055|       |
 1056|       |  // read metadata
 1057|  5.13k|  readWriteEpsMetadata(*io_, xmpPacket_, nativePreviews_, /* write = */ false);
 1058|       |
 1059|       |  // decode XMP metadata
 1060|  5.13k|  const DecodeParams dp(max_recursion_depth_);
 1061|  5.13k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp) > 1) {
  ------------------
  |  Branch (1061:7): [True: 548, False: 4.59k]
  |  Branch (1061:30): [True: 226, False: 322]
  ------------------
 1062|    226|#ifndef SUPPRESS_WARNINGS
 1063|    226|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    226|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 226]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    226|  LogMsg(LogMsg::warn).os()
  ------------------
 1064|    226|#endif
 1065|    226|    throw Error(ErrorCode::kerFailedToReadImageData);
 1066|    226|  }
 1067|       |
 1068|       |#ifdef DEBUG
 1069|       |  EXV_DEBUG << "Exiv2::EpsImage::readMetadata: Finished reading EPS file " << io_->path() << "\n";
 1070|       |#endif
 1071|  5.13k|}
_ZN5Exiv214newEpsInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1096|  5.13k|Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1097|  5.13k|  auto image = std::make_unique<EpsImage>(std::move(io), params);
 1098|  5.13k|  if (!image->good()) {
  ------------------
  |  Branch (1098:7): [True: 0, False: 5.13k]
  ------------------
 1099|      0|    return nullptr;
 1100|      0|  }
 1101|  5.13k|  return image;
 1102|  5.13k|}
_ZN5Exiv29isEpsTypeERNS_7BasicIoEb:
 1104|  34.3k|bool isEpsType(BasicIo& iIo, bool advance) {
 1105|       |  // read as many bytes as needed for the longest (DOS) EPS signature
 1106|  34.3k|  constexpr auto bufSize = [] {
 1107|  34.3k|    auto f = [](const auto& a, const auto& b) { return a.size() < b.size(); };
 1108|  34.3k|    return std::max_element(epsFirstLine.begin(), epsFirstLine.end(), f)->size();
 1109|  34.3k|  }();
 1110|  34.3k|  const size_t restore = iIo.tell();  // save
 1111|  34.3k|  DataBuf buf = iIo.read(bufSize);
 1112|  34.3k|  if (iIo.error() || buf.size() != bufSize) {
  ------------------
  |  Branch (1112:7): [True: 0, False: 34.3k]
  |  Branch (1112:22): [True: 0, False: 34.3k]
  ------------------
 1113|      0|    iIo.seek(restore, BasicIo::beg);
 1114|      0|    return false;
 1115|      0|  }
 1116|       |  // check for all possible (DOS) EPS signatures
 1117|  34.3k|  bool matched = (buf.cmpBytes(0, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
 1118|  34.3k|  if (!matched) {
  ------------------
  |  Branch (1118:7): [True: 32.6k, False: 1.71k]
  ------------------
 1119|  86.5k|    for (auto&& eps : epsFirstLine) {
  ------------------
  |  Branch (1119:21): [True: 86.5k, False: 24.0k]
  ------------------
 1120|  86.5k|      if (buf.cmpBytes(0, eps.data(), eps.size()) == 0) {
  ------------------
  |  Branch (1120:11): [True: 8.56k, False: 77.9k]
  ------------------
 1121|  8.56k|        matched = true;
 1122|  8.56k|        break;
 1123|  8.56k|      }
 1124|  86.5k|    }
 1125|  32.6k|  }
 1126|       |  // seek back if possible and requested
 1127|  34.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (1127:7): [True: 34.3k, False: 0]
  |  Branch (1127:19): [True: 0, False: 0]
  ------------------
 1128|  34.3k|    iIo.seek(restore, BasicIo::beg);
 1129|  34.3k|  }
 1130|  34.3k|  return matched;
 1131|  34.3k|}
epsimage.cpp:_ZN12_GLOBAL__N_120readWriteEpsMetadataERN5Exiv27BasicIoERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS3_6vectorINS0_13NativePreviewENS7_ISC_EEEEb:
  224|  5.13k|void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList& nativePreviews, bool write) {
  225|       |  // open input file
  226|  5.13k|  if (io.open() != 0) {
  ------------------
  |  Branch (226:7): [True: 0, False: 5.13k]
  ------------------
  227|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  228|      0|  }
  229|  5.13k|  IoCloser closer(io);
  230|       |
  231|       |  // read from input file via memory map
  232|  5.13k|  const byte* data = io.mmap();
  233|       |
  234|       |  // default positions and sizes
  235|  5.13k|  const size_t size = io.size();
  236|  5.13k|  size_t posEps = 0;
  237|  5.13k|  size_t posEndEps = size;
  238|  5.13k|  uint32_t posWmf = 0;
  239|  5.13k|  uint32_t sizeWmf = 0;
  240|  5.13k|  uint32_t posTiff = 0;
  241|  5.13k|  uint32_t sizeTiff = 0;
  242|       |
  243|  5.13k|  ErrorCode errcode = write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData;
  ------------------
  |  Branch (243:23): [True: 0, False: 5.13k]
  ------------------
  244|       |
  245|       |  // check for DOS EPS
  246|  5.13k|  const bool dosEps =
  247|  5.13k|      (size >= dosEpsSignature.size() && memcmp(data, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
  ------------------
  |  Branch (247:8): [True: 5.13k, False: 0]
  |  Branch (247:42): [True: 856, False: 4.28k]
  ------------------
  248|  5.13k|  if (dosEps) {
  ------------------
  |  Branch (248:7): [True: 856, False: 4.28k]
  ------------------
  249|       |#ifdef DEBUG
  250|       |    EXV_DEBUG << "readWriteEpsMetadata: Found DOS EPS signature\n";
  251|       |#endif
  252|       |
  253|    856|    enforce(size >= 30, errcode);
  254|    856|    posEps = getULong(data + 4, littleEndian);
  255|    856|    posEndEps = getULong(data + 8, littleEndian) + posEps;
  256|    856|    posWmf = getULong(data + 12, littleEndian);
  257|    856|    sizeWmf = getULong(data + 16, littleEndian);
  258|    856|    posTiff = getULong(data + 20, littleEndian);
  259|    856|    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|    856|    if (uint16_t checksum = getUShort(data + 28, littleEndian); checksum != 0xFFFF) {
  ------------------
  |  Branch (266:65): [True: 796, False: 60]
  ------------------
  267|       |#ifdef DEBUG
  268|       |      EXV_DEBUG << "readWriteEpsMetadata: DOS EPS checksum is not FFFF\n";
  269|       |#endif
  270|    796|    }
  271|    856|    if ((posWmf != 0 || sizeWmf != 0) && (posTiff != 0 || sizeTiff != 0)) {
  ------------------
  |  Branch (271:10): [True: 551, False: 305]
  |  Branch (271:25): [True: 108, False: 197]
  |  Branch (271:43): [True: 468, False: 155]
  |  Branch (271:59): [True: 95, False: 60]
  ------------------
  272|    563|#ifndef SUPPRESS_WARNINGS
  273|    563|      EXV_WARNING << "DOS EPS file has both WMF and TIFF section. Only one of those is allowed.\n";
  ------------------
  |  |  138|    563|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 563]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    563|  LogMsg(LogMsg::warn).os()
  ------------------
  274|    563|#endif
  275|    563|      if (write)
  ------------------
  |  Branch (275:11): [True: 0, False: 563]
  ------------------
  276|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  277|    563|    }
  278|    856|    if (sizeWmf == 0 && sizeTiff == 0) {
  ------------------
  |  Branch (278:9): [True: 439, False: 417]
  |  Branch (278:25): [True: 170, False: 269]
  ------------------
  279|    170|#ifndef SUPPRESS_WARNINGS
  280|    170|      EXV_WARNING << "DOS EPS file has neither WMF nor TIFF section. Exactly one of those is required.\n";
  ------------------
  |  |  138|    170|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 170]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    170|  LogMsg(LogMsg::warn).os()
  ------------------
  281|    170|#endif
  282|    170|      if (write)
  ------------------
  |  Branch (282:11): [True: 0, False: 170]
  ------------------
  283|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  284|    170|    }
  285|    856|    enforce(30 <= posEps, errcode);
  286|    856|    enforce(sizeWmf == 0 || 30 <= posWmf, errcode);
  ------------------
  |  Branch (286:13): [True: 516, False: 340]
  |  Branch (286:29): [True: 239, False: 101]
  ------------------
  287|    856|    enforce(sizeTiff == 0 || 30 <= posTiff, errcode);
  ------------------
  |  Branch (287:13): [True: 403, False: 453]
  |  Branch (287:30): [True: 372, False: 81]
  ------------------
  288|       |
  289|    856|    enforce(posEps <= posEndEps && posEndEps <= size, errcode);
  ------------------
  |  Branch (289:13): [True: 550, False: 306]
  |  Branch (289:36): [True: 303, False: 247]
  ------------------
  290|    856|    enforce(posWmf <= size && sizeWmf <= size - posWmf, errcode);
  ------------------
  |  Branch (290:13): [True: 254, False: 602]
  |  Branch (290:31): [True: 213, False: 41]
  ------------------
  291|    856|    enforce(posTiff <= size && sizeTiff <= size - posTiff, errcode);
  ------------------
  |  Branch (291:13): [True: 149, False: 707]
  |  Branch (291:32): [True: 103, False: 46]
  ------------------
  292|    856|  }
  293|       |
  294|       |  // check first line
  295|  5.13k|  std::string firstLine;
  296|  5.13k|  const size_t posSecondLine = readLine(firstLine, data, posEps, posEndEps);
  297|       |#ifdef DEBUG
  298|       |  EXV_DEBUG << "readWriteEpsMetadata: First line: " << firstLine << "\n";
  299|       |#endif
  300|  5.13k|  auto it = std::find(epsFirstLine.begin(), epsFirstLine.end(), firstLine);
  301|  5.13k|  if (it == epsFirstLine.end()) {
  ------------------
  |  Branch (301:7): [True: 189, False: 4.94k]
  ------------------
  302|    189|    throw Error(ErrorCode::kerNotAnImage, "EPS");
  303|    189|  }
  304|       |
  305|       |  // determine line ending style of the first line
  306|  4.94k|  if (posSecondLine >= posEndEps) {
  ------------------
  |  Branch (306:7): [True: 49, False: 4.90k]
  ------------------
  307|     49|#ifndef SUPPRESS_WARNINGS
  308|     49|    EXV_WARNING << "Premature end of file after first line.\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()
  ------------------
  309|     49|#endif
  310|     49|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (310:17): [True: 0, False: 49]
  ------------------
  311|     49|  }
  312|  4.90k|  const std::string lineEnding(reinterpret_cast<const char*>(data + posEps + firstLine.size()),
  313|  4.90k|                               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|  4.90k|  size_t posLanguageLevel = posEndEps;
  328|  4.90k|  size_t posContainsXmp = posEndEps;
  329|  4.90k|  size_t posPages = posEndEps;
  330|  4.90k|  size_t posExiv2Version = posEndEps;
  331|  4.90k|  size_t posExiv2Website = posEndEps;
  332|  4.90k|  size_t posEndComments = posEndEps;
  333|  4.90k|  size_t posAi7Thumbnail = posEndEps;
  334|  4.90k|  size_t posAi7ThumbnailEndData = posEndEps;
  335|  4.90k|  size_t posBeginPhotoshop = posEndEps;
  336|  4.90k|  size_t posEndPhotoshop = posEndEps;
  337|  4.90k|  size_t posPage = posEndEps;
  338|  4.90k|  size_t posBeginPageSetup = posEndEps;
  339|  4.90k|  size_t posEndPageSetup = posEndEps;
  340|  4.90k|  size_t posPageTrailer = posEndEps;
  341|  4.90k|  size_t posEof = posEndEps;
  342|  4.90k|  std::vector<std::pair<size_t, size_t>> removableEmbeddings;
  343|  4.90k|  size_t depth = 0;
  344|  4.90k|  const size_t maxDepth = std::numeric_limits<size_t>::max();
  345|  4.90k|  bool illustrator8 = false;
  346|  4.90k|  bool corelDraw = false;
  347|  4.90k|  bool implicitPage = false;
  348|  4.90k|  bool implicitPageSetup = false;
  349|  4.90k|  bool implicitPageTrailer = false;
  350|  4.90k|  bool inDefaultsPreviewPrologSetup = false;
  351|  4.90k|  bool inRemovableEmbedding = false;
  352|  4.90k|  std::string removableEmbeddingEndLine;
  353|  4.90k|  size_t removableEmbeddingsWithUnmarkedTrailer = 0;
  354|   703k|  for (size_t pos = posEps; pos < posEof;) {
  ------------------
  |  Branch (354:29): [True: 698k, False: 4.79k]
  ------------------
  355|   698k|    const size_t startPos = pos;
  356|   698k|    std::string line;
  357|   698k|    pos = readLine(line, data, startPos, posEndEps);
  358|       |#ifdef DEBUG
  359|       |    bool significantLine = true;
  360|       |#endif
  361|       |    // nested documents
  362|   698k|    if (posPage == posEndEps && (line.starts_with("%%IncludeDocument:") || line.starts_with("%%BeginDocument:"))) {
  ------------------
  |  Branch (362:9): [True: 39.7k, False: 659k]
  |  Branch (362:34): [True: 27, False: 39.7k]
  |  Branch (362:76): [True: 19, False: 39.7k]
  ------------------
  363|     46|#ifndef SUPPRESS_WARNINGS
  364|     46|      EXV_WARNING << "Nested document at invalid position: " << startPos << "\n";
  ------------------
  |  |  138|     46|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     46|  LogMsg(LogMsg::warn).os()
  ------------------
  365|     46|#endif
  366|     46|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (366:19): [True: 0, False: 46]
  ------------------
  367|     46|    }
  368|   698k|    if (line.starts_with("%%BeginDocument:")) {
  ------------------
  |  Branch (368:9): [True: 82.7k, False: 616k]
  ------------------
  369|  82.7k|      if (depth == maxDepth) {
  ------------------
  |  Branch (369:11): [True: 0, False: 82.7k]
  ------------------
  370|      0|#ifndef SUPPRESS_WARNINGS
  371|      0|        EXV_WARNING << "Document too deeply nested at position: " << startPos << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  372|      0|#endif
  373|      0|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (373:21): [True: 0, False: 0]
  ------------------
  374|      0|      }
  375|  82.7k|      depth++;
  376|   616k|    } else if (line.starts_with("%%EndDocument")) {
  ------------------
  |  Branch (376:16): [True: 218, False: 615k]
  ------------------
  377|    218|      if (depth == 0) {
  ------------------
  |  Branch (377:11): [True: 24, False: 194]
  ------------------
  378|     24|#ifndef SUPPRESS_WARNINGS
  379|     24|        EXV_WARNING << "Unmatched EndDocument at position: " << startPos << "\n";
  ------------------
  |  |  138|     24|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 24]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     24|  LogMsg(LogMsg::warn).os()
  ------------------
  380|     24|#endif
  381|     24|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (381:21): [True: 0, False: 24]
  ------------------
  382|     24|      }
  383|    194|      depth--;
  384|   615k|    } else {
  385|       |#ifdef DEBUG
  386|       |      significantLine = false;
  387|       |#endif
  388|   615k|    }
  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|   698k|    if (depth != 0)
  ------------------
  |  Branch (395:9): [True: 99.8k, False: 599k]
  ------------------
  396|  99.8k|      continue;
  397|       |    // explicit "Begin" comments
  398|   599k|    if (line.starts_with("%%BeginPreview:")) {
  ------------------
  |  Branch (398:9): [True: 283, False: 598k]
  ------------------
  399|    283|      inDefaultsPreviewPrologSetup = true;
  400|   598k|    } else if (line == "%%BeginDefaults") {
  ------------------
  |  Branch (400:16): [True: 426, False: 598k]
  ------------------
  401|    426|      inDefaultsPreviewPrologSetup = true;
  402|   598k|    } else if (line == "%%BeginProlog") {
  ------------------
  |  Branch (402:16): [True: 371, False: 598k]
  ------------------
  403|    371|      inDefaultsPreviewPrologSetup = true;
  404|   598k|    } else if (line == "%%BeginSetup") {
  ------------------
  |  Branch (404:16): [True: 578, False: 597k]
  ------------------
  405|    578|      inDefaultsPreviewPrologSetup = true;
  406|   597k|    } else if (posPage == posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (406:16): [True: 39.0k, False: 558k]
  |  Branch (406:40): [True: 137, False: 38.9k]
  ------------------
  407|    137|      posPage = startPos;
  408|   597k|    } else if (posPage != posEndEps && line.starts_with("%%Page:")) {
  ------------------
  |  Branch (408:16): [True: 558k, False: 38.9k]
  |  Branch (408:40): [True: 39, False: 558k]
  ------------------
  409|     39|      if (implicitPage) {
  ------------------
  |  Branch (409:11): [True: 21, False: 18]
  ------------------
  410|     21|#ifndef SUPPRESS_WARNINGS
  411|     21|        EXV_WARNING << "Page at position " << startPos << " conflicts with implicit page at position: " << posPage
  ------------------
  |  |  138|     21|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 21]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     21|  LogMsg(LogMsg::warn).os()
  ------------------
  412|      0|                    << "\n";
  413|     21|#endif
  414|     21|        throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (414:21): [True: 0, False: 21]
  ------------------
  415|     21|      }
  416|     18|#ifndef SUPPRESS_WARNINGS
  417|     18|      EXV_WARNING << "Unable to handle multiple PostScript pages. Found second page at position: " << startPos << "\n";
  ------------------
  |  |  138|     18|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     18|  LogMsg(LogMsg::warn).os()
  ------------------
  418|     18|#endif
  419|     18|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (419:19): [True: 0, False: 18]
  ------------------
  420|   597k|    } else if (line == "%%BeginPageSetup") {
  ------------------
  |  Branch (420:16): [True: 1.01k, False: 596k]
  ------------------
  421|  1.01k|      posBeginPageSetup = startPos;
  422|   596k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: Before %%EndPageSetup") {
  ------------------
  |  Branch (422:16): [True: 347k, False: 249k]
  |  Branch (422:41): [True: 821, False: 346k]
  ------------------
  423|    821|      inRemovableEmbedding = true;
  424|    821|      removableEmbeddings.emplace_back(startPos, startPos);
  425|    821|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  426|   595k|    } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: After %%PageTrailer") {
  ------------------
  |  Branch (426:16): [True: 346k, False: 249k]
  |  Branch (426:41): [True: 1.67k, False: 344k]
  ------------------
  427|  1.67k|      inRemovableEmbedding = true;
  428|  1.67k|      removableEmbeddings.emplace_back(startPos, startPos);
  429|  1.67k|      removableEmbeddingEndLine = "%Exiv2EndXMP";
  430|   593k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageSetup End \"AI11EPS\"") {
  ------------------
  |  Branch (430:16): [True: 344k, False: 249k]
  |  Branch (430:41): [True: 591, False: 344k]
  ------------------
  431|    591|      inRemovableEmbedding = true;
  432|    591|      removableEmbeddings.emplace_back(startPos, startPos);
  433|    591|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageSetup End \"AI11EPS\"";
  434|   593k|    } else if (!inRemovableEmbedding && line == "%ADOBeginClientInjection: PageTrailer Start \"AI11EPS\"") {
  ------------------
  |  Branch (434:16): [True: 344k, False: 249k]
  |  Branch (434:41): [True: 483, False: 343k]
  ------------------
  435|    483|      inRemovableEmbedding = true;
  436|    483|      removableEmbeddings.emplace_back(startPos, startPos);
  437|    483|      removableEmbeddingEndLine = "%ADOEndClientInjection: PageTrailer Start \"AI11EPS\"";
  438|   592k|    } else if (!inRemovableEmbedding && line == "%begin_xml_code") {
  ------------------
  |  Branch (438:16): [True: 343k, False: 249k]
  |  Branch (438:41): [True: 49.7k, False: 293k]
  ------------------
  439|  49.7k|      inRemovableEmbedding = true;
  440|  49.7k|      removableEmbeddings.emplace_back(startPos, startPos);
  441|  49.7k|      removableEmbeddingEndLine = "%end_xml_code";
  442|  49.7k|      removableEmbeddingsWithUnmarkedTrailer++;
  443|   542k|    } else {
  444|       |#ifdef DEBUG
  445|       |      significantLine = false;
  446|       |#endif
  447|   542k|    }
  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|   599k|    if (line == "%%EOF" || line == "%begin_xml_code" || line.size() < 2 || line.front() != '%' || '\x21' > line[1] ||
  ------------------
  |  Branch (455:9): [True: 21, False: 599k]
  |  Branch (455:28): [True: 57.6k, False: 541k]
  |  Branch (455:57): [True: 228k, False: 312k]
  |  Branch (455:76): [True: 104k, False: 208k]
  |  Branch (455:99): [True: 2.23k, False: 206k]
  ------------------
  456|   393k|        line[1] > '\x7e') {
  ------------------
  |  Branch (456:9): [True: 236, False: 205k]
  ------------------
  457|   393k|      if (posEndComments == posEndEps) {
  ------------------
  |  Branch (457:11): [True: 2.69k, False: 390k]
  ------------------
  458|  2.69k|        posEndComments = startPos;
  459|       |#ifdef DEBUG
  460|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndComments at position: " << startPos << "\n";
  461|       |#endif
  462|  2.69k|      }
  463|   393k|    }
  464|   599k|    if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding &&
  ------------------
  |  Branch (464:9): [True: 39.5k, False: 559k]
  |  Branch (464:33): [True: 20.9k, False: 18.5k]
  |  Branch (464:64): [True: 10.5k, False: 10.4k]
  |  Branch (464:97): [True: 4.61k, False: 5.89k]
  ------------------
  465|  4.61k|        !onlyWhitespaces(line)) {
  ------------------
  |  Branch (465:9): [True: 2.30k, False: 2.30k]
  ------------------
  466|  2.30k|      posPage = startPos;
  467|  2.30k|      implicitPage = true;
  468|       |#ifdef DEBUG
  469|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page at position: " << startPos << "\n";
  470|       |#endif
  471|  2.30k|    }
  472|   599k|    if (posBeginPageSetup == posEndEps &&
  ------------------
  |  Branch (472:9): [True: 43.7k, False: 555k]
  ------------------
  473|  43.7k|        (implicitPage || (posPage != posEndEps && !inRemovableEmbedding && !line.empty() && line.front() != '%'))) {
  ------------------
  |  Branch (473:10): [True: 2.28k, False: 41.4k]
  |  Branch (473:27): [True: 4.70k, False: 36.7k]
  |  Branch (473:51): [True: 1.16k, False: 3.53k]
  |  Branch (473:76): [True: 739, False: 427]
  |  Branch (473:93): [True: 59, False: 680]
  ------------------
  474|  2.34k|      posBeginPageSetup = startPos;
  475|  2.34k|      implicitPageSetup = true;
  476|       |#ifdef DEBUG
  477|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  478|       |#endif
  479|  2.34k|    }
  480|   599k|    if (posEndPageSetup == posEndEps && implicitPageSetup && !inRemovableEmbedding && !line.empty() &&
  ------------------
  |  Branch (480:9): [True: 70.4k, False: 528k]
  |  Branch (480:41): [True: 24.9k, False: 45.5k]
  |  Branch (480:62): [True: 6.96k, False: 17.9k]
  |  Branch (480:87): [True: 5.47k, False: 1.48k]
  ------------------
  481|  5.47k|        line.front() != '%') {
  ------------------
  |  Branch (481:9): [True: 1.80k, False: 3.67k]
  ------------------
  482|  1.80k|      posEndPageSetup = startPos;
  483|       |#ifdef DEBUG
  484|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  485|       |#endif
  486|  1.80k|    }
  487|   599k|    if (!line.empty() && line.front() != '%')
  ------------------
  |  Branch (487:9): [True: 376k, False: 222k]
  |  Branch (487:26): [True: 109k, False: 267k]
  ------------------
  488|   109k|      continue;  // performance optimization
  489|   490k|    if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
  ------------------
  |  Branch (489:9): [True: 21, False: 490k]
  |  Branch (489:28): [True: 383, False: 489k]
  |  Branch (489:51): [True: 454, False: 489k]
  ------------------
  490|    858|      if (posBeginPageSetup == posEndEps) {
  ------------------
  |  Branch (490:11): [True: 37, False: 821]
  ------------------
  491|     37|        posBeginPageSetup = startPos;
  492|     37|        implicitPageSetup = true;
  493|       |#ifdef DEBUG
  494|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
  495|       |#endif
  496|     37|      }
  497|    858|      if (posEndPageSetup == posEndEps) {
  ------------------
  |  Branch (497:11): [True: 76, False: 782]
  ------------------
  498|     76|        posEndPageSetup = startPos;
  499|     76|        implicitPageSetup = true;
  500|       |#ifdef DEBUG
  501|       |        EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
  502|       |#endif
  503|     76|      }
  504|    858|    }
  505|   490k|    if ((line == "%%EOF" || line == "%%Trailer") && posPageTrailer == posEndEps) {
  ------------------
  |  Branch (505:10): [True: 21, False: 490k]
  |  Branch (505:29): [True: 383, False: 489k]
  |  Branch (505:53): [True: 54, False: 350]
  ------------------
  506|     54|      posPageTrailer = startPos;
  507|     54|      implicitPageTrailer = true;
  508|       |#ifdef DEBUG
  509|       |      EXV_DEBUG << "readWriteEpsMetadata: Found implicit PageTrailer at position: " << startPos << "\n";
  510|       |#endif
  511|     54|    }
  512|       |    // remaining explicit comments
  513|   490k|    if (posEndComments == posEndEps && posLanguageLevel == posEndEps && line.starts_with("%%LanguageLevel:")) {
  ------------------
  |  Branch (513:9): [True: 19.1k, False: 470k]
  |  Branch (513:40): [True: 18.9k, False: 252]
  |  Branch (513:73): [True: 34, False: 18.8k]
  ------------------
  514|     34|      posLanguageLevel = startPos;
  515|   489k|    } else if (posEndComments == posEndEps && posContainsXmp == posEndEps && line.starts_with("%ADO_ContainsXMP:")) {
  ------------------
  |  Branch (515:16): [True: 19.1k, False: 470k]
  |  Branch (515:47): [True: 18.5k, False: 542]
  |  Branch (515:78): [True: 868, False: 17.7k]
  ------------------
  516|    868|      posContainsXmp = startPos;
  517|   489k|    } else if (posEndComments == posEndEps && posPages == posEndEps && line.starts_with("%%Pages:")) {
  ------------------
  |  Branch (517:16): [True: 18.2k, False: 470k]
  |  Branch (517:47): [True: 17.9k, False: 290]
  |  Branch (517:72): [True: 44, False: 17.9k]
  ------------------
  518|     44|      posPages = startPos;
  519|   489k|    } else if (posEndComments == posEndEps && posExiv2Version == posEndEps && line.starts_with("%Exiv2Version:")) {
  ------------------
  |  Branch (519:16): [True: 18.2k, False: 470k]
  |  Branch (519:47): [True: 17.9k, False: 287]
  |  Branch (519:79): [True: 33, False: 17.9k]
  ------------------
  520|     33|      posExiv2Version = startPos;
  521|   489k|    } else if (posEndComments == posEndEps && posExiv2Website == posEndEps && line.starts_with("%Exiv2Website:")) {
  ------------------
  |  Branch (521:16): [True: 18.1k, False: 470k]
  |  Branch (521:47): [True: 17.7k, False: 408]
  |  Branch (521:79): [True: 32, False: 17.7k]
  ------------------
  522|     32|      posExiv2Website = startPos;
  523|   489k|    } else if (posEndComments == posEndEps && line.starts_with("%%Creator: Adobe Illustrator") &&
  ------------------
  |  Branch (523:16): [True: 18.1k, False: 470k]
  |  Branch (523:47): [True: 676, False: 17.4k]
  ------------------
  524|    676|               firstLine == "%!PS-Adobe-3.0 EPSF-3.0") {
  ------------------
  |  Branch (524:16): [True: 284, False: 392]
  ------------------
  525|    284|      illustrator8 = true;
  526|   488k|    } else if (posEndComments == posEndEps && line.starts_with("%AI7_Thumbnail:")) {
  ------------------
  |  Branch (526:16): [True: 17.8k, False: 470k]
  |  Branch (526:47): [True: 1.17k, False: 16.7k]
  ------------------
  527|  1.17k|      posAi7Thumbnail = startPos;
  528|   487k|    } else if (posEndComments == posEndEps && posAi7Thumbnail != posEndEps && posAi7ThumbnailEndData == posEndEps &&
  ------------------
  |  Branch (528:16): [True: 16.7k, False: 470k]
  |  Branch (528:47): [True: 3.37k, False: 13.3k]
  |  Branch (528:79): [True: 2.87k, False: 503]
  ------------------
  529|  2.87k|               line == "%%EndData") {
  ------------------
  |  Branch (529:16): [True: 650, False: 2.22k]
  ------------------
  530|    650|      posAi7ThumbnailEndData = startPos;
  531|   486k|    } else if (posEndComments == posEndEps && line == "%%EndComments") {
  ------------------
  |  Branch (531:16): [True: 16.0k, False: 470k]
  |  Branch (531:47): [True: 18, False: 16.0k]
  ------------------
  532|     18|      posEndComments = startPos;
  533|   486k|    } else if (inDefaultsPreviewPrologSetup && line.starts_with("%%BeginResource: procset wCorel")) {
  ------------------
  |  Branch (533:16): [True: 71.9k, False: 414k]
  |  Branch (533:48): [True: 781, False: 71.2k]
  ------------------
  534|    781|      corelDraw = true;
  535|   486k|    } else if (line == "%%EndPreview") {
  ------------------
  |  Branch (535:16): [True: 887, False: 485k]
  ------------------
  536|    887|      inDefaultsPreviewPrologSetup = false;
  537|   485k|    } else if (line == "%%EndDefaults") {
  ------------------
  |  Branch (537:16): [True: 227, False: 484k]
  ------------------
  538|    227|      inDefaultsPreviewPrologSetup = false;
  539|   484k|    } else if (line == "%%EndProlog") {
  ------------------
  |  Branch (539:16): [True: 200, False: 484k]
  ------------------
  540|    200|      inDefaultsPreviewPrologSetup = false;
  541|   484k|    } else if (line == "%%EndSetup") {
  ------------------
  |  Branch (541:16): [True: 194, False: 484k]
  ------------------
  542|    194|      inDefaultsPreviewPrologSetup = false;
  543|   484k|    } else if (posEndPageSetup == posEndEps && line == "%%EndPageSetup") {
  ------------------
  |  Branch (543:16): [True: 48.9k, False: 435k]
  |  Branch (543:48): [True: 21, False: 48.9k]
  ------------------
  544|     21|      posEndPageSetup = startPos;
  545|   484k|    } else if (posPageTrailer == posEndEps && line == "%%PageTrailer") {
  ------------------
  |  Branch (545:16): [True: 472k, False: 12.1k]
  |  Branch (545:47): [True: 63, False: 472k]
  ------------------
  546|     63|      posPageTrailer = startPos;
  547|   484k|    } else if (posBeginPhotoshop == posEndEps && line.starts_with("%BeginPhotoshop:")) {
  ------------------
  |  Branch (547:16): [True: 482k, False: 1.76k]
  |  Branch (547:50): [True: 164, False: 482k]
  ------------------
  548|    164|      posBeginPhotoshop = pos;
  549|   484k|    } else if (posBeginPhotoshop != posEndEps && posEndPhotoshop == posEndEps && line == "%EndPhotoshop") {
  ------------------
  |  Branch (549:16): [True: 1.76k, False: 482k]
  |  Branch (549:50): [True: 1.54k, False: 222]
  |  Branch (549:82): [True: 72, False: 1.47k]
  ------------------
  550|     72|      posEndPhotoshop = startPos;
  551|   484k|    } else if (inRemovableEmbedding && line == removableEmbeddingEndLine) {
  ------------------
  |  Branch (551:16): [True: 280k, False: 203k]
  |  Branch (551:40): [True: 52.7k, False: 227k]
  ------------------
  552|  52.7k|      inRemovableEmbedding = false;
  553|  52.7k|      removableEmbeddings.back().second = pos;
  554|   431k|    } else if (line == "%%EOF") {
  ------------------
  |  Branch (554:16): [True: 21, False: 431k]
  ------------------
  555|     21|      posEof = startPos;
  556|   431k|    } else {
  557|       |#ifdef DEBUG
  558|       |      significantLine = false;
  559|       |#endif
  560|   431k|    }
  561|       |#ifdef DEBUG
  562|       |    if (significantLine) {
  563|       |      EXV_DEBUG << "readWriteEpsMetadata: Found significant line \"" << line << "\" at position: " << startPos << "\n";
  564|       |    }
  565|       |#endif
  566|   490k|  }
  567|       |
  568|       |  // check for unfinished nested documents
  569|  4.79k|  if (depth != 0) {
  ------------------
  |  Branch (569:7): [True: 44, False: 4.74k]
  ------------------
  570|     44|#ifndef SUPPRESS_WARNINGS
  571|     44|    EXV_WARNING << "Unmatched BeginDocument (" << depth << "x)\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()
  ------------------
  572|     44|#endif
  573|     44|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (573:17): [True: 0, False: 44]
  ------------------
  574|     44|  }
  575|       |
  576|       |  // look for the unmarked trailers of some removable XMP embeddings
  577|  4.74k|  size_t posXmpTrailerEnd = posEof;
  578|  4.86k|  for (size_t i = 0; i < removableEmbeddingsWithUnmarkedTrailer; i++) {
  ------------------
  |  Branch (578:22): [True: 568, False: 4.29k]
  ------------------
  579|    568|    std::string line1;
  580|    568|    const size_t posLine1 = readPrevLine(line1, data, posXmpTrailerEnd, posEndEps);
  581|    568|    std::string line2;
  582|    568|    const size_t posLine2 = readPrevLine(line2, data, posLine1, posEndEps);
  583|    568|    size_t posXmpTrailer;
  584|    568|    if (line1 == "[/EMC pdfmark") {  // Exiftool style
  ------------------
  |  Branch (584:9): [True: 117, False: 451]
  ------------------
  585|    117|      posXmpTrailer = posLine1;
  586|    451|    } else if (line1 == "[/NamespacePop pdfmark" &&
  ------------------
  |  Branch (586:16): [True: 38, False: 413]
  ------------------
  587|     38|               line2 ==
  ------------------
  |  Branch (587:16): [True: 1, False: 37]
  ------------------
  588|     38|                   "[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT "
  589|     38|                   "pdfmark") {  // Photoshop style
  590|      1|      posXmpTrailer = posLine2;
  591|    450|    } else {
  592|    450|#ifndef SUPPRESS_WARNINGS
  593|    450|      EXV_WARNING << "Unable to find XMP embedding trailer ending at position: " << posXmpTrailerEnd << "\n";
  ------------------
  |  |  138|    450|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 450]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    450|  LogMsg(LogMsg::warn).os()
  ------------------
  594|    450|#endif
  595|    450|      if (write)
  ------------------
  |  Branch (595:11): [True: 0, False: 450]
  ------------------
  596|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  597|    450|      break;
  598|    450|    }
  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|  4.74k|  std::string line;
  610|  4.74k|  readLine(line, data, posContainsXmp, posEndEps);
  611|  4.74k|  bool containsXmp;
  612|  4.74k|  if (line == "%ADO_ContainsXMP: MainFirst" || line == "%ADO_ContainsXMP:MainFirst") {
  ------------------
  |  Branch (612:7): [True: 771, False: 3.97k]
  |  Branch (612:48): [True: 618, False: 3.35k]
  ------------------
  613|    636|    containsXmp = true;
  614|  4.11k|  } else if (line.empty() || line == "%ADO_ContainsXMP: NoMain" || line == "%ADO_ContainsXMP:NoMain") {
  ------------------
  |  Branch (614:14): [True: 3.87k, False: 232]
  |  Branch (614:30): [True: 10, False: 222]
  |  Branch (614:68): [True: 18, False: 204]
  ------------------
  615|  3.15k|    containsXmp = false;
  616|  3.15k|  } else {
  617|    957|#ifndef SUPPRESS_WARNINGS
  618|    957|    EXV_WARNING << "Invalid line \"" << line << "\" at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|    957|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 957]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    957|  LogMsg(LogMsg::warn).os()
  ------------------
  619|    957|#endif
  620|    957|    throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (620:17): [True: 0, False: 957]
  ------------------
  621|    957|  }
  622|       |
  623|  3.79k|  const bool deleteXmp = (write && xmpPacket.empty());
  ------------------
  |  Branch (623:27): [True: 0, False: 3.79k]
  |  Branch (623:36): [True: 0, False: 0]
  ------------------
  624|  3.79k|  bool fixBeginXmlPacket = false;
  625|  3.79k|  bool useFlexibleEmbedding = false;
  626|  3.79k|  size_t xmpPos = posEndEps;
  627|  3.79k|  size_t xmpSize = 0;
  628|  3.79k|  if (containsXmp) {
  ------------------
  |  Branch (628:7): [True: 636, False: 3.15k]
  ------------------
  629|       |    // search for XMP metadata
  630|    636|    findXmp(xmpPos, xmpSize, data, posEps, posEndEps, write);
  631|    636|    if (xmpPos == posEndEps) {
  ------------------
  |  Branch (631:9): [True: 46, False: 590]
  ------------------
  632|     46|#ifndef SUPPRESS_WARNINGS
  633|     46|      EXV_WARNING << "Unable to find XMP metadata as announced at position: " << posContainsXmp << "\n";
  ------------------
  |  |  138|     46|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     46|  LogMsg(LogMsg::warn).os()
  ------------------
  634|     46|#endif
  635|     46|    }
  636|       |    // check embedding of XMP metadata
  637|    636|    const size_t posLineAfterXmp = readLine(line, data, xmpPos + xmpSize, posEndEps);
  638|    636|    if (!line.empty()) {
  ------------------
  |  Branch (638:9): [True: 477, False: 159]
  ------------------
  639|    477|#ifndef SUPPRESS_WARNINGS
  640|    477|      EXV_WARNING << "Unexpected " << line.size() << " bytes of data after XMP at position: " << (xmpPos + xmpSize)
  ------------------
  |  |  138|    477|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 477]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    477|  LogMsg(LogMsg::warn).os()
  ------------------
  641|      0|                  << "\n";
  642|    477|#endif
  643|    477|    } else if (!deleteXmp) {
  ------------------
  |  Branch (643:16): [True: 123, False: 36]
  ------------------
  644|    123|      readLine(line, data, posLineAfterXmp, posEndEps);
  645|    123|      if (line == "% &&end XMP packet marker&&" || line == "%  &&end XMP packet marker&&") {
  ------------------
  |  Branch (645:11): [True: 26, False: 97]
  |  Branch (645:52): [True: 10, False: 87]
  ------------------
  646|     36|        useFlexibleEmbedding = true;
  647|     36|      }
  648|    123|    }
  649|    636|  }
  650|  3.79k|  if (useFlexibleEmbedding) {
  ------------------
  |  Branch (650:7): [True: 36, False: 3.75k]
  ------------------
  651|       |#ifdef DEBUG
  652|       |    EXV_DEBUG << "readWriteEpsMetadata: Using flexible XMP embedding\n";
  653|       |#endif
  654|     36|    const size_t posBeginXmlPacket = readPrevLine(line, data, xmpPos, posEndEps);
  655|     36|    if (line.starts_with("%begin_xml_packet:")) {
  ------------------
  |  Branch (655:9): [True: 10, False: 26]
  ------------------
  656|       |#ifdef DEBUG
  657|       |      EXV_DEBUG << "readWriteEpsMetadata: XMP embedding contains %begin_xml_packet\n";
  658|       |#endif
  659|     10|      if (write) {
  ------------------
  |  Branch (659:11): [True: 0, False: 10]
  ------------------
  660|      0|        fixBeginXmlPacket = true;
  661|      0|        xmpSize += (xmpPos - posBeginXmlPacket);
  662|      0|        xmpPos = posBeginXmlPacket;
  663|      0|      }
  664|     26|    } else if (posBeginPhotoshop != posEndEps) {
  ------------------
  |  Branch (664:16): [True: 10, False: 16]
  ------------------
  665|     10|#ifndef SUPPRESS_WARNINGS
  666|     10|      EXV_WARNING << "Missing %begin_xml_packet in Photoshop EPS at position: " << xmpPos << "\n";
  ------------------
  |  |  138|     10|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 10]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     10|  LogMsg(LogMsg::warn).os()
  ------------------
  667|     10|#endif
  668|     10|      if (write)
  ------------------
  |  Branch (668:11): [True: 0, False: 10]
  ------------------
  669|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  670|     10|    }
  671|     36|  }
  672|  3.79k|  if (!useFlexibleEmbedding) {
  ------------------
  |  Branch (672:7): [True: 3.71k, False: 72]
  ------------------
  673|       |    // check if there are irremovable XMP metadata blocks before EndPageSetup
  674|  3.71k|    size_t posOtherXmp = containsXmp ? xmpPos : posEps;
  ------------------
  |  Branch (674:26): [True: 564, False: 3.15k]
  ------------------
  675|  3.71k|    size_t sizeOtherXmp = 0;
  676|  6.81k|    for (;;) {
  677|  6.81k|      findXmp(posOtherXmp, sizeOtherXmp, data, posOtherXmp + sizeOtherXmp, posEndPageSetup, write);
  678|  6.81k|      if (posOtherXmp >= posEndPageSetup)
  ------------------
  |  Branch (678:11): [True: 3.30k, False: 3.50k]
  ------------------
  679|  3.30k|        break;
  680|  3.50k|      bool isRemovableEmbedding = false;
  681|   173k|      for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (681:31): [True: 173k, False: 411]
  ------------------
  682|   173k|        if (r <= posOtherXmp && posOtherXmp < s) {
  ------------------
  |  Branch (682:13): [True: 173k, False: 604]
  |  Branch (682:33): [True: 3.09k, False: 170k]
  ------------------
  683|  3.09k|          isRemovableEmbedding = true;
  684|  3.09k|          break;
  685|  3.09k|        }
  686|   173k|      }
  687|  3.50k|      if (!isRemovableEmbedding) {
  ------------------
  |  Branch (687:11): [True: 116, False: 3.39k]
  ------------------
  688|    116|#ifndef SUPPRESS_WARNINGS
  689|    116|        EXV_WARNING << "XMP metadata block is not removable at position: " << posOtherXmp << "\n";
  ------------------
  |  |  138|    116|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 116]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    116|  LogMsg(LogMsg::warn).os()
  ------------------
  690|    116|#endif
  691|    116|        if (write)
  ------------------
  |  Branch (691:13): [True: 0, False: 116]
  ------------------
  692|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  693|    116|        break;
  694|    116|      }
  695|  3.50k|    }
  696|  3.71k|  }
  697|       |
  698|  3.79k|  if (!write) {
  ------------------
  |  Branch (698:7): [True: 3.45k, False: 331]
  ------------------
  699|       |    // copy XMP metadata
  700|  3.45k|    xmpPacket.assign(reinterpret_cast<const char*>(data + xmpPos), xmpSize);
  701|       |
  702|       |    // native previews
  703|  3.45k|    nativePreviews.clear();
  704|  3.45k|    if (posAi7ThumbnailEndData != posEndEps) {
  ------------------
  |  Branch (704:9): [True: 650, False: 2.80k]
  ------------------
  705|    650|      NativePreview nativePreview;
  706|    650|      std::string dummy;
  707|    650|      std::string lineAi7Thumbnail;
  708|    650|      const size_t posBeginData = readLine(lineAi7Thumbnail, data, posAi7Thumbnail, posEndEps);
  709|    650|      std::istringstream lineStreamAi7Thumbnail(lineAi7Thumbnail);
  710|    650|      lineStreamAi7Thumbnail >> dummy;
  711|    650|      lineStreamAi7Thumbnail >> nativePreview.width_;
  712|    650|      lineStreamAi7Thumbnail >> nativePreview.height_;
  713|    650|      std::string depthStr;
  714|    650|      lineStreamAi7Thumbnail >> depthStr;
  715|    650|      std::string lineBeginData;
  716|    650|      const size_t posAfterBeginData = readLine(lineBeginData, data, posBeginData, posEndEps);
  717|    650|      std::istringstream lineStreamBeginData(lineBeginData);
  718|    650|      std::string beginData;
  719|    650|      lineStreamBeginData >> beginData;
  720|    650|      lineStreamBeginData >> dummy;
  721|    650|      std::string type;
  722|    650|      lineStreamBeginData >> type;
  723|    650|      nativePreview.position_ = static_cast<long>(posAfterBeginData);
  724|    650|      nativePreview.size_ = static_cast<uint32_t>(posAi7ThumbnailEndData - posAfterBeginData);
  725|    650|      nativePreview.filter_ = "hex-ai7thumbnail-pnm";
  726|    650|      nativePreview.mimeType_ = "image/x-portable-anymap";
  727|    650|      if (depthStr != "8") {
  ------------------
  |  Branch (727:11): [True: 234, False: 416]
  ------------------
  728|    234|#ifndef SUPPRESS_WARNINGS
  729|    234|        EXV_WARNING << "Unable to handle Illustrator thumbnail depth: " << depthStr << "\n";
  ------------------
  |  |  138|    234|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 234]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    234|  LogMsg(LogMsg::warn).os()
  ------------------
  730|    234|#endif
  731|    416|      } else if (beginData != "%%BeginData:") {
  ------------------
  |  Branch (731:18): [True: 71, False: 345]
  ------------------
  732|     71|#ifndef SUPPRESS_WARNINGS
  733|     71|        EXV_WARNING << "Unable to handle Illustrator thumbnail data section: " << lineBeginData << "\n";
  ------------------
  |  |  138|     71|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 71]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     71|  LogMsg(LogMsg::warn).os()
  ------------------
  734|     71|#endif
  735|    345|      } else if (type != "Hex") {
  ------------------
  |  Branch (735:18): [True: 76, False: 269]
  ------------------
  736|     76|#ifndef SUPPRESS_WARNINGS
  737|     76|        EXV_WARNING << "Unable to handle Illustrator thumbnail data type: " << type << "\n";
  ------------------
  |  |  138|     76|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 76]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     76|  LogMsg(LogMsg::warn).os()
  ------------------
  738|     76|#endif
  739|    269|      } else {
  740|    269|        nativePreviews.push_back(std::move(nativePreview));
  741|    269|      }
  742|    650|    }
  743|  3.45k|    if (posEndPhotoshop != posEndEps) {
  ------------------
  |  Branch (743:9): [True: 72, False: 3.38k]
  ------------------
  744|     72|      auto sizePhotoshop = posEndPhotoshop - posBeginPhotoshop;
  745|     72|      NativePreview nativePreview{posBeginPhotoshop, sizePhotoshop, 0, 0, "hex-irb", "image/jpeg"};
  746|     72|      nativePreviews.push_back(std::move(nativePreview));
  747|     72|    }
  748|  3.45k|    if (sizeWmf != 0) {
  ------------------
  |  Branch (748:9): [True: 12, False: 3.44k]
  ------------------
  749|     12|      NativePreview nativePreview{posWmf, sizeWmf, 0, 0, "", "image/x-wmf"};
  750|     12|      nativePreviews.push_back(std::move(nativePreview));
  751|     12|    }
  752|  3.45k|    if (sizeTiff != 0) {
  ------------------
  |  Branch (752:9): [True: 13, False: 3.44k]
  ------------------
  753|     13|      NativePreview nativePreview{posTiff, sizeTiff, 0, 0, "", "image/tiff"};
  754|     13|      nativePreviews.push_back(std::move(nativePreview));
  755|     13|    }
  756|  3.45k|  } else {
  757|       |    // check for Adobe Illustrator 8.0 or older
  758|    331|    if (illustrator8) {
  ------------------
  |  Branch (758:9): [True: 0, False: 331]
  ------------------
  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|    331|    MemIo tempIo;
  767|    331|    if (!tempIo.isopen()) {
  ------------------
  |  Branch (767:9): [True: 0, False: 331]
  ------------------
  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|    331|    std::vector<size_t> positions;
  779|    331|    positions.push_back(posLanguageLevel);
  780|    331|    positions.push_back(posContainsXmp);
  781|    331|    positions.push_back(posPages);
  782|    331|    positions.push_back(posExiv2Version);
  783|    331|    positions.push_back(posExiv2Website);
  784|    331|    positions.push_back(posEndComments);
  785|    331|    positions.push_back(posPage);
  786|    331|    positions.push_back(posBeginPageSetup);
  787|    331|    positions.push_back(posEndPageSetup);
  788|    331|    positions.push_back(posPageTrailer);
  789|    331|    positions.push_back(posEof);
  790|    331|    positions.push_back(posEndEps);
  791|    331|    if (useFlexibleEmbedding) {
  ------------------
  |  Branch (791:9): [True: 0, False: 331]
  ------------------
  792|      0|      positions.push_back(xmpPos);
  793|      0|    }
  794|    331|    for (const auto& [r, s] : removableEmbeddings) {
  ------------------
  |  Branch (794:29): [True: 0, False: 331]
  ------------------
  795|      0|      positions.push_back(r);
  796|      0|    }
  797|    331|    std::sort(positions.begin(), positions.end());
  798|       |
  799|       |    // assemble result EPS document
  800|    331|    if (dosEps) {
  ------------------
  |  Branch (800:9): [True: 0, False: 331]
  ------------------
  801|       |      // DOS EPS header will be written afterwards
  802|      0|      writeTemp(tempIo, std::string(30, '\x00'));
  803|      0|    }
  804|    331|    const std::string containsXmpLine = deleteXmp ? "%ADO_ContainsXMP: NoMain" : "%ADO_ContainsXMP: MainFirst";
  ------------------
  |  Branch (804:41): [True: 0, False: 331]
  ------------------
  805|    331|    const uint32_t posEpsNew = posTemp(tempIo);
  806|    331|    size_t prevPos = posEps;
  807|    331|    size_t prevSkipPos = prevPos;
  808|    331|    for (const auto& pos : positions) {
  ------------------
  |  Branch (808:26): [True: 0, False: 331]
  ------------------
  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|    331|    const uint32_t posEndEpsNew = posTemp(tempIo);
  986|       |#ifdef DEBUG
  987|       |    EXV_DEBUG << "readWriteEpsMetadata: New EPS size: " << (posEndEpsNew - posEpsNew) << "\n";
  988|       |#endif
  989|    331|    if (dosEps) {
  ------------------
  |  Branch (989:9): [True: 0, False: 331]
  ------------------
  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|    331|    io.close();
 1017|    331|    io.transfer(tempIo);
 1018|    331|  }
 1019|  3.79k|}
epsimage.cpp:_ZN12_GLOBAL__N_18readLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  117|   709k|size_t readLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  118|   709k|  line.clear();
  119|   709k|  size_t pos = startPos;
  120|       |  // step through line
  121|  66.1M|  while (pos < size && data[pos] != '\r' && data[pos] != '\n') {
  ------------------
  |  Branch (121:10): [True: 66.1M, False: 7.28k]
  |  Branch (121:24): [True: 65.7M, False: 390k]
  |  Branch (121:45): [True: 65.4M, False: 311k]
  ------------------
  122|  65.4M|    line += data[pos];
  123|  65.4M|    pos++;
  124|  65.4M|  }
  125|       |  // skip line ending, if present
  126|   709k|  if (pos >= size)
  ------------------
  |  Branch (126:7): [True: 7.28k, False: 702k]
  ------------------
  127|  7.28k|    return pos;
  128|   702k|  pos++;
  129|   702k|  if (pos >= size)
  ------------------
  |  Branch (129:7): [True: 718, False: 701k]
  ------------------
  130|    718|    return pos;
  131|   701k|  if (data[pos - 1] == '\r' && data[pos] == '\n')
  ------------------
  |  Branch (131:7): [True: 390k, False: 311k]
  |  Branch (131:32): [True: 2.73k, False: 387k]
  ------------------
  132|  2.73k|    pos++;
  133|   701k|  return pos;
  134|   702k|}
epsimage.cpp:_ZN12_GLOBAL__N_115onlyWhitespacesERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  110|  4.61k|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|  4.61k|  return s.find_first_not_of(" \t") == std::string::npos;
  114|  4.61k|}
epsimage.cpp:_ZN12_GLOBAL__N_112readPrevLineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKhmm:
  137|  1.17k|size_t readPrevLine(std::string& line, const byte* data, size_t startPos, size_t size) {
  138|  1.17k|  line.clear();
  139|  1.17k|  size_t pos = startPos;
  140|  1.17k|  if (pos > size)
  ------------------
  |  Branch (140:7): [True: 0, False: 1.17k]
  ------------------
  141|      0|    return pos;
  142|       |  // skip line ending of previous line, if present
  143|  1.17k|  if (pos <= 0)
  ------------------
  |  Branch (143:7): [True: 0, False: 1.17k]
  ------------------
  144|      0|    return pos;
  145|  1.17k|  if (data[pos - 1] == '\r' || data[pos - 1] == '\n') {
  ------------------
  |  Branch (145:7): [True: 562, False: 610]
  |  Branch (145:32): [True: 228, False: 382]
  ------------------
  146|    790|    pos--;
  147|    790|    if (pos <= 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 790]
  ------------------
  148|      0|      return pos;
  149|    790|    if (data[pos - 1] == '\r' && data[pos] == '\n') {
  ------------------
  |  Branch (149:9): [True: 125, False: 665]
  |  Branch (149:34): [True: 25, False: 100]
  ------------------
  150|     25|      pos--;
  151|     25|      if (pos <= 0)
  ------------------
  |  Branch (151:11): [True: 0, False: 25]
  ------------------
  152|      0|        return pos;
  153|     25|    }
  154|    790|  }
  155|       |  // step through previous line
  156|  4.51M|  while (pos >= 1 && data[pos - 1] != '\r' && data[pos - 1] != '\n') {
  ------------------
  |  Branch (156:10): [True: 4.51M, False: 14]
  |  Branch (156:22): [True: 4.51M, False: 763]
  |  Branch (156:47): [True: 4.51M, False: 395]
  ------------------
  157|  4.51M|    pos--;
  158|  4.51M|    line += data[pos];
  159|  4.51M|  }
  160|  1.17k|  std::reverse(line.begin(), line.end());
  161|  1.17k|  return pos;
  162|  1.17k|}
epsimage.cpp:_ZN12_GLOBAL__N_17findXmpERmS0_PKhmmb:
  165|  7.45k|void findXmp(size_t& xmpPos, size_t& xmpSize, const byte* data, size_t startPos, size_t size, bool write) {
  166|       |  // search for valid XMP header
  167|  7.45k|  xmpSize = 0;
  168|  15.5M|  for (xmpPos = startPos; xmpPos < size; xmpPos++) {
  ------------------
  |  Branch (168:27): [True: 15.5M, False: 3.35k]
  ------------------
  169|  15.5M|    if (data[xmpPos] != '\x00' && data[xmpPos] != '<')
  ------------------
  |  Branch (169:9): [True: 15.1M, False: 464k]
  |  Branch (169:35): [True: 15.0M, False: 35.7k]
  ------------------
  170|  15.0M|      continue;
  171|  3.98M|    for (auto&& header : xmpHeaders) {
  ------------------
  |  Branch (171:24): [True: 3.98M, False: 496k]
  ------------------
  172|  3.98M|      if (xmpPos + header.size() > size)
  ------------------
  |  Branch (172:11): [True: 67.8k, False: 3.91M]
  ------------------
  173|  67.8k|        continue;
  174|  3.91M|      if (memcmp(data + xmpPos, header.data(), header.size()) != 0)
  ------------------
  |  Branch (174:11): [True: 3.91M, False: 4.09k]
  ------------------
  175|  3.91M|        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|  26.4M|      for (size_t trailerPos = xmpPos + header.size(); trailerPos < size; trailerPos++) {
  ------------------
  |  Branch (181:56): [True: 26.4M, False: 206]
  ------------------
  182|  26.4M|        if (data[trailerPos] != '\x00' && data[trailerPos] != '<')
  ------------------
  |  Branch (182:13): [True: 26.2M, False: 141k]
  |  Branch (182:43): [True: 26.2M, False: 44.4k]
  ------------------
  183|  26.2M|          continue;
  184|   742k|        for (const auto& [trailer, readOnly] : xmpTrailers) {
  ------------------
  |  Branch (184:46): [True: 742k, False: 181k]
  ------------------
  185|   742k|          if (trailerPos + trailer.size() > size)
  ------------------
  |  Branch (185:15): [True: 3.08k, False: 739k]
  ------------------
  186|  3.08k|            continue;
  187|   739k|          if (memcmp(data + trailerPos, trailer.data(), trailer.size()) != 0)
  ------------------
  |  Branch (187:15): [True: 735k, False: 3.89k]
  ------------------
  188|   735k|            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: 37, False: 3.85k]
  ------------------
  194|     37|#ifndef SUPPRESS_WARNINGS
  195|     37|            EXV_WARNING << "Unable to handle read-only XMP metadata yet. Please provide your "
  ------------------
  |  |  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()
  ------------------
  196|      0|                           "sample EPS file to the Exiv2 project: http://dev.exiv2.org/projects/exiv2\n";
  197|     37|#endif
  198|     37|            throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (198:25): [True: 0, False: 37]
  ------------------
  199|     37|          }
  200|       |
  201|       |          // search for end of XMP trailer
  202|   931k|          for (size_t trailerEndPos = trailerPos + trailer.size(); trailerEndPos + xmpTrailerEnd.size() <= size;
  ------------------
  |  Branch (202:68): [True: 930k, False: 88]
  ------------------
  203|   930k|               trailerEndPos++) {
  204|   930k|            if (memcmp(data + trailerEndPos, xmpTrailerEnd.data(), xmpTrailerEnd.size()) == 0) {
  ------------------
  |  Branch (204:17): [True: 3.76k, False: 927k]
  ------------------
  205|  3.76k|              xmpSize = (trailerEndPos + xmpTrailerEnd.size()) - xmpPos;
  206|  3.76k|              return;
  207|  3.76k|            }
  208|   930k|          }
  209|     88|#ifndef SUPPRESS_WARNINGS
  210|     88|          EXV_WARNING << "Found XMP header but incomplete XMP trailer.\n";
  ------------------
  |  |  138|     88|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 88]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     88|  LogMsg(LogMsg::warn).os()
  ------------------
  211|     88|#endif
  212|     88|          throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (212:23): [True: 0, False: 88]
  ------------------
  213|  3.85k|        }
  214|   185k|      }
  215|    206|#ifndef SUPPRESS_WARNINGS
  216|    206|      EXV_WARNING << "Found XMP header but no XMP trailer.\n";
  ------------------
  |  |  138|    206|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 206]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    206|  LogMsg(LogMsg::warn).os()
  ------------------
  217|    206|#endif
  218|    206|      throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (218:19): [True: 0, False: 206]
  ------------------
  219|  4.09k|    }
  220|   500k|  }
  221|  7.45k|}

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

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

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

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

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

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

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  43.0k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  43.0k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 38.4k, False: 4.60k]
  ------------------
   58|  38.4k|    value_ = pValue->clone();
   59|  43.0k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|  31.3k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|  31.3k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 31.3k, False: 0]
  ------------------
   63|  31.3k|    key_ = rhs.key_->clone();  // deep copy
   64|  31.3k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 31.3k, False: 0]
  ------------------
   65|  31.3k|    value_ = rhs.value_->clone();  // deep copy
   66|  31.3k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|  74.4k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   106k|uint16_t Iptcdatum::record() const {
   87|   106k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 106k, False: 0]
  ------------------
   88|   106k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   287k|uint16_t Iptcdatum::tag() const {
  111|   287k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 287k, False: 0]
  ------------------
  112|   287k|}
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.36k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.36k|  setValue(value);
  188|  1.36k|  return *this;
  189|  1.36k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  4.79k|int Iptcdatum::setValue(const std::string& value) {
  203|  4.79k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 4.60k, False: 187]
  ------------------
  204|  4.60k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  4.60k|    value_ = Value::create(type);
  206|  4.60k|  }
  207|  4.79k|  return value_->read(value);
  208|  4.79k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.36k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.36k|  IptcKey iptcKey(key);
  212|  1.36k|  auto pos = findKey(iptcKey);
  213|  1.36k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.18k, False: 187]
  ------------------
  214|  1.18k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.18k|  }
  216|    187|  return *pos;
  217|  1.36k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  38.4k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  38.4k|  return add(Iptcdatum(key, value));
  236|  38.4k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  41.9k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  41.9k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 30.3k, False: 11.5k]
  |  Branch (239:7): [True: 27.3k, False: 14.5k]
  ------------------
  240|  30.3k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 27.3k, False: 3.05k]
  ------------------
  241|  27.3k|    return 6;
  242|  27.3k|  }
  243|       |  // allow duplicates
  244|  14.5k|  iptcMetadata_.push_back(iptcDatum);
  245|  14.5k|  return 0;
  246|  41.9k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  2.33k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  2.33k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  2.33k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  30.3k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  30.3k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  30.3k|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  2.94k|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|  2.94k|  auto pRead = pData;
  367|  2.94k|  const auto pEnd = pData + size;
  368|  2.94k|  iptcData.clear();
  369|       |
  370|  2.94k|  uint16_t record = 0;
  371|  2.94k|  uint16_t dataSet = 0;
  372|  2.94k|  uint32_t sizeData = 0;
  373|  2.94k|  byte extTest = 0;
  374|       |
  375|  1.68M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.67M, False: 1.98k]
  ------------------
  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.67M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.64M, False: 39.4k]
  ------------------
  380|  1.64M|      continue;
  381|  39.4k|    record = *pRead++;
  382|  39.4k|    dataSet = *pRead++;
  383|       |
  384|  39.4k|    extTest = *pRead;
  385|  39.4k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 2.34k, False: 37.1k]
  ------------------
  386|       |      // extended dataset
  387|  2.34k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  2.34k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 363, False: 1.97k]
  ------------------
  389|    363|        return 5;
  390|  1.97k|      pRead += 2;
  391|  1.97k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 36, False: 1.94k]
  ------------------
  392|     36|        return 6;
  393|  1.94k|      sizeData = 0;
  394|  4.74k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 2.80k, False: 1.94k]
  ------------------
  395|  2.80k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  2.80k|      }
  397|  37.1k|    } else {
  398|       |      // standard dataset
  399|  37.1k|      sizeData = getUShort(pRead, bigEndian);
  400|  37.1k|      pRead += 2;
  401|  37.1k|    }
  402|  39.0k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 38.4k, False: 563]
  ------------------
  403|  38.4k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  38.4k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 38.4k]
  ------------------
  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|  38.4k|    } else {
  410|    563|#ifndef SUPPRESS_WARNINGS
  411|    563|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    563|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 563]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    563|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    563|#endif
  413|    563|      return 7;
  414|    563|    }
  415|  38.4k|    pRead += sizeData;
  416|  38.4k|  }
  417|       |
  418|  1.98k|  return 0;
  419|  2.94k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  5.65k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  5.65k|  DataBuf buf;
  423|  5.65k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 5.65k, False: 0]
  ------------------
  424|  5.65k|    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|  5.65k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   210k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   210k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 29.2k, False: 180k]
  |  Branch (42:43): [True: 27.5k, False: 1.69k]
  ------------------
   43|   210k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  32.7k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  32.7k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  38.4k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  38.4k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  38.4k|  auto value = Exiv2::Value::create(type);
  466|  38.4k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  38.4k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 14.7k, False: 23.7k]
  ------------------
  468|  14.7k|    Exiv2::IptcKey key(dataSet, record);
  469|  14.7k|    iptcData.add(key, value.get());
  470|  23.7k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 23.7k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  23.7k|    value = Exiv2::Value::create(Exiv2::string);
  473|  23.7k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  23.7k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 23.7k, False: 0]
  ------------------
  475|  23.7k|      Exiv2::IptcKey key(dataSet, record);
  476|  23.7k|      iptcData.add(key, value.get());
  477|  23.7k|    }
  478|  23.7k|  }
  479|  38.4k|  return rc;
  480|  38.4k|}

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    242|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|    242|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 18, False: 224]
  |  Branch (15:29): [True: 19, False: 205]
  ------------------
   16|     37|    return false;
   17|     37|  }
   18|       |
   19|    205|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    205|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    205|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    205|  bool clWithRightBrand = false;
   24|  5.34k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 5.20k, False: 137]
  ------------------
   25|  5.20k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  5.20k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 803, False: 4.40k]
  |  Branch (26:31): [True: 39, False: 764]
  |  Branch (26:66): [True: 420, False: 4.74k]
  |  Branch (26:87): [True: 29, False: 391]
  ------------------
   27|     68|      clWithRightBrand = true;
   28|     68|      break;
   29|     68|    }
   30|  5.20k|  }
   31|    205|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 58, False: 147]
  |  Branch (31:32): [True: 31, False: 27]
  ------------------
   32|    242|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  2.17k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  2.17k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 2.17k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  2.17k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  27.7k|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  27.7k|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|   997k|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 970k, False: 26.5k]
  ------------------
  138|   970k|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 1.17k, False: 969k]
  ------------------
  139|  1.17k|      throw Error(err);
  140|   970k|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  29.8k|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 3.33k, False: 26.5k]
  ------------------
  144|  3.33k|  }
  145|  26.5k|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 202, False: 26.3k]
  ------------------
  146|    202|    throw Error(err);
  147|       |
  148|  26.3k|  return static_cast<byte>(c);
  149|  26.5k|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  2.17k|void JpegBase::readMetadata() {
  152|  2.17k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  2.17k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 2.17k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  2.17k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  2.17k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 167, False: 2.01k]
  ------------------
  159|    167|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 167]
  |  Branch (159:25): [True: 0, False: 167]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|    167|    throw Error(ErrorCode::kerNotAJpeg);
  162|    167|  }
  163|  2.01k|  clearMetadata();
  164|  2.01k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  2.01k|  Blob psBlob;
  166|  2.01k|  bool foundCompletePsData = false;
  167|  2.01k|  bool foundExifData = false;
  168|  2.01k|  bool foundXmpData = false;
  169|  2.01k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  2.01k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|  26.4k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 26.2k, False: 153]
  |  Branch (174:28): [True: 26.2k, False: 44]
  |  Branch (174:46): [True: 26.1k, False: 36]
  ------------------
  175|  26.1k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|  26.1k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|  26.1k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 19.0k, False: 7.11k]
  ------------------
  181|  19.0k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  19.0k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  19.0k|    }
  184|       |
  185|  26.1k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 3.48k, False: 22.7k]
  ------------------
  186|  3.48k|      sof_encoding_process_ = itSofMarker->label_;
  187|  3.48k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 1.56k, False: 1.91k]
  |  Branch (187:24): [True: 1.18k, False: 386]
  ------------------
  188|  1.18k|        num_color_components_ = *buf.c_data(7);
  189|  1.18k|      }
  190|  3.48k|    }
  191|       |
  192|  26.1k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 25.3k, False: 813]
  |  Branch (192:27): [True: 1.11k, False: 24.2k]
  |  Branch (192:46): [True: 629, False: 484]
  ------------------
  193|    629|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 77, False: 552]
  ------------------
  194|     77|      const DecodeParams dp(max_recursion_depth_);
  195|     77|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8, dp);
  196|     77|      setByteOrder(bo);
  197|     77|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (197:11): [True: 30, False: 47]
  |  Branch (197:23): [True: 0, False: 30]
  ------------------
  198|      0|#ifndef SUPPRESS_WARNINGS
  199|      0|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  200|      0|#endif
  201|      0|        exifData_.clear();
  202|      0|      }
  203|     77|      --search;
  204|     77|      foundExifData = true;
  205|  26.1k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (205:16): [True: 25.4k, False: 680]
  |  Branch (205:33): [True: 1.04k, False: 24.3k]
  |  Branch (205:52): [True: 302, False: 741]
  ------------------
  206|    302|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (206:19): [True: 50, False: 252]
  ------------------
  207|     50|      xmpPacket_.assign(buf.c_str(31), size - 31);
  208|     50|      const DecodeParams dp(max_recursion_depth_);
  209|     50|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (209:11): [True: 40, False: 10]
  |  Branch (209:34): [True: 34, False: 6]
  ------------------
  210|     34|#ifndef SUPPRESS_WARNINGS
  211|     34|        EXV_WARNING << "Failed to decode XMP metadata.\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()
  ------------------
  212|     34|#endif
  213|     34|      }
  214|     50|      --search;
  215|     50|      foundXmpData = true;
  216|  26.0k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (216:16): [True: 25.5k, False: 523]
  |  Branch (216:40): [True: 12.9k, False: 12.5k]
  ------------------
  217|  12.9k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (217:16): [True: 12.5k, False: 355]
  ------------------
  218|  12.5k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (218:19): [True: 10.5k, False: 2.07k]
  ------------------
  219|       |#ifdef EXIV2_DEBUG_MESSAGES
  220|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  221|       |#endif
  222|  10.5k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (222:11): [True: 6.97k, False: 3.54k]
  ------------------
  223|  6.97k|        append(psBlob, buf.c_data(16), size - 16);
  224|  6.97k|      }
  225|       |      // Check whether psBlob is complete
  226|  10.5k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (226:11): [True: 10.3k, False: 198]
  |  Branch (226:30): [True: 144, False: 10.1k]
  ------------------
  227|    144|        --search;
  228|    144|        foundCompletePsData = true;
  229|    144|      }
  230|  15.5k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (230:16): [True: 926, False: 14.6k]
  |  Branch (230:34): [True: 505, False: 421]
  ------------------
  231|       |      // JPEGs can have multiple comments, but for now only read
  232|       |      // the first one (most jpegs only have one anyway). Comments
  233|       |      // are simple single byte ISO-8859-1 strings.
  234|    505|      comment_.assign(buf.c_str(2), size - 2);
  235|  1.92k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (235:14): [True: 1.56k, False: 361]
  |  Branch (235:35): [True: 1.42k, False: 144]
  ------------------
  236|  1.42k|        comment_.pop_back();
  237|  1.42k|      }
  238|    505|      --search;
  239|  15.0k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (239:16): [True: 1.59k, False: 13.4k]
  |  Branch (239:35): [True: 1.34k, False: 252]
  ------------------
  240|  1.34k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (240:19): [True: 970, False: 375]
  ------------------
  241|    970|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (241:11): [True: 22, False: 948]
  ------------------
  242|     22|        rc = 8;
  243|     22|        break;
  244|     22|      }
  245|       |      // ICC profile
  246|    948|      if (!foundIccData) {
  ------------------
  |  Branch (246:11): [True: 131, False: 817]
  ------------------
  247|    131|        foundIccData = true;
  248|    131|        --search;
  249|    131|      }
  250|    948|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  251|    948|      auto chunks = static_cast<int>(buf.read_uint8(2 + 13));
  252|       |      // ICC1v43_2010-12.pdf header is 14 bytes
  253|       |      // header = "ICC_PROFILE\0" (12 bytes)
  254|       |      // chunk/chunks are a single byte
  255|       |      // Spec 7.2 Profile bytes 0-3 size
  256|    948|      uint32_t s = buf.read_uint32(2 + 14, bigEndian);
  257|       |#ifdef EXIV2_DEBUG_MESSAGES
  258|       |      std::cerr << "Found ICC Profile chunk " << chunk << " of " << chunks << (chunk == 1 ? " size: " : "")
  259|       |                << (chunk == 1 ? s : 0) << '\n';
  260|       |#endif
  261|       |      // #1286 profile can be padded
  262|    948|      size_t icc_size = size - 2 - 14;
  263|    948|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (263:11): [True: 462, False: 486]
  |  Branch (263:25): [True: 248, False: 214]
  ------------------
  264|    248|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  265|    248|        icc_size = s;
  266|    248|      }
  267|       |
  268|    948|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  269|  14.0k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (269:16): [True: 10.6k, False: 3.42k]
  |  Branch (269:37): [True: 597, False: 10.0k]
  ------------------
  270|       |      // We hit a SOFn (start-of-frame) marker
  271|    597|      if (size < 8) {
  ------------------
  |  Branch (271:11): [True: 53, False: 544]
  ------------------
  272|     53|        rc = 7;
  273|     53|        break;
  274|     53|      }
  275|    544|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  276|    544|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  277|    544|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (277:11): [True: 220, False: 324]
  ------------------
  278|    220|        --search;
  279|    544|    }
  280|       |
  281|       |    // Read the beginning of the next segment
  282|  26.1k|    try {
  283|  26.1k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  284|  26.1k|    } catch (const Error&) {
  285|  1.31k|      rc = 5;
  286|  1.31k|      break;
  287|  1.31k|    }
  288|  26.1k|  }  // while there are segments to process
  289|       |
  290|  1.61k|  if (!psBlob.empty()) {
  ------------------
  |  Branch (290:7): [True: 524, False: 1.09k]
  ------------------
  291|       |    // Find actual IPTC data within the psBlob
  292|    524|    Blob iptcBlob;
  293|    524|    const byte* record = nullptr;
  294|    524|    uint32_t sizeIptc = 0;
  295|    524|    uint32_t sizeHdr = 0;
  296|    524|    const byte* pCur = psBlob.data();
  297|    524|    const byte* pEnd = pCur + psBlob.size();
  298|    672|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (298:12): [True: 646, False: 26]
  |  Branch (298:27): [True: 148, False: 498]
  ------------------
  299|       |#ifdef EXIV2_DEBUG_MESSAGES
  300|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  301|       |#endif
  302|    148|      if (sizeIptc) {
  ------------------
  |  Branch (302:11): [True: 116, False: 32]
  ------------------
  303|    116|        append(iptcBlob, record + sizeHdr, sizeIptc);
  304|    116|      }
  305|    148|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  306|    148|    }
  307|    524|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (307:9): [True: 111, False: 413]
  |  Branch (307:30): [True: 49, False: 62]
  ------------------
  308|     49|#ifndef SUPPRESS_WARNINGS
  309|     49|      EXV_WARNING << "Failed to decode IPTC 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()
  ------------------
  310|     49|#endif
  311|     49|      iptcData_.clear();
  312|     49|    }
  313|    524|  }
  314|       |
  315|  1.61k|  if (rc != 0) {
  ------------------
  |  Branch (315:7): [True: 1.38k, False: 233]
  ------------------
  316|  1.38k|#ifndef SUPPRESS_WARNINGS
  317|  1.38k|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|  1.38k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.38k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.38k|  LogMsg(LogMsg::warn).os()
  ------------------
  318|  1.38k|#endif
  319|  1.38k|  }
  320|  1.61k|}  // JpegBase::readMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  971|  2.12k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  972|  2.12k|}
_ZNK5Exiv29JpegImage8mimeTypeEv:
  974|  2.31k|std::string JpegImage::mimeType() const {
  975|  2.31k|  return "image/jpeg";
  976|  2.31k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  990|  2.12k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  991|  2.12k|  return isJpegType(iIo, advance);
  992|  2.12k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  994|  1.90k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  995|  1.90k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  996|  1.90k|  if (!image->good()) {
  ------------------
  |  Branch (996:7): [True: 0, False: 1.90k]
  ------------------
  997|      0|    return nullptr;
  998|      0|  }
  999|  1.90k|  return image;
 1000|  1.90k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1002|  59.5k|bool isJpegType(BasicIo& iIo, bool advance) {
 1003|  59.5k|  bool result = true;
 1004|  59.5k|  byte tmpBuf[2];
 1005|  59.5k|  iIo.read(tmpBuf, 2);
 1006|  59.5k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1006:7): [True: 0, False: 59.5k]
  |  Branch (1006:22): [True: 41, False: 59.5k]
  ------------------
 1007|     41|    return false;
 1008|       |
 1009|  59.5k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1009:7): [True: 53.4k, False: 6.11k]
  |  Branch (1009:28): [True: 339, False: 5.77k]
  ------------------
 1010|  53.7k|    result = false;
 1011|  53.7k|  }
 1012|  59.5k|  if (!advance || !result)
  ------------------
  |  Branch (1012:7): [True: 57.4k, False: 2.12k]
  |  Branch (1012:19): [True: 167, False: 1.96k]
  ------------------
 1013|  57.5k|    iIo.seek(-2, BasicIo::cur);
 1014|  59.5k|  return result;
 1015|  59.5k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1018|     48|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1019|     48|}
_ZNK5Exiv28ExvImage8mimeTypeEv:
 1021|      6|std::string ExvImage::mimeType() const {
 1022|      6|  return "image/x-exv";
 1023|      6|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1036|     48|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1037|     48|  return isExvType(iIo, advance);
 1038|     48|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1040|     48|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1041|     48|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1042|     48|  if (!image->good())
  ------------------
  |  Branch (1042:7): [True: 0, False: 48]
  ------------------
 1043|      0|    return nullptr;
 1044|     48|  return image;
 1045|     48|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1047|  53.7k|bool isExvType(BasicIo& iIo, bool advance) {
 1048|  53.7k|  bool result = true;
 1049|  53.7k|  byte tmpBuf[7];
 1050|  53.7k|  iIo.read(tmpBuf, 7);
 1051|  53.7k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1051:7): [True: 0, False: 53.7k]
  |  Branch (1051:22): [True: 114, False: 53.6k]
  ------------------
 1052|    114|    return false;
 1053|       |
 1054|  53.6k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1054:7): [True: 53.2k, False: 375]
  |  Branch (1054:28): [True: 170, False: 205]
  |  Branch (1054:49): [True: 61, False: 144]
  ------------------
 1055|  53.4k|    result = false;
 1056|  53.4k|  }
 1057|  53.6k|  if (!advance || !result)
  ------------------
  |  Branch (1057:7): [True: 53.5k, False: 48]
  |  Branch (1057:19): [True: 0, False: 48]
  ------------------
 1058|  53.5k|    iIo.seek(-7, BasicIo::cur);
 1059|  53.6k|  return result;
 1060|  53.7k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  26.1k|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  26.1k|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  26.1k|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  26.1k|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 21.7k, False: 4.47k]
  ------------------
  107|  21.7k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|  21.7k|    size = getUShort(buf.data(), bigEndian);
  109|  21.7k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|  21.7k|  }
  111|  26.1k|  return {buf, size};
  112|  26.1k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  10.6k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  10.6k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 213, False: 10.4k]
  |  Branch (92:38): [True: 384, False: 10.0k]
  ------------------
   93|  10.6k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  21.0k|constexpr bool inRange(int lo, int value, int hi) {
   88|  21.0k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 19.2k, False: 1.82k]
  |  Branch (88:25): [True: 597, False: 18.6k]
  ------------------
   89|  21.0k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  26.1k|bool markerHasLength(byte m) {
   99|  26.1k|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 21.2k, False: 4.97k]
  |  Branch (99:44): [True: 4.47k, False: 16.7k]
  ------------------
  100|  26.1k|  return !markerWithoutLength;
  101|  26.1k|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.57k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.57k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  9.58k|std::string MatroskaVideo::mimeType() const {
  604|  9.58k|  return "video/matroska";
  605|  9.58k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.57k|void MatroskaVideo::readMetadata() {
  611|  3.57k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.57k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.57k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.57k]
  ------------------
  616|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  618|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  619|      0|  }
  620|       |
  621|  3.57k|  IoCloser closer(*io_);
  622|  3.57k|  clearMetadata();
  623|  3.57k|  continueTraversing_ = true;
  624|  3.57k|  height_ = width_ = 1;
  625|       |
  626|  3.57k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.57k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|  84.2k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 80.7k, False: 3.57k]
  ------------------
  630|  80.7k|    decodeBlock();
  631|       |
  632|  3.57k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.57k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|  80.7k|void MatroskaVideo::decodeBlock() {
  636|  80.7k|  byte buf[8];
  637|  80.7k|  io_->read(buf, 1);
  638|       |
  639|  80.7k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 510, False: 80.1k]
  ------------------
  640|    510|    continueTraversing_ = false;
  641|    510|    return;
  642|    510|  }
  643|       |
  644|  80.1k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|  80.1k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 79.7k, False: 482]
  ------------------
  646|  79.7k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|  80.1k|  auto tag_id = returnTagValue(buf, block_size);
  649|  80.1k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|  80.1k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.74k, False: 78.4k]
  ------------------
  652|  1.74k|    continueTraversing_ = false;
  653|  1.74k|    return;
  654|  1.74k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|  78.4k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 554, False: 77.8k]
  |  Branch (658:27): [True: 10, False: 77.8k]
  ------------------
  659|     20|    continueTraversing_ = false;
  660|     20|    return;
  661|     20|  }
  662|       |
  663|  78.4k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|  78.4k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|  78.4k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 77.7k, False: 668]
  ------------------
  667|  77.7k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|  78.4k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|  78.4k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 34.9k, False: 43.4k]
  |  Branch (670:29): [True: 34.9k, False: 0]
  ------------------
  671|  34.9k|    return;
  672|       |
  673|  43.4k|  const size_t bufMaxSize = 200;
  674|       |
  675|  43.4k|#ifndef SUPPRESS_WARNINGS
  676|  43.4k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 41.0k, False: 2.44k]
  |  Branch (676:28): [True: 211, False: 40.8k]
  ------------------
  677|    211|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    211|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 211]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    211|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    211|  }
  680|  43.4k|#endif
  681|  43.4k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.44k, False: 41.0k]
  |  Branch (681:27): [True: 211, False: 40.8k]
  ------------------
  682|  1.97k|    io_->seek(size, BasicIo::cur);
  683|  1.97k|    return;
  684|  1.97k|  }
  685|       |
  686|  41.5k|  DataBuf buf2(bufMaxSize + 1);
  687|  41.5k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  41.5k|  switch (tag->_type) {
  689|  12.5k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 12.5k, False: 29.0k]
  ------------------
  690|  12.5k|      decodeInternalTags(tag, buf2.data());
  691|  12.5k|      break;
  692|  3.70k|    case String:
  ------------------
  |  Branch (692:5): [True: 3.70k, False: 37.8k]
  ------------------
  693|  3.70k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 41.5k]
  ------------------
  694|  3.70k|      decodeStringTags(tag, buf2.data());
  695|  3.70k|      break;
  696|    946|    case Integer:
  ------------------
  |  Branch (696:5): [True: 946, False: 40.5k]
  ------------------
  697|  2.14k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 1.19k, False: 40.3k]
  ------------------
  698|  2.14k|      decodeIntegerTags(tag, buf2.data());
  699|  2.14k|      break;
  700|  17.5k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 17.5k, False: 23.9k]
  ------------------
  701|  17.5k|      decodeBooleanTags(tag, buf2.data());
  702|  17.5k|      break;
  703|  2.03k|    case Date:
  ------------------
  |  Branch (703:5): [True: 2.03k, False: 39.4k]
  ------------------
  704|  2.03k|      decodeDateTags(tag, buf2.data(), size);
  705|  2.03k|      break;
  706|  2.75k|    case Float:
  ------------------
  |  Branch (706:5): [True: 2.75k, False: 38.7k]
  ------------------
  707|  2.75k|      decodeFloatTags(tag, buf2.data());
  708|  2.75k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 41.5k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 41.5k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 41.5k]
  ------------------
  714|      0|      break;
  715|  41.5k|  }
  716|  41.5k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  12.5k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  12.5k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  12.5k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 1.26k, False: 11.2k]
  ------------------
  721|  1.26k|    return;
  722|       |
  723|  11.2k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  11.2k|    switch (tag->_id) {
  725|  11.2k|      case Xmp_video_VideoScanTpye:
  726|  11.2k|        return Exiv2::find(videoScanType, key);
  727|  11.2k|      case Xmp_audio_ChannelType:
  728|  11.2k|        return Exiv2::find(audioChannels, key);
  729|  11.2k|      case Xmp_video_ContentCompressAlgo:
  730|  11.2k|        return Exiv2::find(compressionAlgorithm, key);
  731|  11.2k|      case Xmp_video_ContentEncryptAlgo:
  732|  11.2k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  11.2k|      case Xmp_video_ContentSignAlgo_1:
  734|  11.2k|      case Xmp_video_ContentSignAlgo_2:
  735|  11.2k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  11.2k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  11.2k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  11.2k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  11.2k|      case Xmp_video_ContentEncodingType:
  740|  11.2k|        return Exiv2::find(encodingType, key);
  741|  11.2k|      case Xmp_video_DisplayUnit:
  742|  11.2k|        return Exiv2::find(displayUnit, key);
  743|  11.2k|      case Xmp_video_AspectRatioType:
  744|  11.2k|        return Exiv2::find(aspectRatioType, key);
  745|  11.2k|      case Xmp_video_PhysicalEquivalent:
  746|  11.2k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  11.2k|      case Xmp_video_TranslateCodec:
  748|  11.2k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  11.2k|      case Video_Audio_CodecID:
  750|  11.2k|        return Exiv2::find(trackCodec, key);
  751|  11.2k|      case Video_Audio_CodecName:
  752|  11.2k|        return Exiv2::find(codecInfo, key);
  753|  11.2k|      case CodecDownloadURL:
  754|  11.2k|      case CodecInfoURL:
  755|  11.2k|        return Exiv2::find(codecDownloadUrl, key);
  756|  11.2k|    }
  757|  11.2k|    return nullptr;
  758|  11.2k|  }();
  759|  11.2k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 4.96k, False: 6.27k]
  ------------------
  760|  4.96k|    xmpData_[tag->_label] = internalMt->_label;
  761|  6.27k|  } else {
  762|  6.27k|    xmpData_[tag->_label] = key;
  763|  6.27k|  }
  764|  11.2k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  3.70k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  3.70k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 196, False: 3.50k]
  ------------------
  768|    196|    track_count_++;
  769|    196|    xmpData_[tag->_label] = track_count_;
  770|  3.50k|  } else {
  771|  3.50k|    xmpData_[tag->_label] = buf;
  772|  3.50k|  }
  773|  3.70k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  2.14k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  2.14k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  2.14k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 858, False: 1.28k]
  ------------------
  778|    858|    return;
  779|       |
  780|  1.28k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 408, False: 874]
  |  Branch (780:40): [True: 85, False: 789]
  ------------------
  781|    493|    width_ = value;
  782|  1.28k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 408, False: 874]
  |  Branch (782:41): [True: 275, False: 599]
  ------------------
  783|    683|    height_ = value;
  784|  1.28k|  xmpData_[tag->_label] = value;
  785|  1.28k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  17.5k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  17.5k|  const MatroskaTag* internalMt = nullptr;
  789|  17.5k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  17.5k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 933, False: 16.6k]
  ------------------
  791|    933|    return;
  792|       |
  793|  16.6k|  switch (tag->_id) {
  794|  5.04k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 5.04k, False: 11.5k]
  ------------------
  795|  5.04k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 1.78k, False: 3.26k]
  ------------------
  796|  1.78k|        stream_ = f->_id;
  797|  1.78k|      }
  798|  5.04k|      break;
  799|  1.08k|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 1.08k, False: 15.5k]
  ------------------
  800|  1.08k|      internalMt = Exiv2::find(trackEnable, key);
  801|  1.08k|      break;
  802|  5.28k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 5.28k, False: 11.3k]
  ------------------
  803|  5.28k|      internalMt = Exiv2::find(defaultOn, key);
  804|  5.28k|      break;
  805|  1.38k|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 1.38k, False: 15.2k]
  ------------------
  806|  1.38k|      internalMt = Exiv2::find(trackForced, key);
  807|  1.38k|      break;
  808|    940|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 940, False: 15.6k]
  ------------------
  809|    940|      internalMt = Exiv2::find(trackLacing, key);
  810|    940|      break;
  811|  2.23k|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 2.23k, False: 14.3k]
  ------------------
  812|  2.23k|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|  2.23k|      break;
  814|    578|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 578, False: 16.0k]
  ------------------
  815|    578|      internalMt = Exiv2::find(codecSettings, key);
  816|    578|      break;
  817|     67|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 67, False: 16.5k]
  ------------------
  818|     67|      internalMt = tag;
  819|     67|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 16.6k]
  ------------------
  821|      0|      break;
  822|  16.6k|  }
  823|       |
  824|  16.6k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 3.73k, False: 12.8k]
  ------------------
  825|  3.73k|    xmpData_[internalMt->_label] = "Yes";
  826|  3.73k|  }
  827|  16.6k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  2.03k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  2.03k|  int64_t duration_in_ms = 0;
  831|  2.03k|  uint64_t value;
  832|  2.03k|  switch (tag->_id) {
  833|    824|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 824, False: 1.20k]
  ------------------
  834|    824|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 465, False: 359]
  ------------------
  835|    465|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    465|      } else {
  837|    359|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    359|      }
  839|    824|      xmpData_[tag->_label] = duration_in_ms;
  840|    824|      break;
  841|    620|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 620, False: 1.41k]
  ------------------
  842|    620|      value = getULongLong(buf, bigEndian);
  843|    620|      if (!value)
  ------------------
  |  Branch (843:11): [True: 324, False: 296]
  ------------------
  844|    324|        return;
  845|    296|      duration_in_ms = value / 1000000000;
  846|    296|      xmpData_[tag->_label] = duration_in_ms;
  847|    296|      break;
  848|       |
  849|    589|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 589, False: 1.44k]
  ------------------
  850|    589|      value = getULongLong(buf, bigEndian);
  851|    589|      if (!value)
  ------------------
  |  Branch (851:11): [True: 330, False: 259]
  ------------------
  852|    330|        return;
  853|    259|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    259|      xmpData_[tag->_label] = time_code_scale_;
  855|    259|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 2.03k]
  ------------------
  857|      0|      break;
  858|  2.03k|  }
  859|  2.03k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  2.75k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  2.75k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  2.75k|  switch (tag->_id) {
  865|  1.07k|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 1.07k, False: 1.67k]
  ------------------
  866|  1.27k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 195, False: 2.55k]
  ------------------
  867|  1.27k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|  1.27k|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 2.75k]
  ------------------
  870|  1.47k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 1.47k, False: 1.27k]
  ------------------
  871|  1.47k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  1.47k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 811, False: 668]
  ------------------
  873|    811|        return;
  874|    668|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 299, False: 369]
  ------------------
  875|    299|        double frame_rate = 0;
  876|    299|        switch (stream_) {
  877|     66|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 66, False: 233]
  ------------------
  878|     66|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|     66|            break;
  880|    141|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 141, False: 158]
  ------------------
  881|    141|            frame_rate = static_cast<double>(key) / 1000;
  882|    141|            break;
  883|     92|          default:
  ------------------
  |  Branch (883:11): [True: 92, False: 207]
  ------------------
  884|     92|            break;
  885|    299|        }
  886|    299|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 207, False: 92]
  ------------------
  887|    207|          xmpData_[internalMt->_label] = frame_rate;
  888|    299|      } else
  889|    369|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|    668|    } break;
  891|    668|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.75k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  2.75k|  }
  895|  2.75k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   158k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   158k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 125k, False: 32.9k]
  ------------------
  899|   125k|    return 1;
  900|  32.9k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 18.7k, False: 14.1k]
  ------------------
  901|  18.7k|    return 2;
  902|  14.1k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 1.54k, False: 12.6k]
  ------------------
  903|  1.54k|    return 3;
  904|  12.6k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 6.77k, False: 5.85k]
  ------------------
  905|  6.77k|    return 4;
  906|  5.85k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 513, False: 5.34k]
  ------------------
  907|    513|    return 5;
  908|  5.34k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 695, False: 4.65k]
  ------------------
  909|    695|    return 6;
  910|  4.65k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 1.30k, False: 3.34k]
  ------------------
  911|  1.30k|    return 7;
  912|  3.34k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.79k, False: 553]
  ------------------
  913|  2.79k|    return 8;
  914|    553|  return 0;
  915|  3.34k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.57k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.57k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.57k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.57k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.57k|  return image;
  923|  3.57k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  15.8k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  15.8k|  bool result = true;
  927|  15.8k|  byte tmpBuf[4];
  928|  15.8k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  15.8k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 15.8k]
  |  Branch (930:22): [True: 548, False: 15.2k]
  ------------------
  931|    548|    return false;
  932|       |
  933|  15.2k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 4.51k, False: 10.7k]
  |  Branch (933:28): [True: 20, False: 10.7k]
  |  Branch (933:49): [True: 19, False: 10.7k]
  |  Branch (933:70): [True: 23, False: 10.7k]
  ------------------
  934|  4.57k|    result = false;
  935|  4.57k|  }
  936|       |
  937|  15.2k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 15.2k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  15.2k|    iIo.seek(0, BasicIo::beg);
  939|  15.2k|  return result;
  940|  15.8k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   157k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   157k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 157k, False: 553]
  |  Branch (583:23): [True: 157k, False: 0]
  ------------------
  584|       |
  585|   157k|  size_t b0 = buf[0] & (0xff >> size);
  586|   157k|  size_t tag = b0 << ((size - 1) * 8);
  587|   232k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 74.7k, False: 157k]
  ------------------
  588|  74.7k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  74.7k|  }
  590|       |
  591|   157k|  return tag;
  592|   157k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  11.2k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  11.2k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 11.2k, False: 0]
  ------------------
  725|    579|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 579, False: 10.6k]
  ------------------
  726|    579|        return Exiv2::find(videoScanType, key);
  727|  1.45k|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 1.45k, False: 9.78k]
  ------------------
  728|  1.45k|        return Exiv2::find(audioChannels, key);
  729|  1.25k|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 1.25k, False: 9.98k]
  ------------------
  730|  1.25k|        return Exiv2::find(compressionAlgorithm, key);
  731|  1.87k|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 1.87k, False: 9.36k]
  ------------------
  732|  1.87k|        return Exiv2::find(encryptionAlgorithm, key);
  733|    674|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 674, False: 10.5k]
  ------------------
  734|    884|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 210, False: 11.0k]
  ------------------
  735|    884|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    608|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 608, False: 10.6k]
  ------------------
  737|  1.25k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 645, False: 10.5k]
  ------------------
  738|  1.25k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    356|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 356, False: 10.8k]
  ------------------
  740|    356|        return Exiv2::find(encodingType, key);
  741|    577|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 577, False: 10.6k]
  ------------------
  742|    577|        return Exiv2::find(displayUnit, key);
  743|    696|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 696, False: 10.5k]
  ------------------
  744|    696|        return Exiv2::find(aspectRatioType, key);
  745|  1.09k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 1.09k, False: 10.1k]
  ------------------
  746|  1.09k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    898|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 898, False: 10.3k]
  ------------------
  748|    898|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 11.2k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    175|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 175, False: 11.0k]
  ------------------
  752|    175|        return Exiv2::find(codecInfo, key);
  753|     10|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 10, False: 11.2k]
  ------------------
  754|    147|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 137, False: 11.0k]
  ------------------
  755|    147|        return Exiv2::find(codecDownloadUrl, key);
  756|  11.2k|    }
  757|      0|    return nullptr;
  758|  11.2k|  }();

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

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

_ZN5Exiv28MrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   24|    427|    Image(ImageType::mrw, mdExif | mdIptc | mdXmp, std::move(io), params) {
   25|    427|}
_ZNK5Exiv28MrwImage8mimeTypeEv:
   27|     21|std::string MrwImage::mimeType() const {
   28|     21|  return "image/x-minolta-mrw";
   29|     21|}
_ZNK5Exiv28MrwImage10pixelWidthEv:
   31|     78|uint32_t MrwImage::pixelWidth() const {
   32|     78|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   33|     78|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (33:7): [True: 43, False: 35]
  |  Branch (33:7): [True: 22, False: 56]
  |  Branch (33:40): [True: 22, False: 21]
  ------------------
   34|     22|    return imageWidth->toUint32();
   35|     22|  }
   36|     56|  return 0;
   37|     78|}
_ZNK5Exiv28MrwImage11pixelHeightEv:
   39|     78|uint32_t MrwImage::pixelHeight() const {
   40|     78|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   41|     78|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (41:7): [True: 38, False: 40]
  |  Branch (41:7): [True: 18, False: 60]
  |  Branch (41:41): [True: 18, False: 20]
  ------------------
   42|     18|    return imageHeight->toUint32();
   43|     18|  }
   44|     60|  return 0;
   45|     78|}
_ZN5Exiv28MrwImage12readMetadataEv:
   62|    427|void MrwImage::readMetadata() {
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |  std::cerr << "Reading MRW file " << io_->path() << "\n";
   65|       |#endif
   66|    427|  if (io_->open() != 0) {
  ------------------
  |  Branch (66:7): [True: 0, False: 427]
  ------------------
   67|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   68|      0|  }
   69|    427|  IoCloser closer(*io_);
   70|       |  // Ensure that this is the correct image type
   71|    427|  if (!isMrwType(*io_, false)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 427]
  ------------------
   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|    427|  clearMetadata();
   77|       |
   78|       |  // Find the TTW block and read it into a buffer
   79|    427|  uint32_t const len = 8;
   80|    427|  byte tmp[len];
   81|    427|  io_->read(tmp, len);
   82|    427|  uint32_t pos = len;
   83|    427|  uint32_t const end = getULong(tmp + 4, bigEndian);
   84|       |
   85|    427|  pos += len;
   86|    427|  Internal::enforce(pos <= end, ErrorCode::kerFailedToReadImageData);
   87|    427|  io_->read(tmp, len);
   88|    427|  if (io_->error() || io_->eof())
  ------------------
  |  Branch (88:7): [True: 21, False: 406]
  |  Branch (88:23): [True: 0, False: 406]
  ------------------
   89|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   90|       |
   91|  1.14k|  while (memcmp(tmp + 1, "TTW", 3) != 0) {
  ------------------
  |  Branch (91:10): [True: 721, False: 427]
  ------------------
   92|    721|    uint32_t const siz = getULong(tmp + 4, bigEndian);
   93|    721|    Internal::enforce(siz <= end - pos, ErrorCode::kerFailedToReadImageData);
   94|    721|    pos += siz;
   95|    721|    io_->seek(siz, BasicIo::cur);
   96|    721|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (96:23): [True: 679, False: 42]
  |  Branch (96:40): [True: 580, False: 99]
  ------------------
   97|       |
   98|    721|    Internal::enforce(len <= end - pos, ErrorCode::kerFailedToReadImageData);
   99|    721|    pos += len;
  100|    721|    io_->read(tmp, len);
  101|    721|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (101:23): [True: 560, False: 161]
  |  Branch (101:40): [True: 493, False: 67]
  ------------------
  102|    721|  }
  103|       |
  104|    427|  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|    427|  Internal::enforce(siz <= io_->size(), ErrorCode::kerFailedToReadImageData);
  111|    427|  DataBuf buf(siz);
  112|    427|  io_->read(buf.data(), buf.size());
  113|    427|  Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (113:21): [True: 131, False: 296]
  |  Branch (113:38): [True: 111, False: 20]
  ------------------
  114|       |
  115|    427|  const DecodeParams dp(max_recursion_depth_);
  116|    427|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.c_data(), buf.size(), dp);
  117|    427|  setByteOrder(bo);
  118|    427|}  // MrwImage::readMetadata
_ZN5Exiv214newMrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  127|    427|Image::UniquePtr newMrwInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  128|    427|  auto image = std::make_unique<MrwImage>(std::move(io), params);
  129|    427|  if (!image->good()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 427]
  ------------------
  130|      0|    return nullptr;
  131|      0|  }
  132|    427|  return image;
  133|    427|}
_ZN5Exiv29isMrwTypeERNS_7BasicIoEb:
  135|  53.5k|bool isMrwType(BasicIo& iIo, bool advance) {
  136|  53.5k|  const int32_t len = 4;
  137|  53.5k|  const std::array<byte, len> MrwId{0x0, 0x4d, 0x52, 0x4d};
  138|  53.5k|  std::array<byte, len> buf;
  139|  53.5k|  iIo.read(buf.data(), len);
  140|  53.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (140:7): [True: 0, False: 53.5k]
  |  Branch (140:22): [True: 211, False: 53.3k]
  ------------------
  141|    211|    return false;
  142|    211|  }
  143|  53.3k|  bool rc = buf == MrwId;
  144|  53.3k|  if (!advance || !rc) {
  ------------------
  |  Branch (144:7): [True: 53.3k, False: 0]
  |  Branch (144:19): [True: 0, False: 0]
  ------------------
  145|  53.3k|    iIo.seek(-len, BasicIo::cur);
  146|  53.3k|  }
  147|  53.3k|  return rc;
  148|  53.5k|}

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

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

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

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  32.4k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  32.4k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  32.4k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  32.4k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 32.4k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  32.4k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 201, False: 32.2k]
  |  Branch (13:26): [True: 148, False: 53]
  ------------------
   14|    148|    setByteOrder(littleEndian);
   15|  32.2k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 519, False: 31.7k]
  |  Branch (15:33): [True: 466, False: 53]
  ------------------
   16|    466|    setByteOrder(bigEndian);
   17|  31.7k|  } else {
   18|  31.7k|    return false;
   19|  31.7k|  }
   20|       |
   21|    614|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    614|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 494, False: 120]
  |  Branch (22:23): [True: 106, False: 388]
  ------------------
   23|    106|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    508|  sig_ = sig;
   25|    508|  setOffset(getULong(pData + 4, byteOrder()));
   26|    508|  return true;
   27|    614|}

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

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

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

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  19.6k|bool Photoshop::isIrb(const byte* pPsData) {
   28|  19.6k|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 19.6k]
  ------------------
   29|      0|    return false;
   30|       |
   31|  19.6k|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 61.5k, False: 9.18k]
  ------------------
   32|  61.5k|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 10.4k, False: 51.0k]
  ------------------
   33|  10.4k|      return true;
   34|       |
   35|  9.18k|  return false;
   36|  19.6k|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  10.3k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  10.3k|  const byte* record = nullptr;
   40|  10.3k|  uint32_t sizeIptc = 0;
   41|  10.3k|  uint32_t sizeHdr = 0;
   42|  10.3k|  const byte* pCur = pPsData;
   43|  10.3k|  const byte* pEnd = pPsData + sizePsData;
   44|  10.3k|  int ret = 0;
   45|  11.3k|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 11.3k, False: 26]
  |  Branch (45:25): [True: 1.05k, False: 10.3k]
  ------------------
   46|  1.05k|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  1.05k|  }
   48|  10.3k|  return ret >= 0;
   49|  10.3k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  12.3k|                         uint32_t& sizeData) {
   56|  12.3k|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 557, False: 11.8k]
  ------------------
   57|    557|    return 3;
   58|    557|  }
   59|       |
   60|       |  // Used for error checking
   61|  11.8k|  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.4k|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 17.1k, False: 295]
  |  Branch (66:43): [True: 8.57k, False: 8.59k]
  ------------------
   67|  8.57k|    const byte* hrd = pPsData + position;
   68|  8.57k|    position += 4;
   69|  8.57k|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  8.57k|    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.57k|    byte psSize = pPsData[position] + 1;
   76|  8.57k|    psSize += (psSize & 1);
   77|  8.57k|    position += psSize;
   78|  8.57k|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 408, False: 8.17k]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|    408|      return -2;
   84|    408|    }
   85|  8.17k|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  8.17k|    position += 4;
   87|  8.17k|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 1.33k, False: 6.83k]
  ------------------
   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.33k|      return -2;
   93|  1.33k|    }
   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.83k|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 1.20k, False: 5.63k]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  1.20k|      sizeData = dataSize;
  105|  1.20k|      sizeHdr = psSize + 10;
  106|  1.20k|      *record = hrd;
  107|  1.20k|      return 0;
  108|  1.20k|    }
  109|       |    // Data size is also padded to be even
  110|  5.63k|    position += dataSize + (dataSize & 1);
  111|  5.63k|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  8.88k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 8.83k, False: 51]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  8.83k|    return -2;
  121|  8.83k|  }
  122|     51|  return 3;
  123|  8.88k|}
_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|    110|                                uint32_t& sizeData) {
  132|    110|  return locateIrb(pPsData, sizePsData, preview_, record, sizeHdr, sizeData);
  133|    110|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|    116|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|    116|  *outWidth = data.read_uint32(0, bigEndian);
   48|    116|  *outHeight = data.read_uint32(4, bigEndian);
   49|    116|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeERKNS_12DecodeParamsE:
   51|  8.60k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type, const DecodeParams& dp) {
   52|  8.60k|  DataBuf key = keyTXTChunk(data);
   53|  8.60k|  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|  8.60k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 7.92k, False: 689]
  ------------------
   59|  7.92k|    parseChunkContent(pImage, key.c_data(), key.size(), arr, dp);
   60|  8.60k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  8.60k|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|  8.60k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 0, False: 8.60k]
  ------------------
   74|  8.60k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 20, False: 8.58k]
  ------------------
   75|     20|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  8.58k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  8.58k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 23, False: 8.56k]
  ------------------
   79|     23|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  8.56k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  8.58k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  8.56k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  8.56k|  DataBuf arr;
   86|       |
   87|  8.56k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 492, False: 8.07k]
  ------------------
   88|    492|    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|    492|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 27, False: 465]
  ------------------
   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|     27|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     27|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    465|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    465|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 383, False: 82]
  ------------------
  104|    383|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|    383|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|    383|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|    383|    }
  109|  8.07k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 2.02k, False: 6.04k]
  ------------------
  110|  2.02k|    enforce(data.size() >= Safe::add(keysize, std::size_t{1}), ErrorCode::kerCorruptedMetadata);
  111|       |    // Extract a non-compressed Latin-1 text chunk
  112|       |
  113|       |    // the text comes after the key, but isn't null terminated
  114|  2.02k|    size_t textsize = data.size() - keysize - 1;
  115|  2.02k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 1.69k, False: 329]
  ------------------
  116|  1.69k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  1.69k|      arr = DataBuf(text, textsize);
  119|  1.69k|    }
  120|  6.04k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 6.04k, False: 0]
  ------------------
  121|  6.04k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  6.04k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  6.04k|    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|  6.04k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  6.04k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  6.04k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.69k, False: 350]
  |  Branch (132:40): [True: 316, False: 34]
  ------------------
  133|  6.04k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 316, False: 5.73k]
  ------------------
  134|    316|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  6.04k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  6.04k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  6.04k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  6.04k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  6.04k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  6.04k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  6.04k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  6.04k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  6.04k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  6.04k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  6.04k|    const auto textsize =
  152|  6.04k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  6.04k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 5.91k, False: 129]
  ------------------
  154|  5.91k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  5.91k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 5.62k, False: 294]
  ------------------
  157|       |        // then it's an uncompressed iTXt chunk
  158|       |#ifdef EXIV2_DEBUG_MESSAGES
  159|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
  160|       |#endif
  161|  5.62k|        arr = DataBuf(text, textsize);
  162|  5.62k|      } 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|    294|        zlibUncompress(text, textsize, arr);
  170|    294|      }
  171|  5.91k|    }
  172|  6.04k|  } 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|  8.53k|  return arr;
  180|  8.56k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufERKNS_12DecodeParamsE:
  183|  7.92k|                                 const DecodeParams& dp) {
  184|       |  // We look if an ImageMagick EXIF raw profile exist.
  185|       |
  186|  7.92k|  if (keySize >= 21 &&
  ------------------
  |  Branch (186:7): [True: 4.17k, False: 3.74k]
  ------------------
  187|  4.17k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (187:8): [True: 68, False: 4.10k]
  |  Branch (187:57): [True: 2.17k, False: 1.92k]
  ------------------
  188|  2.24k|      pImage->exifData().empty()) {
  ------------------
  |  Branch (188:7): [True: 2.17k, False: 66]
  ------------------
  189|  2.17k|    DataBuf exifData = readRawProfile(arr, false);
  190|  2.17k|    size_t length = exifData.size();
  191|       |
  192|  2.17k|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (192:9): [True: 129, False: 2.05k]
  ------------------
  193|       |      // Find the position of TIFF header in bytes array.
  194|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  195|    129|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  196|    129|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  197|    129|      size_t pos = std::numeric_limits<size_t>::max();
  198|       |
  199|       |      /// \todo Find substring inside an string
  200|    407|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (200:26): [True: 278, False: 129]
  ------------------
  201|    278|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (201:13): [True: 0, False: 278]
  ------------------
  202|    278|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (202:13): [True: 0, False: 278]
  ------------------
  203|      0|          pos = i;
  204|      0|          break;
  205|      0|        }
  206|    278|      }
  207|       |
  208|       |      // If found it, store only these data at from this place.
  209|       |
  210|    129|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (210:11): [True: 0, False: 129]
  ------------------
  211|       |#ifdef EXIV2_DEBUG_MESSAGES
  212|       |        std::cout << "Exiv2::PngChunk::parseChunkContent: TIFF header found at position " << pos << "\n";
  213|       |#endif
  214|      0|        ByteOrder bo = TiffParser::decode(pImage->exifData(), pImage->iptcData(), pImage->xmpData(),
  215|      0|                                          exifData.c_data(pos), length - pos, dp);
  216|      0|        pImage->setByteOrder(bo);
  217|    129|      } else {
  218|    129|#ifndef SUPPRESS_WARNINGS
  219|    129|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|    129|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 129]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    129|  LogMsg(LogMsg::warn).os()
  ------------------
  220|    129|#endif
  221|    129|        pImage->exifData().clear();
  222|    129|      }
  223|    129|    }
  224|  2.17k|  }
  225|       |
  226|       |  // We look if an ImageMagick IPTC raw profile exist.
  227|       |
  228|  7.92k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (228:7): [True: 4.16k, False: 3.75k]
  |  Branch (228:24): [True: 398, False: 3.76k]
  |  Branch (228:73): [True: 307, False: 91]
  ------------------
  229|    307|    DataBuf psData = readRawProfile(arr, false);
  230|    307|    if (!psData.empty()) {
  ------------------
  |  Branch (230:9): [True: 253, False: 54]
  ------------------
  231|    253|      Blob iptcBlob;
  232|    253|      const byte* record = nullptr;
  233|    253|      uint32_t sizeIptc = 0;
  234|    253|      uint32_t sizeHdr = 0;
  235|       |
  236|    253|      const byte* pEnd = psData.c_data(psData.size() - 1);
  237|    253|      const byte* pCur = psData.c_data();
  238|    253|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (238:14): [True: 235, False: 18]
  |  Branch (238:29): [True: 0, False: 235]
  ------------------
  239|      0|        if (sizeIptc) {
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|       |#ifdef EXIV2_DEBUG_MESSAGES
  241|       |          std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  242|       |#endif
  243|      0|          append(iptcBlob, record + sizeHdr, sizeIptc);
  244|      0|        }
  245|      0|        pCur = record + sizeHdr + sizeIptc;
  246|      0|        pCur += (sizeIptc & 1);
  247|      0|      }
  248|    253|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (248:11): [True: 0, False: 253]
  |  Branch (248:32): [True: 0, False: 0]
  ------------------
  249|      0|#ifndef SUPPRESS_WARNINGS
  250|      0|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  251|      0|#endif
  252|      0|        pImage->clearIptcData();
  253|      0|      }
  254|       |      // If there is no IRB, try to decode the complete chunk data
  255|    253|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (255:11): [True: 253, False: 0]
  |  Branch (255:31): [True: 113, False: 140]
  ------------------
  256|    113|#ifndef SUPPRESS_WARNINGS
  257|    113|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|    113|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 113]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    113|  LogMsg(LogMsg::warn).os()
  ------------------
  258|    113|#endif
  259|    113|        pImage->clearIptcData();
  260|    113|      }
  261|    253|    }  // if (psData.size() > 0)
  262|    307|  }
  263|       |
  264|       |  // We look if an ImageMagick XMP raw profile exist.
  265|       |
  266|  7.92k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (266:7): [True: 4.75k, False: 3.16k]
  |  Branch (266:24): [True: 1.60k, False: 3.14k]
  |  Branch (266:72): [True: 1.60k, False: 0]
  ------------------
  267|  1.60k|    DataBuf xmpBuf = readRawProfile(arr, false);
  268|  1.60k|    size_t length = xmpBuf.size();
  269|       |
  270|  1.60k|    if (length > 0) {
  ------------------
  |  Branch (270:9): [True: 1.17k, False: 432]
  ------------------
  271|  1.17k|      std::string& xmpPacket = pImage->xmpPacket();
  272|  1.17k|      xmpPacket.assign(xmpBuf.c_str(), length);
  273|  1.17k|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (273:52): [True: 464, False: 712]
  |  Branch (273:80): [True: 57, False: 407]
  ------------------
  274|     57|#ifndef SUPPRESS_WARNINGS
  275|     57|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     57|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 57]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     57|  LogMsg(LogMsg::warn).os()
  ------------------
  276|     57|#endif
  277|     57|        xmpPacket = xmpPacket.substr(idx);
  278|     57|      }
  279|  1.17k|      if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (279:11): [True: 1.17k, False: 0]
  ------------------
  280|  1.17k|#ifndef SUPPRESS_WARNINGS
  281|  1.17k|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  1.17k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.17k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.17k|  LogMsg(LogMsg::warn).os()
  ------------------
  282|  1.17k|#endif
  283|  1.17k|      }
  284|  1.17k|    }
  285|  1.60k|  }
  286|       |
  287|       |  // We look if an Adobe XMP string exist.
  288|       |
  289|  7.92k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (289:7): [True: 6.45k, False: 1.46k]
  |  Branch (289:24): [True: 1.99k, False: 4.46k]
  |  Branch (289:69): [True: 1.99k, False: 0]
  |  Branch (289:98): [True: 1.97k, False: 18]
  ------------------
  290|  1.97k|    std::string& xmpPacket = pImage->xmpPacket();
  291|  1.97k|    xmpPacket.assign(arr.c_str(), arr.size());
  292|  1.97k|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (292:50): [True: 1.72k, False: 252]
  |  Branch (292:78): [True: 725, False: 996]
  ------------------
  293|    725|#ifndef SUPPRESS_WARNINGS
  294|    725|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    725|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 725]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    725|  LogMsg(LogMsg::warn).os()
  ------------------
  295|      0|                  << "from the beginning of the XMP packet\n";
  296|    725|#endif
  297|    725|      xmpPacket = xmpPacket.substr(idx);
  298|    725|    }
  299|  1.97k|    if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (299:9): [True: 385, False: 1.58k]
  ------------------
  300|    385|#ifndef SUPPRESS_WARNINGS
  301|    385|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    385|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 385]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    385|  LogMsg(LogMsg::warn).os()
  ------------------
  302|    385|#endif
  303|    385|    }
  304|  1.97k|  }
  305|       |
  306|       |  // We look if a comments string exist. Note than we use only 'Description' keyword which
  307|       |  // is dedicated to store long comments. 'Comment' keyword is ignored.
  308|       |
  309|  7.92k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (309:7): [True: 6.66k, False: 1.25k]
  |  Branch (309:7): [True: 114, False: 7.80k]
  |  Branch (309:24): [True: 254, False: 6.41k]
  |  Branch (309:63): [True: 114, False: 140]
  ------------------
  310|    114|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  311|    114|  }
  312|       |
  313|  7.92k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  336|    677|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  337|    677|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  338|    677|  int zlibResult = Z_BUF_ERROR;
  339|    677|  int dos = 0;
  340|       |
  341|  1.95k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (341:10): [True: 1.39k, False: 559]
  ------------------
  342|  1.39k|    arr.alloc(uncompressedLen);
  343|  1.39k|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  344|  1.39k|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (344:9): [True: 559, False: 835]
  ------------------
  345|    559|      arr.resize(uncompressedLen);
  346|    835|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (346:16): [True: 727, False: 108]
  ------------------
  347|       |      // the uncompressedArray needs to be larger
  348|    727|      uncompressedLen *= 2;
  349|       |      // DoS protection. can't be bigger than 64k
  350|    727|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (350:11): [True: 26, False: 701]
  ------------------
  351|     26|        if (++dos > 1)
  ------------------
  |  Branch (351:13): [True: 10, False: 16]
  ------------------
  352|     10|          break;
  353|     16|        uncompressedLen = 131072;
  354|     16|      }
  355|    727|    } else {
  356|       |      // something bad happened
  357|    108|      throw Error(ErrorCode::kerFailedToReadImageData);
  358|    108|    }
  359|  1.39k|  }
  360|       |
  361|    569|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (361:7): [True: 10, False: 559]
  ------------------
  362|     10|    throw Error(ErrorCode::kerFailedToReadImageData);
  363|     10|  }
  364|    569|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  470|  4.09k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  471|  4.09k|  DataBuf info;
  472|  4.09k|  if (text.size() <= 1) {
  ------------------
  |  Branch (472:7): [True: 93, False: 4.00k]
  ------------------
  473|     93|    return info;
  474|     93|  }
  475|       |
  476|  4.00k|  const unsigned char unhex[103] = {
  477|  4.00k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  478|  4.00k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  479|  4.00k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15,
  480|  4.00k|  };
  481|       |
  482|  4.00k|  if (iTXt) {
  ------------------
  |  Branch (482:7): [True: 0, False: 4.00k]
  ------------------
  483|      0|    info.alloc(text.size());
  484|      0|    std::copy(text.begin(), text.end(), info.begin());
  485|      0|    return info;
  486|      0|  }
  487|       |
  488|  4.00k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  489|  4.00k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  490|       |
  491|  4.00k|  if (sp >= eot) {
  ------------------
  |  Branch (491:7): [True: 57, False: 3.94k]
  ------------------
  492|     57|    return info;
  493|     57|  }
  494|       |
  495|       |  // Look for newline
  496|  58.8k|  while (*sp != '\n') {
  ------------------
  |  Branch (496:10): [True: 54.9k, False: 3.88k]
  ------------------
  497|  54.9k|    sp++;
  498|  54.9k|    if (sp == eot) {
  ------------------
  |  Branch (498:9): [True: 62, False: 54.8k]
  ------------------
  499|     62|      return info;
  500|     62|    }
  501|  54.9k|  }
  502|  3.88k|  sp++;  // step over '\n'
  503|  3.88k|  if (sp == eot) {
  ------------------
  |  Branch (503:7): [True: 11, False: 3.87k]
  ------------------
  504|     11|    return info;
  505|     11|  }
  506|       |
  507|       |  // Look for length
  508|  94.2k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (508:10): [True: 4.87k, False: 89.3k]
  |  Branch (508:25): [True: 71.7k, False: 17.5k]
  |  Branch (508:39): [True: 13.7k, False: 3.85k]
  ------------------
  509|  90.3k|    sp++;
  510|  90.3k|    if (sp == eot) {
  ------------------
  |  Branch (510:9): [True: 16, False: 90.3k]
  ------------------
  511|     16|      return info;
  512|     16|    }
  513|  90.3k|  }
  514|       |
  515|       |  // Parse the length.
  516|  3.85k|  size_t length = 0;
  517|  7.47k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (517:10): [True: 4.51k, False: 2.96k]
  |  Branch (517:24): [True: 3.68k, False: 827]
  ------------------
  518|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  519|  3.68k|    const size_t newlength = (10 * length) + (*sp - '0');
  520|  3.68k|    length = newlength;
  521|  3.68k|    sp++;
  522|  3.68k|    if (sp == eot) {
  ------------------
  |  Branch (522:9): [True: 67, False: 3.62k]
  ------------------
  523|     67|      return info;
  524|     67|    }
  525|  3.68k|  }
  526|  3.78k|  sp++;  // step over '\n'
  527|  3.78k|  if (sp == eot) {
  ------------------
  |  Branch (527:7): [True: 500, False: 3.28k]
  ------------------
  528|    500|    return info;
  529|    500|  }
  530|       |
  531|  3.28k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  532|       |
  533|       |  // Allocate space
  534|  3.28k|  if (length == 0) {
  ------------------
  |  Branch (534:7): [True: 1.05k, False: 2.23k]
  ------------------
  535|       |#ifdef EXIV2_DEBUG_MESSAGES
  536|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  537|       |#endif
  538|  1.05k|  }
  539|  3.28k|  info.alloc(length);
  540|  3.28k|  if (info.size() != length) {
  ------------------
  |  Branch (540:7): [True: 0, False: 3.28k]
  ------------------
  541|       |#ifdef EXIV2_DEBUG_MESSAGES
  542|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: cannot allocate memory\n";
  543|       |#endif
  544|      0|    return info;
  545|      0|  }
  546|       |
  547|  3.28k|  if (info.empty())  // Early return
  ------------------
  |  Branch (547:7): [True: 1.05k, False: 2.23k]
  ------------------
  548|  1.05k|    return info;
  549|       |
  550|       |  // Copy profile, skipping white space and column 1 "=" signs
  551|  2.23k|  unsigned char* dp = info.data();  // decode pointer
  552|  2.23k|  size_t nibbles = length * 2;
  553|       |
  554|  20.8k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (554:22): [True: 19.1k, False: 1.73k]
  ------------------
  555|  19.1k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  556|  36.0k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (556:12): [True: 5.58k, False: 30.4k]
  |  Branch (556:26): [True: 17.6k, False: 12.8k]
  |  Branch (556:39): [True: 3.44k, False: 14.1k]
  |  Branch (556:53): [True: 8.43k, False: 18.5k]
  ------------------
  557|  17.3k|      if (*sp == '\0') {
  ------------------
  |  Branch (557:11): [True: 504, False: 16.8k]
  ------------------
  558|       |#ifdef EXIV2_DEBUG_MESSAGES
  559|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  560|       |#endif
  561|    504|        return {};
  562|    504|      }
  563|       |
  564|  16.8k|      sp++;
  565|  16.8k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  566|  16.8k|    }
  567|       |
  568|  18.6k|    if (i % 2 == 0)
  ------------------
  |  Branch (568:9): [True: 9.31k, False: 9.34k]
  ------------------
  569|  9.31k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  570|  9.34k|    else
  571|  9.34k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  572|  18.6k|  }
  573|       |
  574|  1.73k|  return info;
  575|       |
  576|  2.23k|}  // PngChunk::readRawProfile

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

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

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  2.90M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  2.90M|  return ns_ == ns.ns_;
 4941|  2.90M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|   100M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|   100M|  return prefix_ == prefix.prefix_;
 4945|   100M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.68M|std::mutex& XmpProperties::getMutex() {
 4953|  2.68M|  static std::mutex m;
 4954|  2.68M|  return m;
 4955|  2.68M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.82M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  66.3M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 66.3M, False: 2.73M]
  ------------------
 4965|  66.3M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 82.7k, False: 66.2M]
  ------------------
 4966|  82.7k|      return &p;
 4967|  66.3M|  }
 4968|  2.73M|  return nullptr;
 4969|  2.82M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     37|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     37|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 37]
  ------------------
 4978|      0|    return;
 4979|     37|  std::string ns2 = ns;
 4980|     37|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 22, False: 15]
  |  Branch (4980:28): [True: 16, False: 6]
  ------------------
 4981|     16|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     37|  auto it = nsRegistry_.find(ns2);
 4985|     37|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 37]
  |  Branch (4985:7): [True: 0, False: 37]
  |  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|     37|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 37]
  ------------------
 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|     37|  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|     37|  XmpNsInfo xn;
 5005|     37|  auto c = new char[ns2.size() + 1];
 5006|     37|  std::strcpy(c, ns2.c_str());
 5007|     37|  xn.ns_ = c;
 5008|     37|  c = new char[prefix.size() + 1];
 5009|     37|  std::strcpy(c, prefix.c_str());
 5010|     37|  xn.prefix_ = c;
 5011|     37|  xn.xmpPropertyInfo_ = nullptr;
 5012|     37|  xn.desc_ = "";
 5013|     37|  nsRegistry_[ns2] = xn;
 5014|     37|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     37|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     37|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     37|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     74|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     74|  auto i = nsRegistry_.find(ns);
 5027|     74|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 37, False: 37]
  ------------------
 5028|     37|    delete[] i->second.prefix_;
 5029|     37|    delete[] i->second.ns_;
 5030|     37|    nsRegistry_.erase(i);
 5031|     37|  }
 5032|     74|}
_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|     38|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 37, False: 1]
  ------------------
 5046|     37|    auto kill = i++;
 5047|     37|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     37|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   137k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   137k|  std::string ns2 = ns;
 5058|   137k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 40.3k, False: 97.2k]
  |  Branch (5058:28): [True: 29.1k, False: 11.1k]
  ------------------
 5059|  29.1k|    ns2 += '/';
 5060|       |
 5061|   137k|  auto i = nsRegistry_.find(ns2);
 5062|   137k|  std::string p;
 5063|   137k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 64.6k, False: 72.9k]
  ------------------
 5064|  64.6k|    p = i->second.prefix_;
 5065|  72.9k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 13.2k, False: 59.6k]
  ------------------
 5066|  13.2k|    p = std::string(xn->prefix_);
 5067|   137k|  return p;
 5068|   137k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.41M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.41M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 73.7k, False: 1.33M]
  ------------------
 5077|  73.7k|    return xn->ns_;
 5078|  1.33M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.41M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  14.6k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  14.6k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  14.6k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 8.98k, False: 5.64k]
  |  Branch (5083:59): [True: 5.61k, False: 37]
  ------------------
 5084|  14.6k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  57.8k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  57.8k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  57.8k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 56.0k, False: 1.82k]
  ------------------
 5114|  57.8k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  57.8k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  57.8k|  std::string prefix = key.groupName();
 5123|  57.8k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  57.8k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 57.8k]
  ------------------
 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|  57.8k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 57.8k, False: 0]
  ------------------
 5138|  7.84M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 7.84M, False: 1.82k]
  ------------------
 5139|  7.84M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 56.0k, False: 7.79M]
  ------------------
 5140|  56.0k|        return pl + j;
 5141|  56.0k|      }
 5142|  7.84M|    }
 5143|  57.8k|  }
 5144|  1.82k|  return nullptr;
 5145|  57.8k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  57.8k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  57.8k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  57.8k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.39M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.39M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.39M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.39M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.39M, False: 0]
  ------------------
 5175|  1.39M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.39M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 0, False: 1.39M]
  ------------------
 5177|      0|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.39M|  return xn;
 5179|  1.39M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   115k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   115k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 115k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   115k|  property_ = property;
 5256|   115k|  prefix_ = prefix;
 5257|   115k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   511k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   511k|  p_->decomposeKey(key);
 5261|   511k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   783k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   783k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   783k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   115k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   115k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.80M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   388k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   388k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   388k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   388k|  return UniquePtr(clone_());
 5288|   388k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   388k|XmpKey* XmpKey::clone_() const {
 5291|   388k|  return new XmpKey(*this);
 5292|   388k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  15.9M|std::string XmpKey::key() const {
 5295|  15.9M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  15.9M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|  57.8k|std::string XmpKey::groupName() const {
 5303|  57.8k|  return p_->prefix_;
 5304|  57.8k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|  57.8k|std::string XmpKey::tagName() const {
 5307|  57.8k|  return p_->property_;
 5308|  57.8k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5335|   511k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5336|   511k|  XmpProperties::XmpLock lock;
 5337|   511k|  decomposeKeyUnlocked(key, lock);
 5338|   511k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5340|  1.29M|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5341|       |  // Get the family name, prefix and property name parts of the key
 5342|  1.29M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5342:7): [True: 323, False: 1.29M]
  ------------------
 5343|    323|    throw Error(ErrorCode::kerInvalidKey, key);
 5344|  1.29M|  std::string::size_type pos1 = key.find('.');
 5345|  1.29M|  std::string::size_type pos0 = pos1 + 1;
 5346|  1.29M|  pos1 = key.find('.', pos0);
 5347|  1.29M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5347:7): [True: 0, False: 1.29M]
  ------------------
 5348|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5349|  1.29M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5350|  1.29M|  if (prefix.empty())
  ------------------
  |  Branch (5350:7): [True: 0, False: 1.29M]
  ------------------
 5351|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5352|  1.29M|  std::string property = key.substr(pos1 + 1);
 5353|  1.29M|  if (property.empty())
  ------------------
  |  Branch (5353:7): [True: 0, False: 1.29M]
  ------------------
 5354|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5355|       |
 5356|       |  // Validate prefix unlocked (must hold lock)
 5357|  1.29M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5357:7): [True: 0, False: 1.29M]
  ------------------
 5358|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5359|       |
 5360|  1.29M|  property_ = std::move(property);
 5361|  1.29M|  prefix_ = std::move(prefix);
 5362|  1.29M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|  1.29M|  Impl() = default;                                                                             //!< Default constructor

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  5.86k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  5.86k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  7.31k|std::string QuickTimeVideo::mimeType() const {
  544|  7.31k|  return "video/quicktime";
  545|  7.31k|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  5.83k|void QuickTimeVideo::readMetadata() {
  551|  5.83k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 5.83k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  5.83k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 5.83k]
  ------------------
  556|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (556:9): [True: 0, False: 0]
  |  Branch (556:25): [True: 0, False: 0]
  ------------------
  557|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  558|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  559|      0|  }
  560|       |
  561|  5.83k|  IoCloser closer(*io_);
  562|  5.83k|  clearMetadata();
  563|  5.83k|  continueTraversing_ = true;
  564|  5.83k|  height_ = width_ = 1;
  565|       |
  566|  5.83k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  5.83k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  61.9k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 56.1k, False: 5.83k]
  ------------------
  570|  56.1k|    decodeBlock(0);
  571|       |
  572|  5.83k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  5.83k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  67.9k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  67.9k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  67.9k|  const long bufMinSize = 4;
  579|  67.9k|  DataBuf buf(bufMinSize + 1);
  580|  67.9k|  uint64_t size = 0;
  581|  67.9k|  buf.data()[4] = '\0';
  582|       |
  583|  67.9k|  io_->read(buf.data(), 4);
  584|  67.9k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 584, False: 67.3k]
  ------------------
  585|    584|    continueTraversing_ = false;
  586|    584|    return;
  587|    584|  }
  588|       |
  589|  67.3k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  67.3k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  67.3k|  size_t hdrsize = 8;
  595|       |
  596|  67.3k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 280, False: 67.0k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    280|    DataBuf data(8);
  599|    280|    hdrsize += 8;
  600|    280|    io_->readOrThrow(data.data(), data.size());
  601|    280|    size = data.read_uint64(0, bigEndian);
  602|  67.0k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 278, False: 66.7k]
  |  Branch (602:27): [True: 70, False: 208]
  ------------------
  603|     70|    size = buf.read_uint32(0, bigEndian);
  604|     70|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|     70|  }
  606|       |
  607|  67.3k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  67.3k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  67.3k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  610|       |
  611|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  612|  67.3k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  67.3k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 1.46k, False: 65.8k]
  ------------------
  614|  1.46k|    discard(newsize);
  615|  1.46k|    return;
  616|  1.46k|  }
  617|  65.8k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  65.8k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  66.2k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  66.2k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  66.2k|  assert(buf.size() > 4);
  631|       |
  632|  66.2k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 66.2k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  66.2k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 8.06k, False: 58.1k]
  ------------------
  636|  8.06k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  58.1k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 11.1k, False: 47.0k]
  ------------------
  638|  11.1k|    fileTypeDecoder(size);
  639|       |
  640|  47.0k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 3.66k, False: 43.3k]
  ------------------
  641|  3.66k|    setMediaStream(size);
  642|       |
  643|  43.3k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 1.15k, False: 42.2k]
  ------------------
  644|  1.15k|    movieHeaderDecoder(size);
  645|       |
  646|  42.2k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 1.07k, False: 41.1k]
  ------------------
  647|  1.07k|    trackHeaderDecoder(size);
  648|       |
  649|  41.1k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 1.04k, False: 40.0k]
  ------------------
  650|  1.04k|    mediaHeaderDecoder(size);
  651|       |
  652|  40.0k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 1.99k, False: 38.0k]
  ------------------
  653|  1.99k|    handlerDecoder(size);
  654|       |
  655|  38.0k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 5.88k, False: 32.2k]
  ------------------
  656|  5.88k|    videoHeaderDecoder(size);
  657|       |
  658|  32.2k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 9.53k, False: 22.6k]
  ------------------
  659|  9.53k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  22.6k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 1.87k, False: 20.8k]
  ------------------
  662|  1.87k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  20.8k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 1.74k, False: 19.0k]
  ------------------
  665|  1.74k|    sampleDesc(size);
  666|       |
  667|  19.0k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 500, False: 18.5k]
  ------------------
  668|    500|    timeToSampleDecoder();
  669|       |
  670|  18.5k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 406, False: 18.1k]
  ------------------
  671|    406|    previewTagDecoder(size);
  672|       |
  673|  18.1k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 1.23k, False: 16.9k]
  ------------------
  674|  1.23k|    trackApertureTagDecoder(size);
  675|       |
  676|  16.9k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 541, False: 16.3k]
  ------------------
  677|    541|    keysTagDecoder(size);
  678|       |
  679|  16.3k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 1.25k, False: 15.1k]
  ------------------
  680|  1.25k|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 378, False: 880]
  ------------------
  681|    378|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    880|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 132, False: 748]
  ------------------
  683|    132|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|    748|    else
  685|    748|      discard(size);
  686|  1.25k|  }
  687|       |
  688|  15.1k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 756, False: 14.3k]
  ------------------
  689|    756|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 448, False: 308]
  ------------------
  690|    448|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    308|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 77, False: 231]
  ------------------
  692|     77|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|    231|    else
  694|    231|      discard(size);
  695|    756|  }
  696|       |
  697|  14.3k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 116, False: 14.2k]
  ------------------
  698|    116|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|    116|  }
  700|       |
  701|  14.2k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 34, False: 14.2k]
  ------------------
  702|     34|    io_->readOrThrow(buf.data(), 4);
  703|     34|    io_->readOrThrow(buf.data(), 4);
  704|     34|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|     34|  }
  706|       |
  707|  14.2k|  else {
  708|  14.2k|    discard(size);
  709|  14.2k|  }
  710|  66.2k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  16.6k|void QuickTimeVideo::discard(size_t size) {
  713|  16.6k|  size_t cur_pos = io_->tell();
  714|  16.6k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  16.6k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|    406|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|    406|  DataBuf buf(5);
  719|    406|  size_t cur_pos = io_->tell();
  720|    406|  io_->readOrThrow(buf.data(), 4);
  721|    406|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|    406|  io_->readOrThrow(buf.data(), 2);
  723|    406|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|    406|  io_->readOrThrow(buf.data(), 4);
  726|    406|  buf.write_uint8(4, 0);  // nul-terminate string
  727|    406|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 35, False: 371]
  ------------------
  728|     35|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|    371|  else
  730|    371|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|    406|  io_->seek(cur_pos + size, BasicIo::beg);
  733|    406|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    541|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    541|  DataBuf buf(5);
  737|    541|  size_t cur_pos = io_->tell();
  738|    541|  io_->readOrThrow(buf.data(), 4);
  739|    541|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    541|  io_->readOrThrow(buf.data(), 2);
  741|    541|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    541|  io_->readOrThrow(buf.data(), 4);
  744|    541|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    541|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 18, False: 523]
  ------------------
  746|     18|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    523|  else
  748|    523|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    541|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    541|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|  1.23k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|  1.23k|  DataBuf buf(4);
  755|  1.23k|  DataBuf buf2(2);
  756|  1.23k|  size_t cur_pos = io_->tell();
  757|  1.23k|  byte n = 3;
  758|       |
  759|  4.90k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 3.67k, False: 1.23k]
  ------------------
  760|  3.67k|    io_->seek(4L, BasicIo::cur);
  761|  3.67k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  3.67k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 191, False: 3.48k]
  ------------------
  764|    191|      io_->seek(4L, BasicIo::cur);
  765|    191|      io_->readOrThrow(buf.data(), 2);
  766|    191|      io_->readOrThrow(buf2.data(), 2);
  767|    191|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|    191|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    191|#define stringFormat std::format
  ------------------
  769|    191|      io_->readOrThrow(buf.data(), 2);
  770|    191|      io_->readOrThrow(buf2.data(), 2);
  771|    191|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|    191|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    191|#define stringFormat std::format
  ------------------
  773|    191|    }
  774|       |
  775|  3.48k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 427, False: 3.06k]
  ------------------
  776|    427|      io_->seek(4L, BasicIo::cur);
  777|    427|      io_->readOrThrow(buf.data(), 2);
  778|    427|      io_->readOrThrow(buf2.data(), 2);
  779|    427|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|    427|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    427|#define stringFormat std::format
  ------------------
  781|    427|      io_->readOrThrow(buf.data(), 2);
  782|    427|      io_->readOrThrow(buf2.data(), 2);
  783|    427|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|    427|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    427|#define stringFormat std::format
  ------------------
  785|    427|    }
  786|       |
  787|  3.06k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 21, False: 3.03k]
  ------------------
  788|     21|      io_->seek(4L, BasicIo::cur);
  789|     21|      io_->readOrThrow(buf.data(), 2);
  790|     21|      io_->readOrThrow(buf2.data(), 2);
  791|     21|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     21|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     21|#define stringFormat std::format
  ------------------
  793|     21|      io_->readOrThrow(buf.data(), 2);
  794|     21|      io_->readOrThrow(buf2.data(), 2);
  795|     21|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     21|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     21|#define stringFormat std::format
  ------------------
  797|     21|    }
  798|  3.67k|  }
  799|  1.23k|  io_->seek(cur_pos + size, BasicIo::beg);
  800|  1.23k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|  1.46k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|  1.46k|  size_t cur_pos = io_->tell();
  804|  1.46k|  DataBuf buf(49);
  805|  1.46k|  DataBuf buf2(4);
  806|       |
  807|  1.46k|  io_->readOrThrow(buf.data(), 4);
  808|  1.46k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 1.26k, False: 197]
  ------------------
  809|  1.26k|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|  1.26k|    io_->readOrThrow(buf.data(), 24);
  812|  1.26k|    buf.write_uint8(24, 0);  // nul-terminate string
  813|  1.26k|    xmpData_["Xmp.video.Make"] = buf.data();
  814|  1.26k|    io_->readOrThrow(buf.data(), 14);
  815|  1.26k|    buf.write_uint8(14, 0);  // nul-terminate string
  816|  1.26k|    xmpData_["Xmp.video.Model"] = buf.data();
  817|  1.26k|    io_->readOrThrow(buf.data(), 4);
  818|  1.26k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.26k|#define stringFormat std::format
  ------------------
  819|  1.26k|    io_->readOrThrow(buf.data(), 4);
  820|  1.26k|    io_->readOrThrow(buf2.data(), 4);
  821|  1.26k|    xmpData_["Xmp.video.FNumber"] =
  822|  1.26k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|  1.26k|    io_->readOrThrow(buf.data(), 4);
  824|  1.26k|    io_->readOrThrow(buf2.data(), 4);
  825|  1.26k|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|  1.26k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|  1.26k|    io_->readOrThrow(buf.data(), 10);
  828|  1.26k|    io_->readOrThrow(buf.data(), 4);
  829|  1.26k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 574, False: 692]
  ------------------
  830|    574|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    574|#define _(String) (String)
  ------------------
  831|  1.26k|    io_->readOrThrow(buf.data(), 4);
  832|  1.26k|    io_->readOrThrow(buf2.data(), 4);
  833|  1.26k|    xmpData_["Xmp.video.FocalLength"] =
  834|  1.26k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|  1.26k|    io_->seek(95L, BasicIo::cur);
  836|  1.26k|    io_->readOrThrow(buf.data(), 48);
  837|  1.26k|    buf.write_uint8(48, 0);
  838|  1.26k|    xmpData_["Xmp.video.Software"] = buf.data();
  839|  1.26k|    io_->readOrThrow(buf.data(), 4);
  840|  1.26k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|  1.26k|  }
  842|       |
  843|  1.46k|  io_->seek(cur_pos + size, BasicIo::beg);
  844|  1.46k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  846|  9.99k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  847|  9.99k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  848|  9.99k|  const size_t start_pos = io_->tell();
  849|  9.99k|  const TagVocabulary* td;
  850|  9.99k|  const TagVocabulary* tv;
  851|  9.99k|  const TagVocabulary* tv_internal;
  852|       |
  853|  9.99k|  const long bufMinSize = 100;
  854|  9.99k|  DataBuf buf(bufMinSize);
  855|  9.99k|  size_t size_internal = outer_size;
  856|  9.99k|  std::memset(buf.data(), 0x0, buf.size());
  857|       |
  858|  19.7k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 13.9k, False: 5.78k]
  |  Branch (858:38): [True: 13.9k, False: 0]
  ------------------
  859|  13.9k|    const size_t loop_start_pos = io_->tell();
  860|  13.9k|    buf.data()[4] = '\0';
  861|  13.9k|    io_->readOrThrow(buf.data(), 4);
  862|  13.9k|    const size_t size = buf.read_uint32(0, bigEndian);
  863|  13.9k|    if (size > size_internal)
  ------------------
  |  Branch (863:9): [True: 4.07k, False: 9.84k]
  ------------------
  864|  4.07k|      break;
  865|  9.84k|    size_internal -= size;
  866|  9.84k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  9.84k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 66, False: 9.77k]
  ------------------
  869|     66|      buf.data()[0] = ' ';
  870|  9.84k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  9.84k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  9.84k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 133, False: 9.70k]
  ------------------
  875|    133|      break;
  876|       |
  877|  9.70k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 391, False: 9.31k]
  |  Branch (877:40): [True: 70, False: 9.24k]
  ------------------
  878|    461|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  9.24k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 2.14k, False: 7.10k]
  ------------------
  881|  2.14k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  7.10k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 1.46k, False: 5.64k]
  ------------------
  884|  1.46k|      CameraTagsDecoder(size - 8);
  885|       |
  886|  5.64k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 83, False: 5.56k]
  |  Branch (886:45): [True: 86, False: 5.47k]
  |  Branch (886:76): [True: 116, False: 5.35k]
  ------------------
  887|  5.35k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 86, False: 5.27k]
  |  Branch (887:45): [True: 68, False: 5.20k]
  ------------------
  888|    439|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    439|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    439|#define _(String) (String)
  ------------------
  890|    439|    }
  891|       |
  892|  5.20k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 327, False: 4.87k]
  |  Branch (892:45): [True: 0, False: 4.87k]
  ------------------
  893|    327|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|    327|      io_->readOrThrow(buf.data(), 2);
  895|    327|      buf.data()[2] = '\0';
  896|    327|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|    327|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 112, False: 215]
  ------------------
  899|    112|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    112|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    112|#define _(String) (String)
  ------------------
  900|    215|      else
  901|    215|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|    215|#define _(String) (String)
  ------------------
  902|    327|    }
  903|       |
  904|  4.87k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 111, False: 4.76k]
  ------------------
  905|    111|      io_->readOrThrow(buf.data(), 4);
  906|    111|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    111|#define _(String) (String)
  ------------------
  907|    111|    }
  908|       |
  909|  4.76k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 3.10k, False: 1.66k]
  ------------------
  910|  3.10k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  9.70k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  9.70k|  }
  914|       |
  915|  9.99k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  9.99k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  2.14k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  2.14k|  size_t cur_pos = io_->tell();
  920|  2.14k|  DataBuf buf(201);
  921|  2.14k|  DataBuf buf2(4 + 1);
  922|  2.14k|  uint32_t TagID = 0;
  923|  2.14k|  uint16_t dataLength = 0;
  924|  2.14k|  uint16_t dataType = 2;
  925|  2.14k|  const TagDetails* td;
  926|  2.14k|  const TagDetails* td2;
  927|       |
  928|   109k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 107k, False: 2.14k]
  ------------------
  929|   107k|    io_->readOrThrow(buf.data(), 4);
  930|   107k|    TagID = buf.read_uint32(0, bigEndian);
  931|   107k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   107k|    io_->readOrThrow(buf.data(), 2);
  934|   107k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   107k|    std::memset(buf.data(), 0x0, buf.size());
  937|   107k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   107k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 5.57k, False: 102k]
  ------------------
  940|  5.57k|      size_t local_pos = io_->tell();
  941|  5.57k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  5.57k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  5.57k|      io_->readOrThrow(buf.data(), 4);
  945|  5.57k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  5.57k|      io_->readOrThrow(buf.data(), 20);
  947|  5.57k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  5.57k|      io_->readOrThrow(buf.data(), 20);
  949|  5.57k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  5.57k|      io_->readOrThrow(buf.data(), 4);
  951|  5.57k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  5.57k|      io_->readOrThrow(buf.data(), 1);
  954|  5.57k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  5.57k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 3.93k, False: 1.64k]
  ------------------
  956|  3.93k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.93k|#define _(String) (String)
  ------------------
  957|  1.64k|      else
  958|  1.64k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  5.57k|      io_->readOrThrow(buf.data(), 1);
  961|  5.57k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  5.57k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 3.94k, False: 1.63k]
  ------------------
  963|  3.94k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.94k|#define _(String) (String)
  ------------------
  964|       |
  965|  5.57k|      io_->readOrThrow(buf.data(), 1);
  966|  5.57k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  5.57k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 3.85k, False: 1.71k]
  ------------------
  968|  3.85k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  3.85k|#define _(String) (String)
  ------------------
  969|  1.71k|      else
  970|  1.71k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  5.57k|      io_->readOrThrow(buf.data(), 1);
  973|  5.57k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  5.57k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 3.76k, False: 1.81k]
  ------------------
  975|  3.76k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  3.76k|#define _(String) (String)
  ------------------
  976|  1.81k|      else
  977|  1.81k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  5.57k|      io_->readOrThrow(buf.data(), 1);
  980|  5.57k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  5.57k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 3.37k, False: 2.19k]
  ------------------
  982|  3.37k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  3.37k|#define _(String) (String)
  ------------------
  983|  2.19k|      else
  984|  2.19k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  5.57k|      io_->readOrThrow(buf.data(), 1);
  987|  5.57k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  5.57k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 3.67k, False: 1.89k]
  ------------------
  989|  3.67k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  3.67k|#define _(String) (String)
  ------------------
  990|  1.89k|      else
  991|  1.89k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  5.57k|      io_->readOrThrow(buf.data(), 1);
  994|  5.57k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  5.57k|      io_->readOrThrow(buf.data(), 1);
  997|  5.57k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  5.57k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 620, False: 4.95k]
  ------------------
  999|    620|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    620|#define _(String) (String)
  ------------------
 1000|  4.95k|      else
 1001|  4.95k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  5.57k|      io_->readOrThrow(buf.data(), 1);
 1004|  5.57k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  5.57k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 1.45k, False: 4.12k]
  ------------------
 1006|  1.45k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.45k|#define _(String) (String)
  ------------------
 1007|  4.12k|      else
 1008|  4.12k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  5.57k|      io_->readOrThrow(buf.data(), 1);
 1011|  5.57k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  5.57k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  5.57k|    }
 1015|       |
 1016|   102k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 603, False: 101k]
  ------------------
 1017|    603|      size_t local_pos = io_->tell();
 1018|    603|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    603|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    603|      io_->readOrThrow(buf.data(), 2);
 1022|    603|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    603|      io_->readOrThrow(buf.data(), 1);
 1024|    603|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    603|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 473, False: 130]
  ------------------
 1026|    473|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    473|#define _(String) (String)
  ------------------
 1027|       |
 1028|    603|      io_->readOrThrow(buf.data(), 1);
 1029|    603|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    603|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 306, False: 297]
  ------------------
 1031|    306|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    306|#define _(String) (String)
  ------------------
 1032|       |
 1033|    603|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    603|    }
 1035|       |
 1036|   101k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 2.00k, False: 99.5k]
  |  Branch (1036:31): [True: 253, False: 99.2k]
  ------------------
 1037|  1.35k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.35k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.35k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 685, False: 670]
  ------------------
 1042|    685|#ifndef SUPPRESS_WARNINGS
 1043|    685|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    685|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 685]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    685|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    685|#endif
 1046|    685|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    685|        buf.data()[0] = '\0';
 1048|    685|      } else {
 1049|    670|        io_->readOrThrow(buf.data(), dataLength);
 1050|    670|        buf.data()[dataLength] = '\0';
 1051|    670|      }
 1052|       |
 1053|  1.35k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 365, False: 990]
  ------------------
 1054|    365|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    365|#define _(String) (String)
  ------------------
 1055|    365|      }
 1056|   100k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 2.82k, False: 97.3k]
  ------------------
 1057|  2.82k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  2.82k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  2.82k|      io_->readOrThrow(buf.data(), 4);
 1060|  2.82k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 1.10k, False: 1.71k]
  ------------------
 1061|  1.10k|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|  1.10k|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  2.82k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 2.58k, False: 237]
  |  Branch (1064:31): [True: 122, False: 115]
  ------------------
 1065|  2.70k|#ifndef SUPPRESS_WARNINGS
 1066|  2.70k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.70k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.70k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.70k|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|  2.70k|#endif
 1069|  2.70k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|  2.70k|      } else
 1071|    118|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  97.3k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 1.66k, False: 95.6k]
  ------------------
 1073|  1.66k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  1.66k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  1.66k|      io_->readOrThrow(buf.data(), 2);
 1076|  1.66k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 774, False: 894]
  ------------------
 1077|    774|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    774|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  1.66k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 317, False: 1.35k]
  |  Branch (1080:31): [True: 326, False: 1.02k]
  ------------------
 1081|    643|#ifndef SUPPRESS_WARNINGS
 1082|    643|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    643|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 643]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    643|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|    643|#endif
 1085|    643|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|    643|      } else
 1087|  1.02k|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  95.6k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 1.30k, False: 94.3k]
  ------------------
 1089|  1.30k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  1.30k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  1.30k|      io_->readOrThrow(buf.data(), 4);
 1092|  1.30k|      io_->readOrThrow(buf2.data(), 4);
 1093|  1.30k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 845, False: 456]
  ------------------
 1094|    845|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    845|#define _(String) (String)
  ------------------
 1095|    845|            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|  1.30k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 366, False: 935]
  |  Branch (1098:31): [True: 242, False: 693]
  ------------------
 1099|    589|#ifndef SUPPRESS_WARNINGS
 1100|    589|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    589|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 589]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    589|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    589|#endif
 1103|    589|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    589|      } else
 1105|    712|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  94.3k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 858, False: 93.5k]
  ------------------
 1107|    858|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|    858|      std::memset(buf.data(), 0x0, buf.size());
 1109|    858|      io_->readOrThrow(buf.data(), 2);
 1110|    858|      io_->readOrThrow(buf2.data(), 2);
 1111|    858|      if (td)
  ------------------
  |  Branch (1111:11): [True: 563, False: 295]
  ------------------
 1112|    563|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    563|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    563|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|    858|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 397, False: 461]
  |  Branch (1115:31): [True: 113, False: 348]
  ------------------
 1116|    505|#ifndef SUPPRESS_WARNINGS
 1117|    505|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    505|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 505]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    505|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    505|#endif
 1120|    505|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    505|      } else
 1122|    353|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|    858|    }
 1124|   107k|  }
 1125|       |
 1126|  2.14k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  2.14k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  3.66k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  3.66k|  size_t current_position = io_->tell();
 1131|  3.66k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  3.66k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 3.66k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  3.66k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  71.6k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 71.6k, False: 0]
  |  Branch (1136:25): [True: 70.1k, False: 1.55k]
  ------------------
 1137|  70.1k|    io_->readOrThrow(buf.data(), 4);
 1138|  70.1k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 2.10k, False: 68.0k]
  ------------------
 1139|  2.10k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 257, False: 1.84k]
  ------------------
 1140|    257|        break;
 1141|  1.84k|      io_->readOrThrow(buf.data(), 4);
 1142|  1.84k|      io_->readOrThrow(buf.data(), 4);
 1143|  1.84k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  1.84k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 43, False: 1.80k]
  ------------------
 1146|     43|        currentStream_ = Video;
 1147|  1.80k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 394, False: 1.40k]
  ------------------
 1148|    394|        currentStream_ = Audio;
 1149|  1.40k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 618, False: 790]
  ------------------
 1150|    618|        currentStream_ = Hint;
 1151|    790|      else
 1152|    790|        currentStream_ = GenMediaHeader;
 1153|  1.84k|      break;
 1154|  2.10k|    }
 1155|  70.1k|  }
 1156|       |
 1157|  3.66k|  io_->seek(current_position, BasicIo::beg);
 1158|  3.66k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|    500|void QuickTimeVideo::timeToSampleDecoder() {
 1161|    500|  DataBuf buf(4 + 1);
 1162|    500|  io_->readOrThrow(buf.data(), 4);
 1163|    500|  io_->readOrThrow(buf.data(), 4);
 1164|    500|  uint64_t totalframes = 0;
 1165|    500|  uint64_t timeOfFrames = 0;
 1166|    500|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  1.73k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 1.23k, False: 500]
  ------------------
 1169|  1.23k|    io_->readOrThrow(buf.data(), 4);
 1170|  1.23k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  1.23k|    totalframes = Safe::add(totalframes, temp);
 1172|  1.23k|    io_->readOrThrow(buf.data(), 4);
 1173|  1.23k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  1.23k|  }
 1175|    500|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 287, False: 213]
  ------------------
 1176|    287|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 114, False: 173]
  ------------------
 1177|    114|      timeOfFrames = 1;
 1178|    287|    xmpData_["Xmp.video.FrameRate"] =
 1179|    287|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    287|  }
 1181|    500|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.74k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.74k|  DataBuf buf(100);
 1185|  1.74k|  size_t cur_pos = io_->tell();
 1186|  1.74k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.74k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.74k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|   101k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 100k, False: 1.34k]
  ------------------
 1191|   100k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 57.7k, False: 42.7k]
  ------------------
 1192|  57.7k|      imageDescDecoder();
 1193|  42.7k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 42.3k, False: 403]
  ------------------
 1194|  42.3k|      audioDescDecoder();
 1195|    403|    else
 1196|    403|      break;
 1197|   100k|  }
 1198|  1.74k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.74k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  42.3k|void QuickTimeVideo::audioDescDecoder() {
 1202|  42.3k|  DataBuf buf(40);
 1203|  42.3k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  42.3k|  buf.data()[4] = '\0';
 1205|  42.3k|  io_->readOrThrow(buf.data(), 4);
 1206|  42.3k|  size_t size = 82;
 1207|       |
 1208|  42.3k|  const TagVocabulary* td;
 1209|       |
 1210|   889k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 846k, False: 42.3k]
  ------------------
 1211|   846k|    io_->readOrThrow(buf.data(), 4);
 1212|   846k|    switch (i) {
 1213|  42.3k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 42.3k, False: 804k]
  ------------------
 1214|  42.3k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  42.3k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 435, False: 41.9k]
  ------------------
 1216|    435|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    435|#define _(String) (String)
  ------------------
 1217|  41.9k|        else
 1218|  41.9k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  42.3k|        break;
 1220|  42.3k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 42.3k, False: 804k]
  ------------------
 1221|  42.3k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  42.3k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 1.24k, False: 41.1k]
  ------------------
 1223|  1.24k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.24k|#define _(String) (String)
  ------------------
 1224|  42.3k|        break;
 1225|  42.3k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 42.3k, False: 804k]
  ------------------
 1226|  42.3k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  42.3k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  42.3k|        break;
 1229|  42.3k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 42.3k, False: 804k]
  ------------------
 1230|  42.3k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  42.3k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  42.3k|        break;
 1233|   677k|      default:
  ------------------
  |  Branch (1233:7): [True: 677k, False: 169k]
  ------------------
 1234|   677k|        break;
 1235|   846k|    }
 1236|   846k|  }
 1237|  42.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  42.3k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  57.7k|void QuickTimeVideo::imageDescDecoder() {
 1241|  57.7k|  DataBuf buf(40);
 1242|  57.7k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  57.7k|  buf.data()[4] = '\0';
 1244|  57.7k|  io_->readOrThrow(buf.data(), 4);
 1245|  57.7k|  size_t size = 82;
 1246|       |
 1247|  57.7k|  const TagVocabulary* td;
 1248|       |
 1249|   691k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 634k, False: 57.5k]
  ------------------
 1250|   634k|    io_->readOrThrow(buf.data(), 4);
 1251|   634k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   634k|    switch (i) {
 1254|  57.6k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 57.6k, False: 576k]
  ------------------
 1255|  57.6k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  57.6k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 3.27k, False: 54.4k]
  ------------------
 1257|  3.27k|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|  3.27k|#define _(String) (String)
  ------------------
 1258|  54.4k|        else
 1259|  54.4k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  57.6k|        break;
 1261|  57.6k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 57.6k, False: 576k]
  ------------------
 1262|  57.6k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  57.6k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 1.89k, False: 55.7k]
  ------------------
 1264|  1.89k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.89k|#define _(String) (String)
  ------------------
 1265|  57.6k|        break;
 1266|  57.6k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 57.6k, False: 576k]
  ------------------
 1267|  57.6k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  57.6k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  57.6k|        break;
 1270|  57.5k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 57.5k, False: 576k]
  ------------------
 1271|  57.5k|        xmpData_["Xmp.video.XResolution"] =
 1272|  57.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  57.5k|        break;
 1274|  57.5k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 57.5k, False: 576k]
  ------------------
 1275|  57.5k|        xmpData_["Xmp.video.YResolution"] =
 1276|  57.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  57.5k|        io_->readOrThrow(buf.data(), 3);
 1278|  57.5k|        size -= 3;
 1279|  57.5k|        break;
 1280|  57.5k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 57.5k, False: 576k]
  ------------------
 1281|  57.5k|        io_->readOrThrow(buf.data(), 32);
 1282|  57.5k|        size -= 32;
 1283|  57.5k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  57.5k|        break;
 1285|   288k|      default:
  ------------------
  |  Branch (1285:7): [True: 288k, False: 345k]
  ------------------
 1286|   288k|        break;
 1287|   634k|    }
 1288|   634k|  }
 1289|  57.5k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  57.5k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  57.5k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  1.87k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  1.87k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  1.87k|  DataBuf buf(4 + 1);
 1296|  1.87k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.87k|  io_->readOrThrow(buf.data(), 4);
 1298|  1.87k|  uint32_t noOfEntries;
 1299|       |
 1300|  1.87k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  5.59k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 4.00k, False: 1.58k]
  |  Branch (1302:43): [True: 3.72k, False: 289]
  ------------------
 1303|  3.72k|    decodeBlock(recursion_depth + 1);
 1304|  3.72k|  }
 1305|  1.87k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  5.88k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  5.88k|  DataBuf buf(3);
 1309|  5.88k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  5.88k|  buf.data()[2] = '\0';
 1311|  5.88k|  currentStream_ = Video;
 1312|       |
 1313|  5.88k|  const TagDetails* td;
 1314|       |
 1315|  38.6k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 32.7k, False: 5.88k]
  ------------------
 1316|  32.7k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  32.7k|    switch (i) {
 1319|  5.67k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 5.67k, False: 27.1k]
  ------------------
 1320|  5.67k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  5.67k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 4.40k, False: 1.27k]
  ------------------
 1322|  4.40k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  4.40k|#define _(String) (String)
  ------------------
 1323|  5.67k|        break;
 1324|  2.28k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 2.28k, False: 30.5k]
  ------------------
 1325|  2.28k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  2.28k|        break;
 1327|  24.8k|      default:
  ------------------
  |  Branch (1327:7): [True: 24.8k, False: 7.95k]
  ------------------
 1328|  24.8k|        break;
 1329|  32.7k|    }
 1330|  32.7k|  }
 1331|  5.88k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  5.88k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  1.99k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  1.99k|  size_t cur_pos = io_->tell();
 1336|  1.99k|  DataBuf buf(5);
 1337|  1.99k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  1.99k|  buf.data()[4] = '\0';
 1339|       |
 1340|  1.99k|  const TagVocabulary* tv;
 1341|       |
 1342|  11.8k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 9.93k, False: 1.95k]
  ------------------
 1343|  9.93k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  9.93k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 5.95k, False: 3.98k]
  ------------------
 1346|  1.99k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 1.99k, False: 7.94k]
  ------------------
 1347|  1.99k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  1.99k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 226, False: 1.76k]
  ------------------
 1349|    226|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 72, False: 154]
  ------------------
 1350|     72|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     72|#define _(String) (String)
  ------------------
 1351|    154|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 67, False: 87]
  ------------------
 1352|     67|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|     67|#define _(String) (String)
  ------------------
 1353|    226|        }
 1354|  1.99k|        break;
 1355|  1.98k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 1.98k, False: 7.95k]
  ------------------
 1356|  1.98k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  1.98k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 1.59k, False: 383]
  ------------------
 1358|  1.59k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 161, False: 1.43k]
  ------------------
 1359|    161|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    161|#define _(String) (String)
  ------------------
 1360|  1.43k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 107, False: 1.33k]
  ------------------
 1361|    107|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    107|#define _(String) (String)
  ------------------
 1362|  1.59k|        }
 1363|  1.98k|        break;
 1364|  1.97k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 1.97k, False: 7.95k]
  ------------------
 1365|  1.97k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  1.97k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 1.00k, False: 976]
  ------------------
 1367|  1.00k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 149, False: 853]
  ------------------
 1368|    149|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    149|#define _(String) (String)
  ------------------
 1369|    853|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 100, False: 753]
  ------------------
 1370|    100|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    100|#define _(String) (String)
  ------------------
 1371|  1.00k|        }
 1372|  1.97k|        break;
 1373|  9.93k|    }
 1374|  9.93k|  }
 1375|  1.95k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  1.95k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  11.1k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  11.1k|  DataBuf buf(5);
 1380|  11.1k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  11.1k|  buf.data()[4] = '\0';
 1382|  11.1k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  11.1k|  const TagVocabulary* td;
 1384|       |
 1385|  79.0k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 67.9k, False: 11.1k]
  ------------------
 1386|  67.9k|    io_->readOrThrow(buf.data(), 4);
 1387|  67.9k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  67.9k|    switch (i) {
 1390|  9.68k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 9.68k, False: 58.2k]
  ------------------
 1391|  9.68k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 8.25k, False: 1.43k]
  ------------------
 1392|  8.25k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  8.25k|#define _(String) (String)
  ------------------
 1393|  9.68k|        break;
 1394|  2.00k|      case 1:
  ------------------
  |  Branch (1394:7): [True: 2.00k, False: 65.9k]
  ------------------
 1395|  2.00k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|  2.00k|        break;
 1397|  56.2k|      default:
  ------------------
  |  Branch (1397:7): [True: 56.2k, False: 11.6k]
  ------------------
 1398|  56.2k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 1.56k, False: 54.6k]
  ------------------
 1399|  1.56k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.56k|#define _(String) (String)
  ------------------
 1400|  54.6k|        else
 1401|  54.6k|          v->read(Exiv2::toString(buf.data()));
 1402|  56.2k|        break;
 1403|  67.9k|    }
 1404|  67.9k|  }
 1405|  11.1k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  11.1k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  11.1k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|  1.04k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|  1.04k|  DataBuf buf(5);
 1411|  1.04k|  std::memset(buf.data(), 0x0, buf.size());
 1412|  1.04k|  buf.data()[4] = '\0';
 1413|  1.04k|  int64_t time_scale = 1;
 1414|       |
 1415|  5.06k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 4.02k, False: 1.04k]
  ------------------
 1416|  4.02k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  4.02k|    switch (i) {
 1419|    798|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 798, False: 3.22k]
  ------------------
 1420|    798|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 507, False: 291]
  ------------------
 1421|    507|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|    291|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 103, False: 188]
  ------------------
 1423|    103|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    798|        break;
 1425|    372|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 372, False: 3.64k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|    372|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 107, False: 265]
  ------------------
 1428|    107|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|    265|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 103, False: 162]
  ------------------
 1430|    103|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    372|        break;
 1432|    355|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 355, False: 3.66k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|    355|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 98, False: 257]
  ------------------
 1435|     98|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|    257|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 103, False: 154]
  ------------------
 1437|    103|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    355|        break;
 1439|    354|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 354, False: 3.66k]
  ------------------
 1440|    354|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 98, False: 256]
  ------------------
 1441|     98|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|    256|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 103, False: 153]
  ------------------
 1443|    103|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    354|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|    354|        mdhdTimeScale_ = time_scale;
 1446|    354|        break;
 1447|    350|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 350, False: 3.67k]
  ------------------
 1448|    350|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 98, False: 252]
  ------------------
 1449|     98|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 98, False: 0]
  ------------------
 1450|    252|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 103, False: 149]
  ------------------
 1451|    103|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 103, False: 0]
  ------------------
 1452|    350|        break;
 1453|    350|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 350, False: 3.67k]
  ------------------
 1454|    350|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 98, False: 252]
  ------------------
 1455|     98|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|    252|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 103, False: 149]
  ------------------
 1457|    103|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    350|        break;
 1459|       |
 1460|  1.44k|      default:
  ------------------
  |  Branch (1460:7): [True: 1.44k, False: 2.57k]
  ------------------
 1461|  1.44k|        break;
 1462|  4.02k|    }
 1463|  4.02k|  }
 1464|  1.04k|  io_->readOrThrow(buf.data(), size % 4);
 1465|  1.04k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|  1.07k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|  1.07k|  DataBuf buf(5);
 1469|  1.07k|  std::memset(buf.data(), 0x0, buf.size());
 1470|  1.07k|  buf.data()[4] = '\0';
 1471|  1.07k|  int64_t temp = 0;
 1472|       |
 1473|  9.10k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 8.03k, False: 1.07k]
  ------------------
 1474|  8.03k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  8.03k|    switch (i) {
 1477|    409|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 409, False: 7.62k]
  ------------------
 1478|    409|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 113, False: 296]
  ------------------
 1479|    113|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|    296|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 19, False: 277]
  ------------------
 1481|     19|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    409|        break;
 1483|    404|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 404, False: 7.63k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|    404|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 113, False: 291]
  ------------------
 1486|    113|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|    291|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 19, False: 272]
  ------------------
 1488|     19|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    404|        break;
 1490|    339|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 339, False: 7.69k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|    339|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 80, False: 259]
  ------------------
 1493|     80|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|    259|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 19, False: 240]
  ------------------
 1495|     19|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    339|        break;
 1497|    336|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 336, False: 7.69k]
  ------------------
 1498|    336|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 77, False: 259]
  ------------------
 1499|     77|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|    259|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 19, False: 240]
  ------------------
 1501|     19|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    336|        break;
 1503|    319|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 319, False: 7.71k]
  ------------------
 1504|    319|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 77, False: 242]
  ------------------
 1505|     77|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 77, False: 0]
  ------------------
 1506|    242|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 19, False: 223]
  ------------------
 1507|     19|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 19, False: 0]
  ------------------
 1508|    319|        break;
 1509|    317|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 317, False: 7.71k]
  ------------------
 1510|    317|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 76, False: 241]
  ------------------
 1511|     76|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|    241|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 19, False: 222]
  ------------------
 1513|     19|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    317|        break;
 1515|    316|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 316, False: 7.71k]
  ------------------
 1516|    316|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 76, False: 240]
  ------------------
 1517|     76|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|    240|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 18, False: 222]
  ------------------
 1519|     18|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    316|        break;
 1521|    295|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 295, False: 7.73k]
  ------------------
 1522|    295|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 66, False: 229]
  ------------------
 1523|     66|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|     66|          xmpData_["Xmp.video.Width"] = temp;
 1525|     66|          width_ = temp;
 1526|     66|        }
 1527|    295|        break;
 1528|    294|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 294, False: 7.74k]
  ------------------
 1529|    294|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 66, False: 228]
  ------------------
 1530|     66|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|     66|          xmpData_["Xmp.video.Height"] = temp;
 1532|     66|          height_ = temp;
 1533|     66|        }
 1534|    294|        break;
 1535|  5.00k|      default:
  ------------------
  |  Branch (1535:7): [True: 5.00k, False: 3.02k]
  ------------------
 1536|  5.00k|        break;
 1537|  8.03k|    }
 1538|  8.03k|  }
 1539|  1.07k|  io_->readOrThrow(buf.data(), size % 4);
 1540|  1.07k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|  1.15k|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|  1.15k|  DataBuf buf(5);
 1544|  1.15k|  std::memset(buf.data(), 0x0, buf.size());
 1545|  1.15k|  buf.data()[4] = '\0';
 1546|       |
 1547|  6.24k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 5.09k, False: 1.15k]
  ------------------
 1548|  5.09k|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|  5.09k|    switch (i) {
 1551|    612|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 612, False: 4.48k]
  ------------------
 1552|    612|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|    612|        break;
 1554|    609|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 609, False: 4.48k]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|    609|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|    609|        break;
 1558|    598|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 598, False: 4.49k]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|    598|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|    598|        break;
 1562|    590|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 590, False: 4.50k]
  ------------------
 1563|    590|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|    590|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|    590|        break;
 1566|    587|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 587, False: 4.50k]
  ------------------
 1567|    587|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 587, False: 0]
  ------------------
 1568|    587|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|    587|        }
 1570|    587|        break;
 1571|    587|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 587, False: 4.50k]
  ------------------
 1572|    587|        xmpData_["Xmp.video.PreferredRate"] =
 1573|    587|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|    587|        break;
 1575|    586|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 586, False: 4.50k]
  ------------------
 1576|    586|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|    586|        break;
 1578|     39|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 39, False: 5.05k]
  ------------------
 1579|     39|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     39|        break;
 1581|     38|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 38, False: 5.05k]
  ------------------
 1582|     38|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     38|        break;
 1584|     37|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 37, False: 5.05k]
  ------------------
 1585|     37|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     37|        break;
 1587|     31|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 31, False: 5.06k]
  ------------------
 1588|     31|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     31|        break;
 1590|     30|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 30, False: 5.06k]
  ------------------
 1591|     30|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     30|        break;
 1593|     27|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 27, False: 5.06k]
  ------------------
 1594|     27|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     27|        break;
 1596|     26|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 26, False: 5.06k]
  ------------------
 1597|     26|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|     26|        break;
 1599|    696|      default:
  ------------------
  |  Branch (1599:7): [True: 696, False: 4.39k]
  ------------------
 1600|    696|        break;
 1601|  5.09k|    }
 1602|  5.09k|  }
 1603|  1.15k|  io_->readOrThrow(buf.data(), size % 4);
 1604|  1.15k|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  5.86k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  5.86k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  5.86k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 24, False: 5.83k]
  ------------------
 1609|     24|    return nullptr;
 1610|     24|  }
 1611|  5.83k|  return image;
 1612|  5.86k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  28.2k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  28.2k|  auto buf = DataBuf(12 + 1);
 1616|  28.2k|  iIo.read(buf.data(), 12);
 1617|  28.2k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  28.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 28.2k]
  |  Branch (1619:22): [True: 548, False: 27.7k]
  ------------------
 1620|    548|    return false;
 1621|    548|  }
 1622|  27.7k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  27.7k|  bool matched = false;
 1625|       |
 1626|   139k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 139k, False: 6.28k]
  ------------------
 1627|   139k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   139k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 21.4k, False: 118k]
  ------------------
 1629|       |      // we only match if we actually know the video type. This is done
 1630|       |      // to avoid matching just on ftyp because bmffimage also has that
 1631|       |      // header.
 1632|  21.4k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 17.5k, False: 3.91k]
  ------------------
 1633|  17.5k|        matched = true;
 1634|  17.5k|      }
 1635|  21.4k|      break;
 1636|  21.4k|    }
 1637|   139k|  }
 1638|       |
 1639|  27.7k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 27.7k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  27.7k|    iIo.seek(0L, BasicIo::beg);
 1641|  27.7k|  }
 1642|       |
 1643|  27.7k|  return matched;
 1644|  28.2k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   130k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   130k|  const char ignoreList[13][5] = {
  505|   130k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   130k|  };
  507|       |
  508|   130k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.69M, False: 129k]
  ------------------
  509|  1.69M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 1.46k, False: 1.69M]
  ------------------
  510|  1.46k|      return true;
  511|       |
  512|   129k|  return false;
  513|   130k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  66.2k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  66.2k|  const char ignoreList[8][5] = {
  524|  66.2k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  66.2k|  };
  526|       |
  527|  66.2k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 517k, False: 58.1k]
  ------------------
  528|   517k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 8.06k, False: 509k]
  ------------------
  529|  8.06k|      return true;
  530|       |
  531|  58.1k|  return false;
  532|  66.2k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.88M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.88M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.88M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.88M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  3.30M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  1.68k|static std::string readString(BasicIo& io, size_t size) {
  621|  1.68k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  1.68k|  Exiv2::DataBuf str(size + 1);
  623|  1.68k|  io.readOrThrow(str.data(), size);
  624|  1.68k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  1.68k|  return Exiv2::toString(str.data());
  626|  1.68k|}

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

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

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  6.69k|  static constexpr auto tagList() {
   30|  6.69k|    return tagInfo_;
   31|  6.69k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    898|  static constexpr auto tagListCs() {
   34|    898|    return tagInfoCs_;
   35|    898|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    713|  static constexpr auto tagListCs2() {
   38|    713|    return tagInfoCs2_;
   39|    713|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  4.26k|  static constexpr auto tagListFp() {
   42|  4.26k|    return tagInfoFp_;
   43|  4.26k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|    285|  static constexpr auto tagListSonyMisc1() {
   46|    285|    return tagInfoSonyMisc1_;
   47|    285|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  1.76k|  static constexpr auto tagListSonyMisc2b() {
   50|  1.76k|    return tagInfoSonyMisc2b_;
   51|  1.76k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  6.31k|  static constexpr auto tagListSonyMisc3c() {
   54|  6.31k|    return tagInfoSonyMisc3c_;
   55|  6.31k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|    369|  static constexpr auto tagListSonySInfo1() {
   58|    369|    return tagInfoSonySInfo1_;
   59|    369|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  2.70M|const TagInfo* ifdTagList() {
 1779|  2.70M|  return ifdTagInfo;
 1780|  2.70M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|  40.0k|const TagInfo* exifTagList() {
 2217|  40.0k|  return exifTagInfo;
 2218|  40.0k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|  11.1k|const TagInfo* gpsTagList() {
 2433|  11.1k|  return gpsTagInfo;
 2434|  11.1k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  6.61k|const TagInfo* iopTagList() {
 2508|  6.61k|  return iopTagInfo;
 2509|  6.61k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  13.7k|const TagInfo* mnTagList() {
 2524|  13.7k|  return mnTagInfo;
 2525|  13.7k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.31M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.31M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.31M, False: 0]
  ------------------
 2529|  1.31M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.31M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  3.06M|bool isExifIfd(IfdId ifdId) {
 2534|  3.06M|  switch (ifdId) {
 2535|   575k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 575k, False: 2.48M]
  ------------------
 2536|   596k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 21.4k, False: 3.04M]
  ------------------
 2537|   605k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 8.55k, False: 3.05M]
  ------------------
 2538|   610k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 4.79k, False: 3.05M]
  ------------------
 2539|   733k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 122k, False: 2.94M]
  ------------------
 2540|   789k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 56.4k, False: 3.00M]
  ------------------
 2541|   790k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 414, False: 3.06M]
  ------------------
 2542|   790k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 3.06M]
  ------------------
 2543|  1.03M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 247k, False: 2.81M]
  ------------------
 2544|  1.16M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 129k, False: 2.93M]
  ------------------
 2545|  1.34M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 181k, False: 2.88M]
  ------------------
 2546|  1.53M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 188k, False: 2.87M]
  ------------------
 2547|  1.55M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 22.2k, False: 3.04M]
  ------------------
 2548|  1.57M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 19.0k, False: 3.04M]
  ------------------
 2549|  1.59M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 17.3k, False: 3.04M]
  ------------------
 2550|  1.61M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 17.6k, False: 3.04M]
  ------------------
 2551|  1.62M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 16.8k, False: 3.04M]
  ------------------
 2552|  1.71M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 83.3k, False: 2.98M]
  ------------------
 2553|  1.74M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 30.9k, False: 3.03M]
  ------------------
 2554|  1.74M|      return true;
 2555|  1.31M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.31M, False: 1.74M]
  ------------------
 2556|  1.31M|      return false;
 2557|  3.06M|  }
 2558|  3.06M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  4.36M|const TagInfo* tagList(IfdId ifdId) {
 2569|  4.36M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 4.36M, False: 0]
  ------------------
 2570|  4.36M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 4.36M, False: 0]
  ------------------
 2571|  4.36M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  4.36M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  3.06M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  3.06M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 3.06M, False: 0]
  ------------------
 2577|  3.06M|    int idx = 0;
 2578|   157M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 156M, False: 1.24M]
  ------------------
 2579|   156M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.82M, False: 154M]
  ------------------
 2580|  1.82M|        break;
 2581|   156M|    }
 2582|  3.06M|    return ti + idx;
 2583|  3.06M|  }
 2584|      0|  return nullptr;
 2585|  3.06M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|  1.30M|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|  1.30M|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 1.30M]
  ------------------
 2589|      0|    return nullptr;
 2590|  1.30M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 1.30M, False: 0]
  ------------------
 2591|  42.6M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 42.6M, False: 5.73k]
  ------------------
 2592|  42.6M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 1.29M, False: 41.3M]
  ------------------
 2593|  1.29M|        return ti + idx;
 2594|  1.29M|      }
 2595|  42.6M|    }
 2596|  1.30M|  }
 2597|  5.73k|  return nullptr;
 2598|  1.30M|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  3.22M|IfdId groupId(const std::string& groupName) {
 2601|  3.22M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 3.22M, False: 0]
  ------------------
 2602|  3.22M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  3.22M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  1.59M|const char* groupName(IfdId ifdId) {
 2613|  1.59M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 1.59M, False: 0]
  ------------------
 2614|  1.59M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  1.59M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|     23|float fnumber(float apertureValue) {
 2648|     23|  float result = std::exp2(apertureValue / 2.F);
 2649|     23|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 23]
  ------------------
 2650|      0|    result = 3.5F;
 2651|      0|  }
 2652|     23|  return result;
 2653|     23|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|     23|URational exposureTime(float shutterSpeedValue) {
 2656|     23|  URational ur(1, 1);
 2657|     23|  const double tmp = std::exp2(shutterSpeedValue);
 2658|     23|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 0, False: 23]
  ------------------
 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|     23|  } else {
 2665|     23|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     23|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 23, False: 0]
  |  Branch (2667:19): [True: 23, False: 0]
  ------------------
 2668|     23|      ur.first = static_cast<uint32_t>(x);
 2669|     23|    }
 2670|     23|  }
 2671|     23|  return ur;
 2672|     23|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|  1.30M|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|  1.30M|  auto ti = tagInfo(tagName, ifdId);
 2676|  1.30M|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 1.29M, False: 5.73k]
  |  Branch (2676:13): [True: 1.29M, False: 0]
  ------------------
 2677|  1.29M|    return ti->tag_;
 2678|  5.73k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 5.73k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  5.73k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  5.73k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  10.6k|const TagInfo* tagList(const std::string& groupName) {
 3295|  10.6k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  10.6k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 10.6k]
  |  Branch (3296:14): [True: 0, False: 10.6k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  10.6k|  return ii->tagList_();
 3300|  10.6k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  8.65M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  8.65M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 8.65M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 1.74M, False: 6.91M]
  |  Branch (42:86): [True: 19.9k, False: 6.89M]
  ------------------
   43|  1.76M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 19.1k, False: 1.74M]
  ------------------
   44|  8.65M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  5.65k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  5.65k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 0, False: 5.65k]
  |  Branch (48:20): [True: 0, False: 5.65k]
  ------------------
   49|      0|    wroteHeader_ = true;
   50|  5.65k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|   374k|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|   374k|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 5.65k, False: 368k]
  |  Branch (53:24): [True: 5.65k, False: 0]
  ------------------
   54|  5.65k|    io_.write(pHeader_, size_);
   55|  5.65k|    wroteHeader_ = true;
   56|  5.65k|  }
   57|   374k|  return io_.write(pData, wcount);
   58|   374k|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  4.49k|int IoWrapper::putb(byte data) {
   61|  4.49k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 4.49k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  4.49k|  return io_.putb(data);
   66|  4.49k|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|  96.5k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|  96.5k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  16.2k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  16.2k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  3.98k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  3.98k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  3.98k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  5.06k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  5.06k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  2.78k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  2.78k|    cfgSelFct_(cfgSelFct),
   99|  2.78k|    arraySet_(arraySet),
  100|  2.78k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  2.78k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  2.17M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  2.17M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  2.17M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  78.7k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  78.7k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  99.9k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  99.9k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  14.0k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  14.0k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  14.0k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  4.10M|int TiffEntryBase::idx() const {
  206|  4.10M|  return idx_;
  207|  4.10M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|  43.6k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|  43.6k|  storage_ = std::move(buf);
  211|  43.6k|  pData_ = storage_->data();
  212|  43.6k|  size_ = storage_->size();
  213|  43.6k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  1.57M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  1.57M|  pData_ = pData;
  217|  1.57M|  size_ = size;
  218|  1.57M|  storage_ = std::move(storage);
  219|  1.57M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 1.57M]
  ------------------
  220|      0|    size_ = 0;
  221|  1.57M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|   156k|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|   156k|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 156k]
  ------------------
  225|      0|    return;
  226|   156k|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 43.2k, False: 113k]
  ------------------
  227|  43.2k|    auto d = std::make_shared<DataBuf>(newSize);
  228|  43.2k|    setData(std::move(d));
  229|  43.2k|  }
  230|   156k|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 43.2k, False: 113k]
  ------------------
  231|  43.2k|    memset(pData_, 0x0, size_);
  232|  43.2k|  }
  233|   156k|  size_ = value->copy(pData_, byteOrder);
  234|   156k|  setValue(std::move(value));
  235|   156k|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  1.74M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  1.74M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 1.74M]
  ------------------
  239|      0|    return;
  240|  1.74M|  tiffType_ = toTiffType(value->typeId());
  241|  1.74M|  count_ = value->count();
  242|  1.74M|  pValue_ = std::move(value);
  243|  1.74M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  11.5k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  11.5k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 546, False: 11.0k]
  |  Branch (246:20): [True: 544, False: 10.5k]
  ------------------
  247|  1.09k|#ifndef SUPPRESS_WARNINGS
  248|  1.09k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.09k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.09k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.09k|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|  1.09k|#endif
  251|  1.09k|    return;
  252|  1.09k|  }
  253|  10.5k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 995, False: 9.51k]
  ------------------
  254|    995|#ifndef SUPPRESS_WARNINGS
  255|    995|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    995|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 995]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    995|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|    995|#endif
  258|    995|    return;
  259|    995|  }
  260|  9.51k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.54k, False: 7.96k]
  ------------------
  261|  1.54k|#ifndef SUPPRESS_WARNINGS
  262|  1.54k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.54k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.54k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.54k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.54k|#endif
  266|  1.54k|    return;
  267|  1.54k|  }
  268|  7.96k|  size_t size = 0;
  269|  48.6k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 40.6k, False: 7.96k]
  ------------------
  270|  40.6k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  40.6k|  }
  272|  7.96k|  const size_t offset = pValue()->toUint32(0);
  273|  7.96k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 461, False: 7.50k]
  |  Branch (273:26): [True: 444, False: 7.06k]
  |  Branch (273:54): [True: 12, False: 7.05k]
  ------------------
  274|    917|#ifndef SUPPRESS_WARNINGS
  275|    917|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    917|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 917]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    917|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|    917|#endif
  278|    917|    return;
  279|    917|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  7.05k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 283, False: 6.76k]
  ------------------
  283|    283|#ifndef SUPPRESS_WARNINGS
  284|    283|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    283|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 283]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    283|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    283|#endif
  287|    283|    return;
  288|    283|  }
  289|  6.76k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  6.76k|  sizeDataArea_ = size;
  291|  6.76k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  6.76k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  51.0k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  51.0k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 1.35k, False: 49.6k]
  |  Branch (295:20): [True: 1.12k, False: 48.5k]
  ------------------
  296|  2.47k|#ifndef SUPPRESS_WARNINGS
  297|  2.47k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.47k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.47k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.47k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  2.47k|#endif
  300|  2.47k|    return;
  301|  2.47k|  }
  302|  48.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 8.36k, False: 40.1k]
  ------------------
  303|  8.36k|#ifndef SUPPRESS_WARNINGS
  304|  8.36k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  8.36k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.36k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.36k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  8.36k|#endif
  308|  8.36k|    return;
  309|  8.36k|  }
  310|   175k|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 135k, False: 40.1k]
  ------------------
  311|   135k|    const size_t offset = pValue()->toUint32(i);
  312|   135k|    const size_t size = pSize->toUint32(i);
  313|       |
  314|   135k|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 10.2k, False: 125k]
  |  Branch (314:28): [True: 10.1k, False: 115k]
  |  Branch (314:56): [True: 27, False: 115k]
  ------------------
  315|  20.4k|#ifndef SUPPRESS_WARNINGS
  316|  20.4k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  20.4k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 20.4k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  20.4k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  20.4k|#endif
  319|   115k|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 64.2k, False: 51.1k]
  ------------------
  320|  64.2k|      const byte* pStrip = pData + baseOffset + offset;
  321|  64.2k|      strips_.emplace_back(pStrip, size);
  322|  64.2k|    }
  323|   135k|  }
  324|  40.1k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  3.59k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  3.59k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 995, False: 2.60k]
  ------------------
  328|    995|    return 0;
  329|  2.60k|  return pHeader_->ifdOffset();
  330|  3.59k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  7.01k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  7.01k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 1.98k, False: 5.02k]
  |  Branch (333:20): [True: 3.40k, False: 1.62k]
  ------------------
  334|  5.39k|    return imageByteOrder_;
  335|  5.39k|  }
  336|  1.62k|  return pHeader_->byteOrder();
  337|  7.01k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  3.44k|size_t TiffIfdMakernote::mnOffset() const {
  340|  3.44k|  return mnOffset_;
  341|  3.44k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  3.57k|size_t TiffIfdMakernote::baseOffset() const {
  344|  3.57k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 995, False: 2.57k]
  ------------------
  345|    995|    return 0;
  346|  2.57k|  return pHeader_->baseOffset(mnOffset_);
  347|  3.57k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  3.98k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  3.98k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 995, False: 2.99k]
  ------------------
  351|    995|    return true;
  352|  2.99k|  return pHeader_->read(pData, size, byteOrder);
  353|  3.98k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  1.83M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  1.83M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  1.83M|  return count_ * TypeInfo::typeSize(typeId);
  375|  1.83M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  1.82k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  1.82k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 761, False: 1.06k]
  ------------------
  394|    761|    return true;  // Not a complex array
  395|       |
  396|  1.06k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  1.06k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 696, False: 367]
  ------------------
  398|    696|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|    696|    arrayDef_ = arraySet_[idx].def_;
  400|    696|    defSize_ = arraySet_[idx].defSize_;
  401|    696|  }
  402|  1.06k|  return idx > -1;
  403|  1.82k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  7.84k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  7.84k|  origData_ = const_cast<byte*>(pData());
  407|  7.84k|  origSize_ = TiffEntryBase::doSize();
  408|  7.84k|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|   915k|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|   915k|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|   915k|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|   915k|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|   915k|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|   915k|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 915k]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|   915k|  tp->setStart(pData() + idx);
  429|   915k|  auto s = storage();
  430|   915k|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|   915k|  tp->setElDef(def);
  432|   915k|  tp->setElByteOrder(cfg()->byteOrder_);
  433|   915k|  addChild(std::move(tc));
  434|   915k|  return sz;
  435|   915k|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|   325k|                                      TiffComponent::UniquePtr object) {
  439|   325k|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|   325k|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|   162k|                                        TiffComponent::UniquePtr /*object*/) {
  444|   162k|  return this;
  445|   162k|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|   162k|                                        TiffComponent::UniquePtr object) {
  449|   162k|  tiffPath.pop();
  450|   162k|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|   162k|  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|   162k|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 0, False: 162k]
  |  Branch (457:31): [True: 0, False: 162k]
  |  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|   162k|  if (tc)
  ------------------
  |  Branch (470:7): [True: 0, False: 162k]
  ------------------
  471|      0|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|   162k|  auto atc = [&] {
  474|   162k|    if (tiffPath.size() == 1 && object) {
  475|   162k|      return std::move(object);
  476|   162k|    }
  477|   162k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   162k|  }();
  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|   162k|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 162k, False: 0]
  |  Branch (482:31): [True: 0, False: 162k]
  ------------------
  483|      0|    return nullptr;
  484|       |
  485|   162k|  tc = [&] {
  486|   162k|    if (tpi.extendedTag() == Tag::next)
  487|   162k|      return this->addNext(std::move(atc));
  488|   162k|    return this->addChild(std::move(atc));
  489|   162k|  }();
  490|   162k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|   162k|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  2.23M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  2.23M|  return doAddChild(std::move(tiffComponent));
  573|  2.23M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  1.26M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  1.26M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  1.26M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  54.7k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  54.7k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  54.7k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 54.7k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  54.7k|  return ifds_.emplace_back(std::move(d)).get();
  589|  54.7k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|   915k|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|   915k|  setDecoded(true);
  604|   915k|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|   915k|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  2.54k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  2.54k|  return doAddNext(std::move(tiffComponent));
  609|  2.54k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  2.54k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  2.54k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 2.54k, False: 0]
  ------------------
  617|  2.54k|    pNext_ = std::move(tiffComponent);
  618|  2.54k|    return pNext_.get();
  619|  2.54k|  }
  620|      0|  return nullptr;
  621|  2.54k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  22.0M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  22.0M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 22.0M, False: 18.1k]
  ------------------
  636|  22.0M|    doAccept(visitor);  // one for NVI :)
  637|  22.0M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  12.3M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  12.3M|  visitor.visitEntry(this);
  641|  12.3M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   102k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   102k|  visitor.visitDataEntry(this);
  645|   102k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  2.12M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  2.12M|  visitor.visitImageEntry(this);
  649|  2.12M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  3.19M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  3.19M|  visitor.visitSizeEntry(this);
  653|  3.19M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|   936k|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|   936k|  visitor.visitDirectory(this);
  657|  18.3M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 18.3M, False: 738k]
  ------------------
  658|  18.3M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 198k, False: 18.1M]
  ------------------
  659|   198k|      break;
  660|  18.1M|    component->accept(visitor);
  661|  18.1M|  }
  662|   936k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 731k, False: 205k]
  ------------------
  663|   731k|    visitor.visitDirectoryNext(this);
  664|   936k|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 54.5k, False: 882k]
  ------------------
  665|  54.5k|    pNext_->accept(visitor);
  666|   936k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 716k, False: 220k]
  ------------------
  667|   716k|    visitor.visitDirectoryEnd(this);
  668|   936k|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   191k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   191k|  visitor.visitSubIfd(this);
  672|   698k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 698k, False: 143k]
  ------------------
  673|   698k|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 47.2k, False: 651k]
  ------------------
  674|  47.2k|      break;
  675|   651k|    ifd->accept(visitor);
  676|   651k|  }
  677|   191k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|  52.9k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|  52.9k|  visitor.visitMnEntry(this);
  681|  52.9k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 16.0k, False: 36.9k]
  ------------------
  682|  16.0k|    mn_->accept(visitor);
  683|  52.9k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 897, False: 52.0k]
  ------------------
  684|    897|    mn_ = nullptr;
  685|    897|  }
  686|       |
  687|  52.9k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  16.0k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  16.0k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 16.0k, False: 0]
  ------------------
  691|  16.0k|    visitor.visitIfdMakernote(this);
  692|  16.0k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 15.4k, False: 543]
  ------------------
  693|  15.4k|    ifd_.accept(visitor);
  694|  16.0k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 15.4k, False: 543]
  |  Branch (694:52): [True: 9.41k, False: 6.04k]
  ------------------
  695|  9.41k|    visitor.visitIfdMakernoteEnd(this);
  696|  16.0k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|  62.8k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|  62.8k|  visitor.visitBinaryArray(this);
  700|  2.98M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 2.98M, False: 62.2k]
  ------------------
  701|  2.98M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 630, False: 2.98M]
  ------------------
  702|    630|      break;
  703|  2.98M|    element->accept(visitor);
  704|  2.98M|  }
  705|  62.8k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 54.6k, False: 8.19k]
  ------------------
  706|  54.6k|    visitor.visitBinaryArrayEnd(this);
  707|  62.8k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  3.00M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  3.00M|  visitor.visitBinaryElement(this);
  711|  3.00M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|   162k|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|   162k|  doEncode(encoder, datum);
  715|   162k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|   119k|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|   119k|  encoder.encodeTiffEntry(this, datum);
  731|   119k|}
_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|  25.4k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  25.4k|  encoder.encodeSizeEntry(this, datum);
  743|  25.4k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|   249k|size_t TiffComponent::count() const {
  750|   249k|  return doCount();
  751|   249k|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|  5.65k|size_t TiffDirectory::doCount() const {
  754|  5.65k|  return components_.size();
  755|  5.65k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|   243k|size_t TiffEntryBase::doCount() const {
  758|   243k|  return count_;
  759|   243k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|   167k|                            size_t& imageIdx) {
  807|   167k|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|   167k|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  5.65k|                              size_t& imageIdx) {
  812|  5.65k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  5.65k|  const size_t compCount = count();
  816|  5.65k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 5.65k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  5.65k|  size_t sizeNext = 0;
  821|  5.65k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 0, False: 5.65k]
  ------------------
  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|  5.65k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 0, False: 5.65k]
  |  Branch (825:25): [True: 0, False: 0]
  ------------------
  826|      0|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  5.65k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 0, False: 5.65k]
  ------------------
  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|  5.65k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 5.65k, 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|  5.65k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 5.65k, False: 0]
  ------------------
  842|  5.65k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  5.65k|  }
  844|       |  // Size of IFD values and additional data
  845|  5.65k|  size_t sizeValue = 0;
  846|  5.65k|  size_t sizeData = 0;
  847|   162k|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 162k, False: 5.65k]
  ------------------
  848|   162k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 11.9k, False: 150k]
  ------------------
  849|  11.9k|      sv += sv & 1;  // Align value to word boundary
  850|  11.9k|      sizeValue += sv;
  851|  11.9k|    }
  852|       |    // Also add the size of data, but only if needed
  853|   162k|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 162k, False: 0]
  ------------------
  854|   162k|      auto sd = component->sizeData();
  855|   162k|      sd += sd & 1;  // Align data to word boundary
  856|   162k|      sizeData += sd;
  857|   162k|    }
  858|   162k|  }
  859|       |
  860|  5.65k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  5.65k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  5.65k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  5.65k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 5.65k, False: 0]
  ------------------
  864|  5.65k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  5.65k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  5.65k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  5.65k|  byte buf[4];
  870|  5.65k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  5.65k|  ioWrapper.write(buf, 2);
  872|  5.65k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|   161k|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 161k, False: 5.65k]
  ------------------
  875|   161k|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|   161k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 11.9k, False: 149k]
  ------------------
  877|  11.9k|      sv += sv & 1;  // Align value to word boundary
  878|  11.9k|      valueIdx += sv;
  879|  11.9k|    }
  880|   161k|    auto sd = component->sizeData();
  881|   161k|    sd += sd & 1;  // Align data to word boundary
  882|   161k|    dataIdx += sd;
  883|   161k|  }
  884|       |  // c) Pointer to the next IFD
  885|  5.65k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 5.56k, False: 84]
  ------------------
  886|  5.56k|    memset(buf, 0x0, 4);
  887|  5.56k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 0, False: 5.56k]
  |  Branch (887:19): [True: 0, False: 0]
  ------------------
  888|      0|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|      0|    }
  890|  5.56k|    ioWrapper.write(buf, 4);
  891|  5.56k|    idx += 4;
  892|  5.56k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  5.65k|  valueIdx = sizeDir;
  896|  5.65k|  dataIdx = sizeDir + sizeValue;
  897|   160k|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 160k, False: 5.65k]
  ------------------
  898|   160k|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 11.8k, False: 148k]
  ------------------
  899|  11.8k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  11.8k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  11.8k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 3.60k, False: 8.23k]
  ------------------
  902|  3.60k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  3.60k|        sv += 1;
  904|  3.60k|      }
  905|  11.8k|      idx += sv;
  906|  11.8k|      valueIdx += sv;
  907|  11.8k|    }
  908|   160k|    auto sd = component->sizeData();
  909|   160k|    sd += sd & 1;  // Align data to word boundary
  910|   160k|    dataIdx += sd;
  911|   160k|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  5.65k|  dataIdx = sizeDir + sizeValue;
  915|  5.65k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  5.65k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 0, False: 5.65k]
  |  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|  5.65k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 5.52k, False: 124]
  ------------------
  924|  5.52k|    idx += writeImage(ioWrapper, byteOrder);
  925|  5.52k|  }
  926|       |
  927|  5.65k|  return idx;
  928|  5.65k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|   161k|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|   161k|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|   161k|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 161k]
  ------------------
  934|      0|    return 0;
  935|   161k|  byte buf[8];
  936|   161k|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|   161k|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|   161k|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|   161k|  ioWrapper.write(buf, 8);
  940|   161k|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 11.9k, False: 149k]
  ------------------
  941|  11.9k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  11.9k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  11.9k|    ioWrapper.write(buf, 4);
  944|   149k|  } else {
  945|   149k|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|   149k|#ifndef SUPPRESS_WARNINGS
  947|   149k|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 0, False: 149k]
  ------------------
  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|   149k|#endif
  951|   149k|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 139k, False: 10.7k]
  ------------------
  952|   139k|      memset(buf, 0x0, 4);
  953|   139k|      ioWrapper.write(buf, 4 - len);
  954|   139k|    }
  955|   149k|  }
  956|   161k|  return 12;
  957|   161k|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|   144k|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|   144k|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 0, False: 144k]
  |  Branch (961:19): [True: 113k, False: 31.4k]
  ------------------
  962|   113k|    return 0;
  963|       |
  964|  31.4k|  DataBuf buf(pValue_->size());
  965|  31.4k|  pValue_->copy(buf.data(), byteOrder);
  966|  31.4k|  ioWrapper.write(buf.c_data(), buf.size());
  967|  31.4k|  return buf.size();
  968|   144k|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  11.2k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  11.2k|  size_t rc = 0;
  972|  11.2k|  switch (tiffType) {
  973|  1.98k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 1.98k, False: 9.27k]
  ------------------
  974|  3.61k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 1.63k, False: 9.63k]
  ------------------
  975|  3.61k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 4, False: 3.61k]
  ------------------
  976|      4|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  3.61k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  3.61k|      break;
  979|  4.47k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 4.47k, False: 6.78k]
  ------------------
  980|  7.54k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 3.06k, False: 8.19k]
  ------------------
  981|  7.54k|      if (offset > std::numeric_limits<uint32_t>::max())
  ------------------
  |  Branch (981:11): [True: 14, False: 7.52k]
  ------------------
  982|     14|        throw Error(ErrorCode::kerOffsetOutOfRange);
  983|  7.52k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  984|  7.52k|      break;
  985|    106|    default:
  ------------------
  |  Branch (985:5): [True: 106, False: 11.1k]
  ------------------
  986|    106|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  987|  11.2k|  }
  988|  11.1k|  return rc;
  989|  11.2k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1010|  16.9k|                               size_t dataIdx, size_t& imageIdx) {
 1011|  16.9k|  size_t o2 = imageIdx;
 1012|       |  // For makernotes, write TIFF image data to the data area
 1013|  16.9k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1013:7): [True: 0, False: 16.9k]
  ------------------
 1014|      0|    o2 = Safe::add<size_t>(offset, dataIdx);
 1015|       |#ifdef EXIV2_DEBUG_MESSAGES
 1016|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1017|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1018|       |#endif
 1019|  16.9k|  DataBuf buf(strips_.size() * 4);
 1020|  16.9k|  size_t idx = 0;
 1021|  16.9k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1021:29): [True: 11.2k, False: 16.9k]
  ------------------
 1022|  11.2k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1023|       |    // Align strip data to word boundary
 1024|  11.2k|    const auto sz = Safe::add(off, off & 1);
 1025|  11.2k|    o2 = Safe::add(o2, sz);
 1026|  11.2k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1026:9): [True: 11.1k, False: 124]
  ------------------
 1027|  11.1k|      imageIdx = Safe::add(imageIdx, sz);
 1028|  11.2k|  }
 1029|  16.9k|  ioWrapper.write(buf.c_data(), buf.size());
 1030|  16.9k|  return buf.size();
 1031|  16.9k|}  // TiffImageEntry::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1136|   166k|                                size_t& imageIdx) const {
 1137|   166k|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1138|   166k|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1141|  5.52k|                                  size_t& imageIdx) const {
 1142|  5.52k|  size_t len = 0;
 1143|   160k|  for (auto&& component : components_) {
  ------------------
  |  Branch (1143:25): [True: 160k, False: 5.52k]
  ------------------
 1144|   160k|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1145|   160k|  }
 1146|  5.52k|  return len;
 1147|  5.52k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1150|   143k|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1151|   143k|  return 0;
 1152|   143k|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1155|  16.6k|                                   size_t& /*imageIdx*/) const {
 1156|  16.6k|  size_t len = 0;
 1157|       |  // For makernotes, write TIFF image data to the data area
 1158|  16.6k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1158:7): [True: 0, False: 16.6k]
  ------------------
 1159|      0|    len = writeImage(ioWrapper, byteOrder);
 1160|      0|  }
 1161|  16.6k|  return len;
 1162|  16.6k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1199|   166k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1200|   166k|  return doWriteImage(ioWrapper, byteOrder);
 1201|   166k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1203|  5.52k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1204|  5.52k|  size_t len = 0;
 1205|  5.52k|  const TiffComponent* pSubIfd = nullptr;
 1206|   160k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1206:30): [True: 160k, False: 5.52k]
  ------------------
 1207|   160k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1207:9): [True: 0, False: 160k]
  ------------------
 1208|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1209|      0|#ifndef SUPPRESS_WARNINGS
 1210|      0|      if (pSubIfd) {
  ------------------
  |  Branch (1210:11): [True: 0, False: 0]
  ------------------
 1211|      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()
  ------------------
 1212|      0|      }
 1213|      0|#endif
 1214|      0|      pSubIfd = component.get();
 1215|      0|      continue;
 1216|      0|    }
 1217|   160k|    len += component->writeImage(ioWrapper, byteOrder);
 1218|   160k|  }
 1219|  5.52k|  if (pSubIfd) {
  ------------------
  |  Branch (1219:7): [True: 0, False: 5.52k]
  ------------------
 1220|      0|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1221|      0|  }
 1222|  5.52k|  if (pNext_) {
  ------------------
  |  Branch (1222:7): [True: 0, False: 5.52k]
  ------------------
 1223|      0|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1224|      0|  }
 1225|  5.52k|  return len;
 1226|  5.52k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1228|   143k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1229|   143k|  return 0;
 1230|   143k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1245|  16.6k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1246|  16.6k|  if (!pValue())
  ------------------
  |  Branch (1246:7): [True: 0, False: 16.6k]
  ------------------
 1247|      0|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1248|       |
 1249|  16.6k|  size_t len = pValue()->sizeDataArea();
 1250|  16.6k|  if (len > 0) {
  ------------------
  |  Branch (1250:7): [True: 2.03k, False: 14.6k]
  ------------------
 1251|       |#ifdef EXIV2_DEBUG_MESSAGES
 1252|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1253|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1254|       |#endif
 1255|  2.03k|    DataBuf buf = pValue()->dataArea();
 1256|  2.03k|    ioWrapper.write(buf.c_data(), buf.size());
 1257|  2.03k|    size_t align = len & 1;  // Align image data to word boundary
 1258|  2.03k|    if (align)
  ------------------
  |  Branch (1258:9): [True: 887, False: 1.15k]
  ------------------
 1259|    887|      ioWrapper.putb(0x0);
 1260|  2.03k|    len += align;
 1261|  14.6k|  } else {
 1262|       |#ifdef EXIV2_DEBUG_MESSAGES
 1263|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1264|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1265|       |#endif
 1266|  14.6k|    len = 0;
 1267|  14.6k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1267:24): [True: 0, False: 14.6k]
  ------------------
 1268|      0|      ioWrapper.write(f, s);
 1269|      0|      len += s;
 1270|      0|      size_t align = s & 1;  // Align strip data to word boundary
 1271|      0|      if (align)
  ------------------
  |  Branch (1271:11): [True: 0, False: 0]
  ------------------
 1272|      0|        ioWrapper.putb(0x0);
 1273|      0|      len += align;
 1274|      0|    }
 1275|  14.6k|  }
 1276|       |#ifdef EXIV2_DEBUG_MESSAGES
 1277|       |  std::cerr << ", len = " << len << " bytes\n";
 1278|       |#endif
 1279|  16.6k|  return len;
 1280|  16.6k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1282|   664k|size_t TiffComponent::size() const {
 1283|   664k|  return doSize();
 1284|   664k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1312|  3.36M|size_t TiffEntryBase::doSize() const {
 1313|  3.36M|  return size_;
 1314|  3.36M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1316|  67.9k|size_t TiffImageEntry::doSize() const {
 1317|  67.9k|  return strips_.size() * 4;
 1318|  67.9k|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1371|   485k|size_t TiffComponent::sizeData() const {
 1372|   485k|  return doSizeData();
 1373|   485k|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1379|   434k|size_t TiffEntryBase::doSizeData() const {
 1380|   434k|  return 0;
 1381|   434k|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1383|  50.9k|size_t TiffImageEntry::doSizeData() const {
 1384|  50.9k|  size_t len = 0;
 1385|       |  // For makernotes, TIFF image data is written to the data area
 1386|  50.9k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1386:7): [True: 0, False: 50.9k]
  ------------------
 1387|      0|    len = sizeImage();
 1388|      0|  }
 1389|  50.9k|  return len;
 1390|  50.9k|}
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1454|  3.84M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1455|  3.84M|  auto ti = static_cast<TypeId>(tiffType);
 1456|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1457|  3.84M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1457:22): [True: 1.55k, False: 3.84M]
  ------------------
 1458|  1.55k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1458:9): [True: 871, False: 681]
  ------------------
 1459|    871|      ti = comment;
 1460|    871|    }
 1461|  1.55k|  }
 1462|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1463|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1464|  3.84M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1464:7): [True: 698k, False: 3.15M]
  ------------------
 1465|   698k|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1465:9): [True: 446, False: 697k]
  |  Branch (1465:26): [True: 22, False: 424]
  |  Branch (1465:58): [True: 263, False: 698k]
  |  Branch (1465:75): [True: 74, False: 189]
  ------------------
 1466|     96|    ti = Exiv2::signedByte;
 1467|     96|  }
 1468|  3.84M|  return ti;
 1469|  3.84M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1471|  1.74M|TiffType toTiffType(TypeId typeId) {
 1472|  1.74M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1472:7): [True: 0, False: 1.74M]
  ------------------
 1473|      0|#ifndef SUPPRESS_WARNINGS
 1474|      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()
  ------------------
 1475|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1476|      0|#endif
 1477|      0|    return ttUndefined;
 1478|      0|  }
 1479|  1.74M|  return static_cast<TiffType>(typeId);
 1480|  1.74M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1482|  1.75M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1483|  1.75M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1483:7): [True: 504k, False: 1.25M]
  ------------------
 1484|   504k|    return lhs->tag() < rhs->tag();
 1485|  1.25M|  return lhs->idx() < rhs->idx();
 1486|  1.75M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1488|  1.04M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1489|  1.04M|  return std::make_unique<TiffEntry>(tag, group);
 1490|  1.04M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1492|  14.0k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1493|  14.0k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1494|  14.0k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1496|   920k|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1497|   920k|  return std::make_unique<TiffBinaryElement>(tag, group);
 1498|   920k|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|   162k|  auto atc = [&] {
  474|   162k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 162k, False: 0]
  |  Branch (474:33): [True: 0, False: 162k]
  ------------------
  475|      0|      return std::move(object);
  476|      0|    }
  477|   162k|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|   162k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|   162k|  tc = [&] {
  486|   162k|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 0, False: 162k]
  ------------------
  487|      0|      return this->addNext(std::move(atc));
  488|   162k|    return this->addChild(std::move(atc));
  489|   162k|  }();
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1439|  7.86k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1440|  7.86k|  const TagInfo* tags = [=] {
 1441|  7.86k|    if (group == IfdId::gpsId)
 1442|  7.86k|      return Internal::gpsTagList();
 1443|  7.86k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1444|  7.86k|  }();
 1445|  7.86k|  if (tags)
  ------------------
  |  Branch (1445:7): [True: 1.82k, False: 6.04k]
  ------------------
 1446|  65.6k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1446:26): [True: 65.3k, False: 270]
  ------------------
 1447|  65.3k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1447:11): [True: 1.55k, False: 63.7k]
  ------------------
 1448|  1.55k|        return tags + idx;
 1449|  6.31k|  return nullptr;
 1450|  7.86k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1440|  7.86k|  const TagInfo* tags = [=] {
 1441|  7.86k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1441:9): [True: 1.21k, False: 6.65k]
  ------------------
 1442|  1.21k|      return Internal::gpsTagList();
 1443|  6.65k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1443:12): [True: 611, False: 6.04k]
  ------------------
 1444|  7.86k|  }();

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|   325k|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|   325k|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|   488k|  [[nodiscard]] uint32_t extendedTag() const {
   86|   488k|    return extendedTag_;
   87|   488k|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|   162k|  [[nodiscard]] IfdId group() const {
   90|   162k|    return group_;
   91|   162k|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  2.28M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  2.28M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  2.10M|  void setStart(const byte* pStart) {
  217|  2.10M|    pStart_ = const_cast<byte*>(pStart);
  218|  2.10M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|  28.6M|  [[nodiscard]] uint16_t tag() const {
  241|  28.6M|    return tag_;
  242|  28.6M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  9.06M|  [[nodiscard]] IfdId group() const {
  245|  9.06M|    return group_;
  246|  9.06M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  2.19M|  [[nodiscard]] byte* start() const {
  249|  2.19M|    return pStart_;
  250|  2.19M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  1.59M|  void setOffset(size_t offset) {
  417|  1.59M|    offset_ = offset;
  418|  1.59M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|   193k|  [[nodiscard]] TiffType tiffType() const {
  459|   193k|    return tiffType_;
  460|   193k|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  11.9k|  [[nodiscard]] size_t offset() const {
  466|  11.9k|    return offset_;
  467|  11.9k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  1.92M|  [[nodiscard]] const byte* pData() const {
  477|  1.92M|    return pData_;
  478|  1.92M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  8.15M|  [[nodiscard]] const Value* pValue() const {
  481|  8.15M|    return pValue_.get();
  482|  8.15M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  1.58M|  void setIdx(int idx) {
  502|  1.58M|    idx_ = idx;
  503|  1.58M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|   915k|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|   915k|    return storage_;
  542|   915k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  63.9k|  [[nodiscard]] uint16_t szTag() const {
  624|  63.9k|    return szTag_;
  625|  63.9k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  63.9k|  [[nodiscard]] IfdId szGroup() const {
  628|  63.9k|    return szGroup_;
  629|  63.9k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  74.4k|  [[nodiscard]] uint16_t dtTag() const {
  790|  74.4k|    return dtTag_;
  791|  74.4k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  74.4k|  [[nodiscard]] IfdId dtGroup() const {
  794|  74.4k|    return dtGroup_;
  795|  74.4k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  36.7k|  [[nodiscard]] bool hasNext() const {
  843|  36.7k|    return hasNext_;
  844|  36.7k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  3.98k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  3.98k|    imageByteOrder_ = byteOrder;
 1108|  3.98k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|   873k|  bool operator==(size_t idx) const {
 1218|   873k|    return idx_ == idx;
 1219|   873k|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|   916k|  [[nodiscard]] size_t tagStep() const {
 1235|   916k|    return elDefaultDef_.size(0, group_);
 1236|   916k|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|   920k|  void setDecoded(bool decoded) {
 1311|   920k|    decoded_ = decoded;
 1312|   920k|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  3.67M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  3.67M|    return arrayCfg_;
 1320|  3.67M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|  1.45k|  [[nodiscard]] const ArrayDef* def() const {
 1323|  1.45k|    return arrayDef_;
 1324|  1.45k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  1.45k|  [[nodiscard]] size_t defSize() const {
 1327|  1.45k|    return defSize_;
 1328|  1.45k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|  5.75k|  [[nodiscard]] bool decoded() const {
 1331|  5.75k|    return decoded_;
 1332|  5.75k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|   915k|  void setElDef(const ArrayDef& def) {
 1405|   915k|    elDef_ = def;
 1406|   915k|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|   915k|  void setElByteOrder(ByteOrder byteOrder) {
 1411|   915k|    elByteOrder_ = byteOrder;
 1412|   915k|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|   920k|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|   920k|    return &elDef_;
 1422|   920k|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|   920k|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|   920k|    return elByteOrder_;
 1428|   920k|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  23.2k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  23.2k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  23.2k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    195|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    195|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    195|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     70|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     70|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     70|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    824|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    824|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    824|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    657|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    657|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    657|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.07k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.07k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.07k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.9k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.9k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.9k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  12.1k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  12.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  12.1k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.21k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.21k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.21k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.13k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.13k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.13k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.2k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.2k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.2k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  24.3k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  24.3k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  24.3k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  9.06k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  9.06k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  9.06k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  8.58k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  8.58k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  8.58k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.30k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.30k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.30k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.20k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.20k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.20k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    637|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    637|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    637|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  9.48k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  9.48k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  9.48k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  13.5k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  13.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  13.5k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.27k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.27k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.27k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.04k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.04k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.04k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    519|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    519|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    519|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    379|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    379|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    379|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.41k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.41k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.41k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.68k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.68k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.68k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.72k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.72k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.72k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.88k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.88k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.88k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    886|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    886|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    886|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    616|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    616|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    616|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.98k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.98k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.98k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.28k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.28k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.28k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.65k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.65k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.65k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.80k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.80k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.80k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    813|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    813|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    813|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    696|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    696|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    696|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.87k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.87k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.87k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.65k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.65k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.65k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.32k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.32k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.32k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    593|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    593|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    593|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    455|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    455|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    455|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    294|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    294|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    294|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    418|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    418|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    418|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    212|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    212|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    212|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    203|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    203|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    203|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    426|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    426|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    426|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    230|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    230|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    230|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    323|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    323|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    323|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    751|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    751|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    751|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    232|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    232|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    232|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    268|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    268|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    268|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    289|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    289|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    289|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    301|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    301|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    301|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    479|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    479|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    479|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    218|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    218|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    218|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    230|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    230|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    230|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    428|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    428|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    428|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    217|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    217|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    217|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    258|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    258|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    258|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    542|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    542|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    542|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    198|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    198|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    198|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    203|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    203|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    203|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    373|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    373|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    373|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    328|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    328|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    328|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    358|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    358|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    358|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    432|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    432|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    432|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__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|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  3.84k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  3.84k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  3.84k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  3.05k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  3.05k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  3.05k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    618|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    618|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    618|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    391|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    391|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    391|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    433|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    433|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    433|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.83k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.83k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.83k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  6.59k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  6.59k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  6.59k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    337|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    337|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    337|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    216|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    216|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    216|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    210|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    210|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    210|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    199|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    199|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    199|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     66|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     66|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     66|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     66|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     66|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     66|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    249|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    249|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    249|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    260|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    260|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    260|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    203|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    203|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    203|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    215|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    215|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    215|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    236|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    236|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    236|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     68|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     68|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     68|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    204|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    204|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    204|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     69|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     69|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     69|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     66|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     66|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     66|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    196|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    196|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    196|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    335|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    335|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    335|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     44|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     44|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     44|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    402|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    402|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    402|}
_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|     97|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     97|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     97|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     45|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     45|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     45|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     72|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     72|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     72|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     68|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     68|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     68|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    160|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    160|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    160|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    284|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    284|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    284|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     69|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     69|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     69|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__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_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    241|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    241|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    241|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    155|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    155|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    155|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     85|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     85|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     85|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    586|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    586|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    586|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    114|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    114|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    114|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    735|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    735|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    735|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    735|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    389|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    389|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    389|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    291|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    291|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    291|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     75|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     75|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     75|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    175|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    175|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    175|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    227|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    227|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    227|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    237|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    237|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    237|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    237|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    109|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    109|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    109|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     48|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     48|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     48|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     76|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     76|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     76|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     92|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     92|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     92|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     92|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     77|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     77|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     77|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     81|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     81|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     81|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    235|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    235|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    235|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     84|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     84|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     84|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     80|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     80|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    134|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    134|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    134|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    159|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    159|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    159|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    144|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    144|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    144|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    144|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     94|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     94|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     94|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     94|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     78|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     78|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     78|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     78|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    106|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    106|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    106|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    106|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    203|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    203|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    203|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    203|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    129|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    129|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    129|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    129|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    154|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    154|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    154|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    154|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     70|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     70|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     70|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     70|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    113|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    113|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    113|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    113|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     80|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     80|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     80|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     46|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     46|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     46|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     46|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     52|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     52|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     52|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    126|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    126|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    126|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     82|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     82|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     82|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    107|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    107|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    107|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     75|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     75|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     75|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     80|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     80|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     71|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     71|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     71|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     71|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__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|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    111|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    111|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    111|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    111|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    233|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    233|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    233|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    233|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    128|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    128|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    128|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    128|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    367|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    367|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    367|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    367|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__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_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    115|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    115|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    115|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    115|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    592|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    592|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    592|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    592|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     34|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     34|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     34|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    618|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    618|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    618|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    618|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    353|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    353|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    353|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    353|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     76|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     76|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     76|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     35|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     35|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     35|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     93|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     93|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     93|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  4.10k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  4.10k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  4.10k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  2.28M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  96.5k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  16.2k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  7.84k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|   162k|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|   162k|  return ifdId_ == md.ifdId();
   31|   162k|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.57M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.57M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.57M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 19.1k, False: 1.55M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  19.1k|    decoderFct = td->decoderFct_;
 1996|  19.1k|  }
 1997|  1.57M|  return decoderFct;
 1998|  1.57M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|   162k|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|   162k|  EncoderFct encoderFct = nullptr;
 2002|   162k|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 0, False: 162k]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|      0|    encoderFct = td->encoderFct_;
 2005|      0|  }
 2006|   162k|  return encoderFct;
 2007|   162k|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  2.24M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  2.24M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  2.24M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  2.24M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 1.96M, False: 276k]
  ------------------
 2014|  1.96M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  1.96M|  }
 2016|  2.24M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 2.23M, False: 3.76k]
  |  Branch (2016:7): [True: 2.21M, False: 25.9k]
  |  Branch (2016:37): [True: 2.21M, False: 22.2k]
  ------------------
 2017|  2.21M|    return i->second(tag, group);
 2018|  2.21M|  }
 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|  25.9k|  return nullptr;
 2028|  2.24M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|   162k|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|   162k|  TiffPath ret;
 2032|   325k|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 325k, Folded]
  ------------------
 2033|   325k|    ret.emplace(extendedTag, group);
 2034|   325k|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|   325k|    assert(ts != tiffTreeTable_.end());
 2036|   325k|    extendedTag = ts->second.second;
 2037|   325k|    group = ts->second.first;
 2038|   325k|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 162k, False: 162k]
  ------------------
 2039|   162k|      break;
 2040|   162k|    }
 2041|   325k|  }
 2042|   162k|  return ret;
 2043|   162k|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2047|  24.0k|                                   TiffHeaderBase* pHeader) {
 2048|       |  // Create standard TIFF header if necessary
 2049|  24.0k|  std::unique_ptr<TiffHeaderBase> ph;
 2050|  24.0k|  if (!pHeader) {
  ------------------
  |  Branch (2050:7): [True: 19.6k, False: 4.37k]
  ------------------
 2051|  19.6k|    ph = std::make_unique<TiffHeader>();
 2052|  19.6k|    pHeader = ph.get();
 2053|  19.6k|  }
 2054|       |
 2055|  24.0k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2055:12): [True: 23.1k, False: 850]
  ------------------
 2056|  23.1k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2057|  23.1k|    rootDir->accept(decoder);
 2058|  23.1k|  }
 2059|  24.0k|  return pHeader->byteOrder();
 2060|       |
 2061|  24.0k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2066|  5.65k|                                     OffsetWriter* pOffsetWriter) {
 2067|       |  /*
 2068|       |     1) parse the binary image, if one is provided, and
 2069|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2070|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2071|       |        writing"). If there is a parsed tree, it is only used to access the
 2072|       |        image data in this case.
 2073|       |   */
 2074|  5.65k|  WriteMethod writeMethod = wmIntrusive;
 2075|  5.65k|  auto parsedTree = parse(pData, size, root, pHeader);
 2076|  5.65k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2077|  5.65k|  if (parsedTree) {
  ------------------
  |  Branch (2077:7): [True: 0, False: 5.65k]
  ------------------
 2078|       |    // Attempt to update existing TIFF components based on metadata entries
 2079|      0|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2080|      0|    parsedTree->accept(encoder);
 2081|      0|    if (!encoder.dirty())
  ------------------
  |  Branch (2081:9): [True: 0, False: 0]
  ------------------
 2082|      0|      writeMethod = wmNonIntrusive;
 2083|      0|  }
 2084|  5.65k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2084:7): [True: 5.65k, False: 0]
  ------------------
 2085|  5.65k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2086|  5.65k|    if (parsedTree) {
  ------------------
  |  Branch (2086:9): [True: 0, False: 5.65k]
  ------------------
 2087|       |      // Copy image tags from the original image to the composite
 2088|      0|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2089|      0|      parsedTree->accept(copier);
 2090|      0|    }
 2091|       |    // Add entries from metadata to composite
 2092|  5.65k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2093|  5.65k|                        findEncoderFct);
 2094|  5.65k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2095|       |    // Write binary representation from the composite tree
 2096|  5.65k|    DataBuf header = pHeader->write();
 2097|  5.65k|    auto tempIo = MemIo();
 2098|  5.65k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2099|  5.65k|    auto imageIdx(std::string::npos);
 2100|  5.65k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2101|  5.65k|    if (pOffsetWriter)
  ------------------
  |  Branch (2101:9): [True: 0, False: 5.65k]
  ------------------
 2102|      0|      pOffsetWriter->writeOffsets(tempIo);
 2103|  5.65k|    io.transfer(tempIo);  // may throw
 2104|  5.65k|#ifndef SUPPRESS_WARNINGS
 2105|  5.65k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  5.65k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 5.65k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  5.65k|  LogMsg(LogMsg::info).os()
  ------------------
 2106|  5.65k|#endif
 2107|  5.65k|  }
 2108|      0|#ifndef SUPPRESS_WARNINGS
 2109|      0|  else {
 2110|      0|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|      0|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 0]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|      0|  LogMsg(LogMsg::info).os()
  ------------------
 2111|      0|  }
 2112|  5.65k|#endif
 2113|  5.65k|  return writeMethod;
 2114|  5.65k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2117|  29.6k|                                                 TiffHeaderBase* pHeader) {
 2118|  29.6k|  TiffComponent::UniquePtr rootDir;
 2119|  29.6k|  if (!pData || size == 0)
  ------------------
  |  Branch (2119:7): [True: 5.99k, False: 23.6k]
  |  Branch (2119:17): [True: 0, False: 23.6k]
  ------------------
 2120|  5.99k|    return rootDir;
 2121|  23.6k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2121:7): [True: 215, False: 23.4k]
  |  Branch (2121:38): [True: 270, False: 23.2k]
  ------------------
 2122|    485|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2123|    485|  }
 2124|  23.2k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2125|  23.2k|  if (rootDir) {
  ------------------
  |  Branch (2125:7): [True: 23.2k, False: 0]
  ------------------
 2126|  23.2k|    rootDir->setStart(pData + pHeader->offset());
 2127|  23.2k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2128|  23.2k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2129|  23.2k|    rootDir->accept(reader);
 2130|  23.2k|    reader.postProcess();
 2131|  23.2k|  }
 2132|  23.2k|  return rootDir;
 2133|       |
 2134|  23.6k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2136|  5.65k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2137|  5.65k|  PrimaryGroups ret;
 2138|  5.65k|  if (!pSourceDir)
  ------------------
  |  Branch (2138:7): [True: 5.65k, False: 0]
  ------------------
 2139|  5.65k|    return ret;
 2140|       |
 2141|      0|  static constexpr auto imageGroups = std::array{
 2142|      0|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2143|      0|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2144|      0|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2145|      0|  };
 2146|       |
 2147|      0|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2147:24): [True: 0, False: 0]
  ------------------
 2148|      0|    TiffFinder finder(0x00fe, imageGroup);
 2149|      0|    pSourceDir->accept(finder);
 2150|      0|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2151|      0|    if (!te)
  ------------------
  |  Branch (2151:9): [True: 0, False: 0]
  ------------------
 2152|      0|      continue;
 2153|      0|    const Value* pV = te->pValue();
 2154|      0|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2154:9): [True: 0, False: 0]
  |  Branch (2154:15): [True: 0, False: 0]
  |  Branch (2154:47): [True: 0, False: 0]
  |  Branch (2154:67): [True: 0, False: 0]
  ------------------
 2155|      0|      ret.push_back(te->group());
 2156|      0|    }
 2157|      0|  }
 2158|      0|  return ret;
 2159|  5.65k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2162|   453k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2163|   453k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2165|   360k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2166|   360k|  if (!pData || size < 8)
  ------------------
  |  Branch (2166:7): [True: 0, False: 360k]
  |  Branch (2166:17): [True: 39, False: 360k]
  ------------------
 2167|     39|    return false;
 2168|       |
 2169|   360k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2169:7): [True: 22.2k, False: 338k]
  |  Branch (2169:26): [True: 21.6k, False: 555]
  ------------------
 2170|  21.6k|    byteOrder_ = littleEndian;
 2171|   339k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2171:14): [True: 83.9k, False: 255k]
  |  Branch (2171:33): [True: 83.4k, False: 496]
  ------------------
 2172|  83.4k|    byteOrder_ = bigEndian;
 2173|   255k|  } else {
 2174|   255k|    return false;
 2175|   255k|  }
 2176|   105k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2177|   105k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2177:7): [True: 105k, False: 37]
  |  Branch (2177:19): [True: 104k, False: 124]
  |  Branch (2177:33): [True: 22.9k, False: 81.9k]
  ------------------
 2178|  22.9k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2179|  82.1k|  tag_ = t;
 2180|  82.1k|  offset_ = getULong(pData + 4, byteOrder_);
 2181|       |
 2182|  82.1k|  return true;
 2183|   105k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2185|  5.65k|DataBuf TiffHeaderBase::write() const {
 2186|  5.65k|  DataBuf buf(8);
 2187|  5.65k|  switch (byteOrder_) {
  ------------------
  |  Branch (2187:11): [True: 5.65k, False: 0]
  ------------------
 2188|  5.65k|    case littleEndian:
  ------------------
  |  Branch (2188:5): [True: 5.65k, False: 0]
  ------------------
 2189|  5.65k|      buf.write_uint8(0, 'I');
 2190|  5.65k|      break;
 2191|      0|    case bigEndian:
  ------------------
  |  Branch (2191:5): [True: 0, False: 5.65k]
  ------------------
 2192|      0|      buf.write_uint8(0, 'M');
 2193|      0|      break;
 2194|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2194:5): [True: 0, False: 5.65k]
  ------------------
 2195|      0|      break;
 2196|  5.65k|  }
 2197|  5.65k|  buf.write_uint8(1, buf.read_uint8(0));
 2198|  5.65k|  buf.write_uint16(2, tag_, byteOrder_);
 2199|  5.65k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2200|  5.65k|  return buf;
 2201|  5.65k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2219|  96.4k|ByteOrder TiffHeaderBase::byteOrder() const {
 2220|  96.4k|  return byteOrder_;
 2221|  96.4k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2223|  21.3k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2224|  21.3k|  byteOrder_ = byteOrder;
 2225|  21.3k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2227|  47.2k|uint32_t TiffHeaderBase::offset() const {
 2228|  47.2k|  return offset_;
 2229|  47.2k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2231|  16.0k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2232|  16.0k|  offset_ = offset;
 2233|  16.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2239|  22.0k|uint16_t TiffHeaderBase::tag() const {
 2240|  22.0k|  return tag_;
 2241|  22.0k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2325|   232k|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2326|   232k|  const bool result = isTiffImageTagLookup(tag, group);
 2327|       |#ifdef EXIV2_DEBUG_MESSAGES
 2328|       |  if (result) {
 2329|       |    ExifKey key(tag, groupName(group));
 2330|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2331|       |  } else {
 2332|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2333|       |  }
 2334|       |#endif
 2335|   232k|  return result;
 2336|   232k|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2339|   318k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2340|   318k|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2247|   232k|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2248|   232k|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2248:7): [True: 0, False: 232k]
  ------------------
 2249|      0|    return false;
 2250|      0|  }
 2251|       |  //! List of TIFF image tags
 2252|   232k|  switch (tag) {
 2253|      0|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2253:5): [True: 0, False: 232k]
  ------------------
 2254|      0|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2254:5): [True: 0, False: 232k]
  ------------------
 2255|  11.1k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2255:5): [True: 11.1k, False: 221k]
  ------------------
 2256|   100k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2256:5): [True: 89.4k, False: 143k]
  ------------------
 2257|   104k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2257:5): [True: 4.10k, False: 228k]
  ------------------
 2258|   104k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2258:5): [True: 243, False: 232k]
  ------------------
 2259|   105k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2259:5): [True: 301, False: 232k]
  ------------------
 2260|   105k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2260:5): [True: 136, False: 232k]
  ------------------
 2261|   116k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2261:5): [True: 11.4k, False: 221k]
  ------------------
 2262|   117k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2262:5): [True: 219, False: 232k]
  ------------------
 2263|   117k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2263:5): [True: 240, False: 232k]
  ------------------
 2264|   128k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2264:5): [True: 10.9k, False: 221k]
  ------------------
 2265|   128k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2265:5): [True: 163, False: 232k]
  ------------------
 2266|   128k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2266:5): [True: 101, False: 232k]
  ------------------
 2267|   128k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2267:5): [True: 241, False: 232k]
  ------------------
 2268|   128k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2268:5): [True: 169, False: 232k]
  ------------------
 2269|   129k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2269:5): [True: 152, False: 232k]
  ------------------
 2270|   129k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2270:5): [True: 110, False: 232k]
  ------------------
 2271|   129k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2271:5): [True: 109, False: 232k]
  ------------------
 2272|   129k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2272:5): [True: 594, False: 231k]
  ------------------
 2273|   130k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2273:5): [True: 338, False: 232k]
  ------------------
 2274|   130k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2274:5): [True: 174, False: 232k]
  ------------------
 2275|   130k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2275:5): [True: 290, False: 232k]
  ------------------
 2276|   130k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2276:5): [True: 87, False: 232k]
  ------------------
 2277|   131k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2277:5): [True: 859, False: 231k]
  ------------------
 2278|   131k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2278:5): [True: 190, False: 232k]
  ------------------
 2279|   132k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2279:5): [True: 171, False: 232k]
  ------------------
 2280|   132k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2280:5): [True: 77, False: 232k]
  ------------------
 2281|   132k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2281:5): [True: 84, False: 232k]
  ------------------
 2282|   133k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2282:5): [True: 1.50k, False: 230k]
  ------------------
 2283|   134k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2283:5): [True: 867, False: 231k]
  ------------------
 2284|   134k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2284:5): [True: 236, False: 232k]
  ------------------
 2285|   135k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2285:5): [True: 321, False: 232k]
  ------------------
 2286|   137k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2286:5): [True: 2.26k, False: 230k]
  ------------------
 2287|   137k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2287:5): [True: 81, False: 232k]
  ------------------
 2288|   137k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2288:5): [True: 126, False: 232k]
  ------------------
 2289|   137k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2289:5): [True: 114, False: 232k]
  ------------------
 2290|   137k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2290:5): [True: 216, False: 232k]
  ------------------
 2291|   138k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2291:5): [True: 220, False: 232k]
  ------------------
 2292|   138k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2292:5): [True: 229, False: 232k]
  ------------------
 2293|   138k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2293:5): [True: 76, False: 232k]
  ------------------
 2294|   138k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2294:5): [True: 236, False: 232k]
  ------------------
 2295|   138k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 237, False: 232k]
  ------------------
 2296|   138k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2296:5): [True: 87, False: 232k]
  ------------------
 2297|   139k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2297:5): [True: 73, False: 232k]
  ------------------
 2298|   139k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2298:5): [True: 156, False: 232k]
  ------------------
 2299|   142k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2299:5): [True: 2.82k, False: 229k]
  ------------------
 2300|   146k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2300:5): [True: 4.66k, False: 227k]
  ------------------
 2301|   160k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2301:5): [True: 13.9k, False: 218k]
  ------------------
 2302|   161k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2302:5): [True: 485, False: 231k]
  ------------------
 2303|   161k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2303:5): [True: 294, False: 232k]
  ------------------
 2304|   161k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2304:5): [True: 336, False: 232k]
  ------------------
 2305|   161k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2305:5): [True: 213, False: 232k]
  ------------------
 2306|   162k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2306:5): [True: 237, False: 232k]
  ------------------
 2307|   162k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2307:5): [True: 88, False: 232k]
  ------------------
 2308|   162k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2308:5): [True: 269, False: 232k]
  ------------------
 2309|   162k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2309:5): [True: 195, False: 232k]
  ------------------
 2310|   163k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2310:5): [True: 416, False: 232k]
  ------------------
 2311|   163k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2311:5): [True: 471, False: 232k]
  ------------------
 2312|   163k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2312:5): [True: 68, False: 232k]
  ------------------
 2313|   163k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2313:5): [True: 46, False: 232k]
  ------------------
 2314|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2315|   163k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2315:5): [True: 72, False: 232k]
  ------------------
 2316|   163k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2316:5): [True: 71, False: 232k]
  ------------------
 2317|   163k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2317:5): [True: 77, False: 232k]
  ------------------
 2318|   164k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2318:5): [True: 77, False: 232k]
  ------------------
 2319|   164k|      return true;
 2320|  68.4k|    default:
  ------------------
  |  Branch (2320:5): [True: 68.4k, False: 164k]
  ------------------
 2321|  68.4k|      return false;
 2322|   232k|  }
 2323|   232k|}

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

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

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

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

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   20|  3.53M|Value::Value(TypeId typeId) : type_(typeId) {
   21|  3.53M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   23|  1.73M|Value::UniquePtr Value::create(TypeId typeId) {
   24|  1.73M|  switch (typeId) {
   25|      0|    case invalidTypeId:
  ------------------
  |  Branch (25:5): [True: 0, False: 1.73M]
  ------------------
   26|  3.47k|    case signedByte:
  ------------------
  |  Branch (26:5): [True: 3.47k, False: 1.72M]
  ------------------
   27|   239k|    case unsignedByte:
  ------------------
  |  Branch (27:5): [True: 236k, False: 1.49M]
  ------------------
   28|   239k|      return std::make_unique<DataValue>(typeId);
   29|  17.4k|    case asciiString:
  ------------------
  |  Branch (29:5): [True: 17.4k, False: 1.71M]
  ------------------
   30|  17.4k|      return std::make_unique<AsciiValue>();
   31|   556k|    case unsignedShort:
  ------------------
  |  Branch (31:5): [True: 556k, False: 1.17M]
  ------------------
   32|   556k|      return std::make_unique<ValueType<uint16_t>>();
   33|   180k|    case unsignedLong:
  ------------------
  |  Branch (33:5): [True: 180k, False: 1.54M]
  ------------------
   34|   184k|    case tiffIfd:
  ------------------
  |  Branch (34:5): [True: 3.58k, False: 1.72M]
  ------------------
   35|   184k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   36|  8.98k|    case unsignedRational:
  ------------------
  |  Branch (36:5): [True: 8.98k, False: 1.72M]
  ------------------
   37|  8.98k|      return std::make_unique<ValueType<URational>>();
   38|  6.83k|    case undefined:
  ------------------
  |  Branch (38:5): [True: 6.83k, False: 1.72M]
  ------------------
   39|  6.83k|      return std::make_unique<DataValue>();
   40|  17.4k|    case signedShort:
  ------------------
  |  Branch (40:5): [True: 17.4k, False: 1.71M]
  ------------------
   41|  17.4k|      return std::make_unique<ValueType<int16_t>>();
   42|  7.58k|    case signedLong:
  ------------------
  |  Branch (42:5): [True: 7.58k, False: 1.72M]
  ------------------
   43|  7.58k|      return std::make_unique<ValueType<int32_t>>();
   44|  3.64k|    case signedRational:
  ------------------
  |  Branch (44:5): [True: 3.64k, False: 1.72M]
  ------------------
   45|  3.64k|      return std::make_unique<ValueType<Rational>>();
   46|  3.61k|    case tiffFloat:
  ------------------
  |  Branch (46:5): [True: 3.61k, False: 1.72M]
  ------------------
   47|  3.61k|      return std::make_unique<ValueType<float>>();
   48|  5.91k|    case tiffDouble:
  ------------------
  |  Branch (48:5): [True: 5.91k, False: 1.72M]
  ------------------
   49|  5.91k|      return std::make_unique<ValueType<double>>();
   50|  37.0k|    case string:
  ------------------
  |  Branch (50:5): [True: 37.0k, False: 1.69M]
  ------------------
   51|  37.0k|      return std::make_unique<StringValue>();
   52|  9.87k|    case date:
  ------------------
  |  Branch (52:5): [True: 9.87k, False: 1.72M]
  ------------------
   53|  9.87k|      return std::make_unique<DateValue>();
   54|  18.2k|    case time:
  ------------------
  |  Branch (54:5): [True: 18.2k, False: 1.71M]
  ------------------
   55|  18.2k|      return std::make_unique<TimeValue>();
   56|    820|    case comment:
  ------------------
  |  Branch (56:5): [True: 820, False: 1.72M]
  ------------------
   57|    820|      return std::make_unique<CommentValue>();
   58|  57.8k|    case xmpText:
  ------------------
  |  Branch (58:5): [True: 57.8k, False: 1.67M]
  ------------------
   59|  57.8k|      return std::make_unique<XmpTextValue>();
   60|      0|    case xmpBag:
  ------------------
  |  Branch (60:5): [True: 0, False: 1.73M]
  ------------------
   61|  11.1k|    case xmpSeq:
  ------------------
  |  Branch (61:5): [True: 11.1k, False: 1.71M]
  ------------------
   62|  11.1k|    case xmpAlt:
  ------------------
  |  Branch (62:5): [True: 0, False: 1.73M]
  ------------------
   63|  11.1k|      return std::make_unique<XmpArrayValue>(typeId);
   64|      0|    case langAlt:
  ------------------
  |  Branch (64:5): [True: 0, False: 1.73M]
  ------------------
   65|      0|      return std::make_unique<LangAltValue>();
   66|   543k|    default:
  ------------------
  |  Branch (66:5): [True: 543k, False: 1.18M]
  ------------------
   67|   543k|      return std::make_unique<DataValue>(typeId);
   68|  1.73M|  }
   69|  1.73M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   71|  2.95k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   72|  2.95k|  return -1;
   73|  2.95k|}
_ZNK5Exiv25Value8toStringEv:
   75|  33.6k|std::string Value::toString() const {
   76|  33.6k|  std::ostringstream os;
   77|  33.6k|  write(os);
   78|  33.6k|  ok_ = !os.fail();
   79|  33.6k|  return os.str();
   80|  33.6k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   86|  18.6k|size_t Value::sizeDataArea() const {
   87|  18.6k|  return 0;
   88|  18.6k|}
_ZNK5Exiv25Value8dataAreaEv:
   90|    245|DataBuf Value::dataArea() const {
   91|    245|  return {nullptr, 0};
   92|    245|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   94|   790k|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   95|   790k|}
_ZNK5Exiv29DataValue5countEv:
  101|  1.24M|size_t DataValue::count() const {
  102|  1.24M|  return size();
  103|  1.24M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  105|   790k|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  106|       |  // byteOrder not needed
  107|   790k|  value_.assign(buf, buf + len);
  108|   790k|  return 0;
  109|   790k|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  123|   144k|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  124|       |  // byteOrder not needed
  125|   144k|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  126|   144k|}
_ZNK5Exiv29DataValue4sizeEv:
  128|  1.64M|size_t DataValue::size() const {
  129|  1.64M|  return value_.size();
  130|  1.64M|}
_ZNK5Exiv29DataValue6clone_Ev:
  132|  2.10M|DataValue* DataValue::clone_() const {
  133|  2.10M|  return new DataValue(*this);
  134|  2.10M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  136|  2.84k|std::ostream& DataValue::write(std::ostream& os) const {
  137|  2.84k|  if (!value_.empty()) {
  ------------------
  |  Branch (137:7): [True: 2.52k, False: 323]
  ------------------
  138|  2.52k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  139|  2.52k|    os << static_cast<int>(value_.back());
  140|  2.52k|  }
  141|  2.84k|  return os;
  142|  2.84k|}
_ZNK5Exiv29DataValue7toInt64Em:
  149|  64.1k|int64_t DataValue::toInt64(size_t n) const {
  150|  64.1k|  ok_ = true;
  151|  64.1k|  return value_.at(n);
  152|  64.1k|}
_ZNK5Exiv29DataValue8toUint32Em:
  154|   252k|uint32_t DataValue::toUint32(size_t n) const {
  155|   252k|  ok_ = true;
  156|   252k|  return value_.at(n);
  157|   252k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  173|  4.67k|int StringValueBase::read(const std::string& buf) {
  174|  4.67k|  value_ = buf;
  175|  4.67k|  return 0;
  176|  4.67k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  178|  48.5k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  179|       |  // byteOrder not needed
  180|  48.5k|  if (buf)
  ------------------
  |  Branch (180:7): [True: 48.5k, False: 0]
  ------------------
  181|  48.5k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  182|  48.5k|  return 0;
  183|  48.5k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  185|  2.54k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  186|  2.54k|  if (value_.empty())
  ------------------
  |  Branch (186:7): [True: 1.14k, False: 1.39k]
  ------------------
  187|  1.14k|    return 0;
  188|       |  // byteOrder not needed
  189|  1.39k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  190|  2.54k|}
_ZNK5Exiv215StringValueBase5countEv:
  192|  30.5k|size_t StringValueBase::count() const {
  193|  30.5k|  return size();
  194|  30.5k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  196|  36.7k|size_t StringValueBase::size() const {
  197|  36.7k|  return value_.size();
  198|  36.7k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  204|  1.70k|int64_t StringValueBase::toInt64(size_t n) const {
  205|  1.70k|  ok_ = true;
  206|  1.70k|  return static_cast<signed char>(value_.at(n));
  207|  1.70k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  209|  11.2k|uint32_t StringValueBase::toUint32(size_t n) const {
  210|  11.2k|  ok_ = true;
  211|  11.2k|  return static_cast<unsigned char>(value_.at(n));
  212|  11.2k|}
_ZN5Exiv211StringValueC2Ev:
  224|  37.0k|StringValue::StringValue() : StringValueBase(string) {
  225|  37.0k|}
_ZNK5Exiv211StringValue6clone_Ev:
  230|  61.6k|StringValue* StringValue::clone_() const {
  231|  61.6k|  return new StringValue(*this);
  232|  61.6k|}
_ZN5Exiv210AsciiValueC2Ev:
  234|  17.4k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  235|  17.4k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  240|  4.07k|int AsciiValue::read(const std::string& buf) {
  241|  4.07k|  value_ = buf;
  242|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  243|  4.07k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (243:7): [True: 58, False: 4.02k]
  |  Branch (243:25): [True: 4.02k, False: 0]
  ------------------
  244|  4.07k|    value_ += '\0';
  245|  4.07k|  }
  246|  4.07k|  return 0;
  247|  4.07k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  249|  38.4k|AsciiValue* AsciiValue::clone_() const {
  250|  38.4k|  return new AsciiValue(*this);
  251|  38.4k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  253|  10.8k|std::ostream& AsciiValue::write(std::ostream& os) const {
  254|       |  // Write only up to the first '\0' (if any)
  255|  10.8k|  std::string::size_type pos = value_.find_first_of('\0');
  256|  10.8k|  if (pos == std::string::npos)
  ------------------
  |  Branch (256:7): [True: 2.50k, False: 8.31k]
  ------------------
  257|  2.50k|    pos = value_.size();
  258|  10.8k|  return os << value_.substr(0, pos);
  259|  10.8k|}
_ZN5Exiv212CommentValueC2Ev:
  293|    820|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  294|    820|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  330|    820|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  331|    820|  byteOrder_ = byteOrder;
  332|    820|  return StringValueBase::read(buf, len, byteOrder);
  333|    820|}
_ZNK5Exiv212CommentValue6clone_Ev:
  411|  1.64k|CommentValue* CommentValue::clone_() const {
  412|  1.64k|  return new CommentValue(*this);
  413|  1.64k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  415|  35.2k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  416|  35.2k|  xmpArrayType_ = xmpArrayType;
  417|  35.2k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  419|  21.3k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  420|  21.3k|  xmpStruct_ = xmpStruct;
  421|  21.3k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  423|  9.33k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  424|  9.33k|  return xmpArrayType_;
  425|  9.33k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  427|  34.7k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  428|  34.7k|  XmpArrayType xa = xaNone;
  429|  34.7k|  switch (typeId) {
  430|  2.51k|    case xmpAlt:
  ------------------
  |  Branch (430:5): [True: 2.51k, False: 32.2k]
  ------------------
  431|  2.51k|      xa = xaAlt;
  432|  2.51k|      break;
  433|    710|    case xmpBag:
  ------------------
  |  Branch (433:5): [True: 710, False: 34.0k]
  ------------------
  434|    710|      xa = xaBag;
  435|    710|      break;
  436|  14.2k|    case xmpSeq:
  ------------------
  |  Branch (436:5): [True: 14.2k, False: 20.5k]
  ------------------
  437|  14.2k|      xa = xaSeq;
  438|  14.2k|      break;
  439|  17.3k|    default:
  ------------------
  |  Branch (439:5): [True: 17.3k, False: 17.4k]
  ------------------
  440|  17.3k|      break;
  441|  34.7k|  }
  442|  34.7k|  return xa;
  443|  34.7k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  445|  9.06k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  446|  9.06k|  return xmpStruct_;
  447|  9.06k|}
_ZN5Exiv212XmpTextValueC2Ev:
  469|   168k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  470|   168k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  476|   872k|int XmpTextValue::read(const std::string& buf) {
  477|       |  // support a type=Alt,Bag,Seq,Struct indicator
  478|   872k|  std::string b = buf;
  479|   872k|  std::string type;
  480|   872k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (480:7): [True: 2.98k, False: 869k]
  ------------------
  481|  2.98k|    std::string::size_type pos = buf.find_first_of(' ');
  482|  2.98k|    type = buf.substr(5, pos - 5);
  483|       |    // Strip quotes (so you can also specify the type without quotes)
  484|  2.98k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (484:9): [True: 2.89k, False: 96]
  |  Branch (484:26): [True: 2.16k, False: 727]
  ------------------
  485|  2.16k|      type = type.substr(1);
  486|  2.98k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (486:9): [True: 2.84k, False: 144]
  |  Branch (486:26): [True: 129, False: 2.71k]
  ------------------
  487|    129|      type.pop_back();
  488|  2.98k|    b.clear();
  489|  2.98k|    if (pos != std::string::npos)
  ------------------
  |  Branch (489:9): [True: 1.83k, False: 1.15k]
  ------------------
  490|  1.83k|      b = buf.substr(pos + 1);
  491|  2.98k|  }
  492|   872k|  if (!type.empty()) {
  ------------------
  |  Branch (492:7): [True: 2.84k, False: 869k]
  ------------------
  493|  2.84k|    if (type == "Alt") {
  ------------------
  |  Branch (493:9): [True: 86, False: 2.75k]
  ------------------
  494|     86|      setXmpArrayType(XmpValue::xaAlt);
  495|  2.75k|    } else if (type == "Bag") {
  ------------------
  |  Branch (495:16): [True: 89, False: 2.67k]
  ------------------
  496|     89|      setXmpArrayType(XmpValue::xaBag);
  497|  2.67k|    } else if (type == "Seq") {
  ------------------
  |  Branch (497:16): [True: 329, False: 2.34k]
  ------------------
  498|    329|      setXmpArrayType(XmpValue::xaSeq);
  499|  2.34k|    } else if (type == "Struct") {
  ------------------
  |  Branch (499:16): [True: 1.55k, False: 787]
  ------------------
  500|  1.55k|      setXmpStruct();
  501|  1.55k|    } else {
  502|    787|      throw Error(ErrorCode::kerInvalidXmpText, type);
  503|    787|    }
  504|  2.84k|  }
  505|   871k|  value_ = std::move(b);
  506|   871k|  return 0;
  507|   872k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  523|  9.20k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  524|  9.20k|  bool del = false;
  525|  9.20k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (525:7): [True: 138, False: 9.06k]
  ------------------
  526|    138|    switch (xmpArrayType()) {
  ------------------
  |  Branch (526:13): [True: 138, False: 0]
  ------------------
  527|    118|      case XmpValue::xaAlt:
  ------------------
  |  Branch (527:7): [True: 118, False: 20]
  ------------------
  528|    118|        os << "type=\"Alt\"";
  529|    118|        break;
  530|      0|      case XmpValue::xaBag:
  ------------------
  |  Branch (530:7): [True: 0, False: 138]
  ------------------
  531|      0|        os << "type=\"Bag\"";
  532|      0|        break;
  533|     20|      case XmpValue::xaSeq:
  ------------------
  |  Branch (533:7): [True: 20, False: 118]
  ------------------
  534|     20|        os << "type=\"Seq\"";
  535|     20|        break;
  536|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (536:7): [True: 0, False: 138]
  ------------------
  537|      0|        break;  // just to suppress the warning
  538|    138|    }
  539|    138|    del = true;
  540|  9.06k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (540:14): [True: 6, False: 9.05k]
  ------------------
  541|      6|    switch (xmpStruct()) {
  ------------------
  |  Branch (541:13): [True: 6, False: 0]
  ------------------
  542|      6|      case XmpValue::xsStruct:
  ------------------
  |  Branch (542:7): [True: 6, False: 0]
  ------------------
  543|      6|        os << "type=\"Struct\"";
  544|      6|        break;
  545|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (545:7): [True: 0, False: 6]
  ------------------
  546|      0|        break;  // just to suppress the warning
  547|      6|    }
  548|      6|    del = true;
  549|      6|  }
  550|  9.20k|  if (del && !value_.empty())
  ------------------
  |  Branch (550:7): [True: 144, False: 9.05k]
  |  Branch (550:14): [True: 12, False: 132]
  ------------------
  551|     12|    os << " ";
  552|  9.20k|  return os << value_;
  553|  9.20k|}
_ZNK5Exiv212XmpTextValue7toInt64Em:
  555|    197|int64_t XmpTextValue::toInt64(size_t /*n*/) const {
  556|    197|  return parseInt64(value_, ok_);
  557|    197|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  571|   299k|XmpTextValue* XmpTextValue::clone_() const {
  572|   299k|  return new XmpTextValue(*this);
  573|   299k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  575|  14.9k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  576|  14.9k|  setXmpArrayType(xmpArrayType(typeId));
  577|  14.9k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  65.5k|int XmpArrayValue::read(const std::string& buf) {
  580|  65.5k|  if (!buf.empty())
  ------------------
  |  Branch (580:7): [True: 49.7k, False: 15.7k]
  ------------------
  581|  49.7k|    value_.push_back(buf);
  582|  65.5k|  return 0;
  583|  65.5k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  589|    221|size_t XmpArrayValue::count() const {
  590|    221|  return value_.size();
  591|    221|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  593|    196|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  594|    196|  if (!value_.empty()) {
  ------------------
  |  Branch (594:7): [True: 189, False: 7]
  ------------------
  595|    189|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  596|    189|    os << value_.back();
  597|    189|  }
  598|    196|  return os;
  599|    196|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  601|  3.42k|std::string XmpArrayValue::toString(size_t n) const {
  602|  3.42k|  ok_ = true;
  603|  3.42k|  return value_.at(n);
  604|  3.42k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  622|  29.4k|XmpArrayValue* XmpArrayValue::clone_() const {
  623|  29.4k|  return new XmpArrayValue(*this);
  624|  29.4k|}
_ZN5Exiv212LangAltValueC2Ev:
  626|  1.90k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  627|  1.90k|}
_ZNK5Exiv212LangAltValue5countEv:
  680|    275|size_t LangAltValue::count() const {
  681|    275|  return value_.size();
  682|    275|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  684|    113|std::ostream& LangAltValue::write(std::ostream& os) const {
  685|    113|  bool first = true;
  686|       |
  687|       |  // Write the default entry first
  688|    113|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (688:42): [True: 0, False: 113]
  ------------------
  689|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  690|      0|    first = false;
  691|      0|  }
  692|       |
  693|       |  // Write the others
  694|    113|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (694:30): [True: 113, False: 113]
  ------------------
  695|    113|    if (lang != "x-default") {
  ------------------
  |  Branch (695:9): [True: 113, False: 0]
  ------------------
  696|    113|      if (!first)
  ------------------
  |  Branch (696:11): [True: 0, False: 113]
  ------------------
  697|      0|        os << ", ";
  698|    113|      os << "lang=\"" << lang << "\" " << s;
  699|    113|      first = false;
  700|    113|    }
  701|    113|  }
  702|    113|  return os;
  703|    113|}
_ZNK5Exiv212LangAltValue8toStringEm:
  705|    396|std::string LangAltValue::toString(size_t /*n*/) const {
  706|    396|  return toString("x-default");
  707|    396|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  709|    396|std::string LangAltValue::toString(const std::string& qualifier) const {
  710|    396|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (710:40): [True: 121, False: 275]
  ------------------
  711|    121|    ok_ = true;
  712|    121|    return i->second;
  713|    121|  }
  714|    275|  ok_ = false;
  715|    275|  return "";
  716|    396|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  738|  2.47k|LangAltValue* LangAltValue::clone_() const {
  739|  2.47k|  return new LangAltValue(*this);
  740|  2.47k|}
_ZN5Exiv29DateValueC2Ev:
  742|  9.87k|DateValue::DateValue() : Value(date) {
  743|  9.87k|  date_ = {};
  744|  9.87k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  750|  9.75k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  751|  9.75k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  752|  9.75k|  return read(str);
  753|  9.75k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  755|  9.87k|int DateValue::read(const std::string& buf) {
  756|       |  // ISO 8601 date formats:
  757|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  758|  9.87k|  size_t monthPos = 0;
  759|  9.87k|  size_t dayPos = 0;
  760|       |
  761|  9.87k|  auto printWarning = [] {
  762|  9.87k|#ifndef SUPPRESS_WARNINGS
  763|  9.87k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  764|  9.87k|#endif
  765|  9.87k|  };
  766|       |
  767|  9.87k|  if (buf.size() < 8) {
  ------------------
  |  Branch (767:7): [True: 581, False: 9.29k]
  ------------------
  768|    581|    printWarning();
  769|    581|    return 1;
  770|    581|  }
  771|       |
  772|  9.29k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (772:8): [True: 3.24k, False: 6.04k]
  |  Branch (772:28): [True: 2.40k, False: 844]
  |  Branch (772:45): [True: 1.05k, False: 1.35k]
  |  Branch (772:63): [True: 6.03k, False: 2.20k]
  ------------------
  773|  7.08k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (773:9): [True: 1.05k, False: 6.03k]
  ------------------
  774|  1.05k|      monthPos = 5;
  775|  1.05k|      dayPos = 8;
  776|  6.03k|    } else {
  777|  6.03k|      monthPos = 4;
  778|  6.03k|      dayPos = 6;
  779|  6.03k|    }
  780|       |
  781|  7.08k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  7.08k|      for (size_t i = start; i < start + count; ++i) {
  783|  7.08k|        if (!std::isdigit(buf[i])) {
  784|  7.08k|          printWarning();
  785|  7.08k|          return 1;
  786|  7.08k|        }
  787|  7.08k|      }
  788|  7.08k|      dest = std::stoul(buf.substr(start, count));
  789|  7.08k|      return 0;
  790|  7.08k|    };
  791|       |
  792|  7.08k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (792:9): [True: 2.12k, False: 4.95k]
  |  Branch (792:42): [True: 1.16k, False: 3.79k]
  |  Branch (792:83): [True: 1.42k, False: 2.37k]
  ------------------
  793|  4.71k|      printWarning();
  794|  4.71k|      return 1;
  795|  4.71k|    }
  796|       |
  797|  2.37k|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (797:9): [True: 461, False: 1.91k]
  |  Branch (797:29): [True: 1.31k, False: 591]
  ------------------
  798|  1.78k|      date_.month = 0;
  799|  1.78k|      date_.day = 0;
  800|  1.78k|      printWarning();
  801|  1.78k|      return 1;
  802|  1.78k|    }
  803|    591|    return 0;
  804|  2.37k|  }
  805|  2.20k|  printWarning();
  806|  2.20k|  return 1;
  807|  9.29k|}
_ZNK5Exiv29DateValue6clone_Ev:
  835|    764|DateValue* DateValue::clone_() const {
  836|    764|  return new DateValue(*this);
  837|    764|}
_ZN5Exiv29TimeValueC2Ev:
  878|  18.2k|TimeValue::TimeValue() : Value(time) {
  879|  18.2k|  time_ = {};
  880|  18.2k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  886|  18.2k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  887|  18.2k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  888|  18.2k|  return read(str);
  889|  18.2k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  891|  18.2k|int TimeValue::read(const std::string& buf) {
  892|       |  // ISO 8601 time formats:
  893|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  894|       |  // Not supported formats:
  895|       |  // 4.2.2.4 Representations with decimal fraction: 232050,5
  896|  18.2k|  auto printWarning = [] {
  897|  18.2k|#ifndef SUPPRESS_WARNINGS
  898|  18.2k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  899|  18.2k|#endif
  900|  18.2k|    return 1;
  901|  18.2k|  };
  902|       |
  903|  18.2k|  if (buf.size() < 2)
  ------------------
  |  Branch (903:7): [True: 945, False: 17.3k]
  ------------------
  904|    945|    return printWarning();
  905|       |
  906|  17.3k|  for (auto c : buf)
  ------------------
  |  Branch (906:15): [True: 234k, False: 11.0k]
  ------------------
  907|   234k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (907:9): [True: 228k, False: 5.75k]
  |  Branch (907:21): [True: 224k, False: 4.89k]
  |  Branch (907:33): [True: 204k, False: 19.6k]
  |  Branch (907:45): [True: 203k, False: 483]
  |  Branch (907:57): [True: 6.25k, False: 197k]
  ------------------
  908|  6.25k|      return printWarning();
  909|       |
  910|  11.0k|  size_t mpos;
  911|  11.0k|  size_t spos;
  912|  11.0k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (912:7): [True: 4.81k, False: 6.23k]
  ------------------
  913|  4.81k|    mpos = 3;
  914|  4.81k|    spos = 6;
  915|  6.23k|  } else {
  916|  6.23k|    mpos = 2;
  917|  6.23k|    spos = 4;
  918|  6.23k|  }
  919|       |
  920|  11.0k|  try {
  921|  11.0k|    auto hi = std::stoi(buf.substr(0, 2));
  922|  11.0k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (922:9): [True: 486, False: 10.5k]
  |  Branch (922:19): [True: 155, False: 10.4k]
  ------------------
  923|    517|      return printWarning();
  924|  10.5k|    time_.hour = hi;
  925|  10.5k|    if (buf.size() > 3) {
  ------------------
  |  Branch (925:9): [True: 10.1k, False: 344]
  ------------------
  926|  10.1k|      auto mi = std::stoi(buf.substr(mpos, 2));
  927|  10.1k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (927:11): [True: 334, False: 9.85k]
  |  Branch (927:21): [True: 144, False: 9.71k]
  ------------------
  928|    416|        return printWarning();
  929|  9.77k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  930|  9.77k|    } else {
  931|    344|      time_.minute = 0;
  932|    344|    }
  933|  10.1k|    if (buf.size() > 5) {
  ------------------
  |  Branch (933:9): [True: 7.61k, False: 2.49k]
  ------------------
  934|  7.61k|      auto si = std::stoi(buf.substr(spos, 2));
  935|  7.61k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (935:11): [True: 308, False: 7.31k]
  |  Branch (935:21): [True: 320, False: 6.99k]
  ------------------
  936|    448|        return printWarning();
  937|  7.17k|      time_.second = std::stoi(buf.substr(spos, 2));
  938|  7.17k|    } else {
  939|  2.49k|      time_.second = 0;
  940|  2.49k|    }
  941|       |
  942|  9.67k|    auto fpos = buf.find('+');
  943|  9.67k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (943:9): [True: 6.52k, False: 3.14k]
  ------------------
  944|  6.52k|      fpos = buf.find('-');
  945|       |
  946|  9.67k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (946:9): [True: 8.07k, False: 1.59k]
  ------------------
  947|  8.07k|      auto format = buf.substr(fpos, buf.size());
  948|       |      // Use the sign of the raw offset string rather than of the parsed
  949|       |      // tzHour: when the hour magnitude is 0 (e.g. "-00:30"), std::stoi
  950|       |      // returns 0, which loses the '-' sign that std::stoi("-00") cannot
  951|       |      // preserve. format always starts with '+' or '-' (see fpos above).
  952|  8.07k|      const bool negative = format.at(0) == '-';
  953|  8.07k|      auto posColon = format.find(':');
  954|  8.07k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (954:11): [True: 4.55k, False: 3.52k]
  ------------------
  955|       |        // Extended format
  956|  4.55k|        auto tzhi = std::stoi(format.substr(0, 3));
  957|  4.55k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (957:13): [True: 241, False: 4.31k]
  |  Branch (957:27): [True: 584, False: 3.72k]
  ------------------
  958|    690|          return printWarning();
  959|  3.86k|        time_.tzHour = tzhi;
  960|  3.86k|        if (format.size() > 3) {
  ------------------
  |  Branch (960:13): [True: 2.80k, False: 1.05k]
  ------------------
  961|  2.80k|          int minute = std::stoi(format.substr(3));
  962|  2.80k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (962:15): [True: 1.98k, False: 820]
  |  Branch (962:29): [True: 161, False: 659]
  ------------------
  963|    640|            return printWarning();
  964|  2.16k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (964:28): [True: 489, False: 1.67k]
  ------------------
  965|  2.16k|        }
  966|  3.86k|      } else {
  967|       |        // Basic format
  968|  3.52k|        auto tzhi = std::stoi(format.substr(0, posColon));
  969|  3.52k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (969:13): [True: 1.05k, False: 2.47k]
  |  Branch (969:27): [True: 184, False: 2.28k]
  ------------------
  970|    813|          return printWarning();
  971|  2.71k|        time_.tzHour = tzhi;
  972|  2.71k|        int minute = std::stoi(format.substr(posColon + 1));
  973|  2.71k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (973:13): [True: 1.34k, False: 1.36k]
  |  Branch (973:27): [True: 481, False: 886]
  ------------------
  974|    896|          return printWarning();
  975|  1.81k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (975:26): [True: 718, False: 1.09k]
  ------------------
  976|  1.81k|      }
  977|  8.07k|    }
  978|  9.67k|  } catch (std::exception&) {
  979|       |    // std::stoi might throw an exception if the syntax is invalid.
  980|  2.93k|    return printWarning();
  981|  2.93k|  }
  982|  3.69k|  return 0;
  983|  11.0k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1018|  4.70k|TimeValue* TimeValue::clone_() const {
 1019|  4.70k|  return new TimeValue(*this);
 1020|  4.70k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  761|  13.9k|  auto printWarning = [] {
  762|  13.9k|#ifndef SUPPRESS_WARNINGS
  763|  13.9k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  13.9k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13.9k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  13.9k|  LogMsg(LogMsg::warn).os()
  ------------------
  764|  13.9k|#endif
  765|  13.9k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  781|  15.8k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  50.6k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (782:30): [True: 39.5k, False: 11.1k]
  ------------------
  783|  39.5k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (783:13): [True: 4.71k, False: 34.8k]
  ------------------
  784|  4.71k|          printWarning();
  785|  4.71k|          return 1;
  786|  4.71k|        }
  787|  39.5k|      }
  788|  11.1k|      dest = std::stoul(buf.substr(start, count));
  789|  11.1k|      return 0;
  790|  15.8k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  896|  14.5k|  auto printWarning = [] {
  897|  14.5k|#ifndef SUPPRESS_WARNINGS
  898|  14.5k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  14.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 14.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  14.5k|  LogMsg(LogMsg::warn).os()
  ------------------
  899|  14.5k|#endif
  900|  14.5k|    return 1;
  901|  14.5k|  };

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  263|   184k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  264|   184k|  if (pValue)
  ------------------
  |  Branch (264:7): [True: 126k, False: 57.8k]
  ------------------
  265|   126k|    value_ = pValue->clone();
  266|   184k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  268|   204k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  269|   204k|  if (rhs.key_)
  ------------------
  |  Branch (269:7): [True: 204k, False: 0]
  ------------------
  270|   204k|    key_ = rhs.key_->clone();  // deep copy
  271|   204k|  if (rhs.value_)
  ------------------
  |  Branch (271:7): [True: 204k, False: 0]
  ------------------
  272|   204k|    value_ = rhs.value_->clone();  // deep copy
  273|   204k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  287|   184k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  288|   184k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  290|   204k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  291|   204k|}
_ZN5Exiv28XmpdatumD2Ev:
  300|   388k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  302|  14.6M|std::string Xmpdatum::key() const {
  303|  14.6M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (303:10): [True: 14.6M, False: 0]
  ------------------
  304|  14.6M|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  330|  2.75k|TypeId Xmpdatum::typeId() const {
  331|  2.75k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (331:10): [True: 2.75k, False: 0]
  ------------------
  332|  2.75k|}
_ZNK5Exiv28Xmpdatum5countEv:
  342|    496|size_t Xmpdatum::count() const {
  343|    496|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (343:10): [True: 496, False: 0]
  ------------------
  344|    496|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  350|  2.75k|std::string Xmpdatum::toString() const {
  351|  2.75k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (351:10): [True: 2.75k, False: 0]
  ------------------
  352|  2.75k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  354|  3.82k|std::string Xmpdatum::toString(size_t n) const {
  355|  3.82k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (355:10): [True: 3.82k, False: 0]
  ------------------
  356|  3.82k|}
_ZNK5Exiv28Xmpdatum7toInt64Em:
  358|    197|int64_t Xmpdatum::toInt64(size_t n) const {
  359|    197|  return p_->value_ ? p_->value_->toInt64(n) : -1;
  ------------------
  |  Branch (359:10): [True: 197, False: 0]
  ------------------
  360|    197|}
_ZNK5Exiv28Xmpdatum5valueEv:
  374|  12.4k|const Value& Xmpdatum::value() const {
  375|  12.4k|  if (!p_->value_)
  ------------------
  |  Branch (375:7): [True: 0, False: 12.4k]
  ------------------
  376|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  377|  12.4k|  return *p_->value_;
  378|  12.4k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   782k|int Xmpdatum::setValue(const std::string& value) {
  395|   782k|  XmpProperties::XmpLock lock;
  396|   782k|  if (!p_->value_) {
  ------------------
  |  Branch (396:7): [True: 57.8k, False: 724k]
  ------------------
  397|  57.8k|    TypeId type = xmpText;
  398|  57.8k|    if (p_->key_) {
  ------------------
  |  Branch (398:9): [True: 57.8k, False: 0]
  ------------------
  399|  57.8k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  400|  57.8k|    }
  401|  57.8k|    p_->value_ = Value::create(type);
  402|  57.8k|  }
  403|   782k|  return p_->value_->read(value);
  404|   782k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  406|   783k|Xmpdatum& XmpData::operator[](const std::string& key) {
  407|   783k|  XmpProperties::XmpLock lock;
  408|   783k|  XmpKey xmpKey(key, lock);
  409|   783k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  410|   783k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (410:7): [True: 57.8k, False: 725k]
  ------------------
  411|  57.8k|    return xmpMetadata_.emplace_back(xmpKey);
  412|  57.8k|  }
  413|   725k|  return *pos;
  414|   783k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  416|  11.1k|int XmpData::add(const XmpKey& key, const Value* value) {
  417|  11.1k|  XmpProperties::XmpLock lock;
  418|  11.1k|  return addUnlocked(key, value, lock);
  419|  11.1k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  421|   126k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  422|   126k|  xmpMetadata_.emplace_back(key, value);
  423|   126k|  return 0;
  424|   126k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  436|  54.8k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  437|  54.8k|  XmpProperties::XmpLock lock;
  438|  54.8k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  439|  54.8k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  441|   445k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  442|   445k|  XmpProperties::XmpLock lock;
  443|   445k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  444|   445k|}
_ZN5Exiv27XmpData5clearEv:
  446|  57.6k|void XmpData::clear() {
  447|  57.6k|  XmpProperties::XmpLock lock;
  448|  57.6k|  clearUnlocked(lock);
  449|  57.6k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  451|  80.6k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  452|  80.6k|  xmpMetadata_.clear();
  453|  80.6k|  nsBindings_.clear();
  454|  80.6k|}
_ZNK5Exiv27XmpData3endEv:
  469|  54.8k|XmpData::const_iterator XmpData::end() const {
  470|  54.8k|  return xmpMetadata_.end();
  471|  54.8k|}
_ZNK5Exiv27XmpData5emptyEv:
  473|  7.08k|bool XmpData::empty() const {
  474|  7.08k|  XmpProperties::XmpLock lock;
  475|  7.08k|  return emptyUnlocked(lock);
  476|  7.08k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  478|  12.7k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  479|  12.7k|  return xmpMetadata_.empty();
  480|  12.7k|}
_ZN5Exiv27XmpData5beginEv:
  491|  3.53k|XmpData::iterator XmpData::begin() {
  492|  3.53k|  return xmpMetadata_.begin();
  493|  3.53k|}
_ZN5Exiv27XmpData3endEv:
  495|   449k|XmpData::iterator XmpData::end() {
  496|   449k|  return xmpMetadata_.end();
  497|   449k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  548|  28.6k|void xmpToolkitEnsureInitialized() {
  549|  28.6k|  static XmpToolkitLifetimeManager instance;
  550|  28.6k|  (void)instance;
  551|  28.6k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS_12DecodeParamsE:
  673|  25.2k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket, const DecodeParams& dp) {
  674|  25.2k|  try {
  675|  25.2k|    xmpData.setPacket(xmpPacket);
  676|  25.2k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (676:9): [True: 2.17k, False: 23.0k]
  ------------------
  677|  2.17k|      xmpData.clear();
  678|  2.17k|      return 0;
  679|  2.17k|    }
  680|       |
  681|       |    // Acquire Giant Lock
  682|  23.0k|    XmpProperties::XmpLock lock;
  683|  23.0k|    try {
  684|  23.0k|      xmpToolkitEnsureInitialized();
  685|  23.0k|    } catch (const Error&) {
  686|      0|#ifndef SUPPRESS_WARNINGS
  687|      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()
  ------------------
  688|      0|#endif
  689|      0|      return 2;
  690|      0|    }
  691|       |
  692|  23.0k|    xmpData.clearUnlocked(lock);
  693|       |
  694|       |    // Make sure the unterminated substring is used
  695|  23.0k|    size_t len = xmpPacket.size();
  696|   350k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (696:12): [True: 349k, False: 89]
  |  Branch (696:23): [True: 326k, False: 22.9k]
  ------------------
  697|   326k|      --len;
  698|       |
  699|  23.0k|    XMLValidator::check(xmpPacket.data(), len, dp);
  700|  23.0k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  701|  23.0k|    SXMPIterator iter(meta);
  702|  23.0k|    std::string schemaNs;
  703|  23.0k|    std::string propPath;
  704|  23.0k|    std::string propValue;
  705|  23.0k|    XMP_OptionBits opt = 0;
  706|   160k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (706:12): [True: 137k, False: 23.0k]
  ------------------
  707|   137k|      printNode(schemaNs, propPath, propValue, opt);
  708|   137k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (708:11): [True: 0, False: 137k]
  ------------------
  709|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  710|      0|      }
  711|   137k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (711:11): [True: 21.6k, False: 115k]
  ------------------
  712|       |        // Register unknown namespaces with Exiv2
  713|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  714|  21.6k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  715|  21.6k|        if (prefix.empty()) {
  ------------------
  |  Branch (715:13): [True: 14.6k, False: 7.02k]
  ------------------
  716|  14.6k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (716:15): [True: 0, False: 14.6k]
  ------------------
  717|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  718|  14.6k|          prefix.pop_back();
  719|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  720|       |          // already globally bound -- a built-in standard prefix, or one a prior
  721|       |          // explicit registerNs() established -- to a different URI.  Letting it
  722|       |          // would poison every later write and lookup in this process (the
  723|       |          // namespace-leak bug).  The packet's own binding is still captured
  724|       |          // per-instance below, so this object round-trips faithfully; we just
  725|       |          // don't pollute the global registry on a read.
  726|  14.6k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (726:15): [True: 37, False: 14.6k]
  ------------------
  727|     37|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  728|  14.6k|        }
  729|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  730|       |        // encode() can resolve each property's URI from the data it came from,
  731|       |        // rather than from the process-global registry which another image may
  732|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  733|  21.6k|        xmpData.nsBindings_[prefix] = schemaNs;
  734|  21.6k|        continue;
  735|  21.6k|      }
  736|   115k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  737|   115k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (737:11): [True: 1.90k, False: 113k]
  ------------------
  738|       |        // Read Lang Alt property
  739|  1.90k|        auto val = std::make_unique<LangAltValue>();
  740|  1.90k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  741|  13.3k|        while (count-- > 0) {
  ------------------
  |  Branch (741:16): [True: 11.4k, False: 1.89k]
  ------------------
  742|       |          // Get the text
  743|  11.4k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  744|  11.4k|          printNode(schemaNs, propPath, propValue, opt);
  745|  11.4k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (745:15): [True: 0, False: 11.4k]
  |  Branch (745:28): [True: 0, False: 11.4k]
  |  Branch (745:54): [True: 8, False: 11.4k]
  ------------------
  746|      8|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  747|      8|          }
  748|  11.4k|          std::string text = propValue;
  749|       |          // Get the language qualifier
  750|  11.4k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  751|  11.4k|          printNode(schemaNs, propPath, propValue, opt);
  752|  11.4k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (752:15): [True: 0, False: 11.4k]
  |  Branch (752:15): [True: 0, False: 11.4k]
  |  Branch (752:28): [True: 0, False: 11.4k]
  |  Branch (752:54): [True: 0, False: 11.4k]
  ------------------
  753|  11.4k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (753:15): [True: 0, False: 11.4k]
  ------------------
  754|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  755|      0|          }
  756|  11.4k|          val->value_[propValue] = std::move(text);
  757|  11.4k|        }
  758|  1.89k|        xmpData.addUnlocked(*key, val.get(), lock);
  759|  1.89k|        continue;
  760|  1.90k|      }
  761|   113k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (761:11): [True: 6.30k, False: 107k]
  |  Branch (761:35): [True: 6.30k, False: 0]
  |  Branch (761:66): [True: 6.30k, False: 0]
  ------------------
  762|       |        // Check if all elements are simple
  763|  6.30k|        bool simpleArray = true;
  764|  6.30k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  765|  6.30k|        std::string aSchemaNs;
  766|  6.30k|        std::string aPropPath;
  767|  6.30k|        std::string aPropValue;
  768|  6.30k|        XMP_OptionBits aOpt = 0;
  769|  22.6k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (769:16): [True: 18.8k, False: 3.84k]
  ------------------
  770|  18.8k|          if (propPath == aPropPath)
  ------------------
  |  Branch (770:15): [True: 6.30k, False: 12.5k]
  ------------------
  771|  6.30k|            continue;
  772|  12.5k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (772:15): [True: 1.70k, False: 10.8k]
  |  Branch (772:42): [True: 755, False: 10.0k]
  |  Branch (772:73): [True: 0, False: 10.0k]
  ------------------
  773|  12.5k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (773:15): [True: 0, False: 10.0k]
  |  Branch (773:41): [True: 0, False: 10.0k]
  ------------------
  774|  2.46k|            simpleArray = false;
  775|  2.46k|            break;
  776|  2.46k|          }
  777|  12.5k|        }
  778|  6.30k|        if (simpleArray) {
  ------------------
  |  Branch (778:13): [True: 3.84k, False: 2.46k]
  ------------------
  779|       |          // Read the array into an XmpArrayValue
  780|  3.84k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  781|  3.84k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  782|  13.1k|          while (count-- > 0) {
  ------------------
  |  Branch (782:18): [True: 9.29k, False: 3.84k]
  ------------------
  783|  9.29k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  784|  9.29k|            printNode(schemaNs, propPath, propValue, opt);
  785|  9.29k|            val->read(propValue);
  786|  9.29k|          }
  787|  3.84k|          xmpData.addUnlocked(*key, val.get(), lock);
  788|  3.84k|          continue;
  789|  3.84k|        }
  790|  6.30k|      }
  791|       |
  792|   110k|      auto val = std::make_unique<XmpTextValue>();
  793|   110k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (793:11): [True: 17.3k, False: 92.8k]
  |  Branch (793:36): [True: 2.46k, False: 90.3k]
  ------------------
  794|       |        // Create a metadatum with only XMP options
  795|  19.7k|        val->setXmpArrayType(xmpArrayType(opt));
  796|  19.7k|        val->setXmpStruct(xmpStruct(opt));
  797|  19.7k|        xmpData.addUnlocked(*key, val.get(), lock);
  798|  19.7k|        continue;
  799|  19.7k|      }
  800|  90.3k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (800:11): [True: 90.3k, False: 0]
  |  Branch (800:36): [True: 0, False: 0]
  ------------------
  801|  90.3k|        val->read(propValue);
  802|  90.3k|        xmpData.addUnlocked(*key, val.get(), lock);
  803|  90.3k|        continue;
  804|  90.3k|      }
  805|       |      // Don't let any node go by unnoticed
  806|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  807|  90.3k|    }  // iterate through all XMP nodes
  808|       |
  809|  23.0k|    return 0;
  810|  23.0k|  }
  811|  25.2k|#ifndef SUPPRESS_WARNINGS
  812|  25.2k|  catch (const Error& e) {
  813|     66|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (813:9): [True: 0, False: 66]
  ------------------
  814|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  815|      0|    }
  816|     66|    throw;
  817|  8.25k|  } catch (const XMP_Error& e) {
  818|  8.25k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  8.25k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 8.25k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  8.25k|  LogMsg(LogMsg::error).os()
  ------------------
  819|  8.25k|    xmpData.clear();
  820|  8.25k|    return 3;
  821|  8.25k|  }
  822|       |#else
  823|       |  catch (const XMP_Error&) {
  824|       |    xmpData.clear();
  825|       |    return 3;
  826|       |  }
  827|       |#endif  // SUPPRESS_WARNINGS
  828|  25.2k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  842|  5.65k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  843|  5.65k|  try {
  844|       |    // Acquire Giant Lock
  845|  5.65k|    XmpProperties::XmpLock lock;
  846|  5.65k|    try {
  847|  5.65k|      xmpToolkitEnsureInitialized();
  848|  5.65k|    } catch (const Error&) {
  849|      0|#ifndef SUPPRESS_WARNINGS
  850|      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()
  ------------------
  851|      0|#endif
  852|      0|      return 2;
  853|      0|    }
  854|       |
  855|  5.65k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (855:9): [True: 5.65k, False: 0]
  ------------------
  856|  5.65k|      xmpPacket.clear();
  857|  5.65k|      return 0;
  858|  5.65k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  859|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  860|      0|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (860:33): [True: 0, False: 0]
  ------------------
  861|       |#ifdef EXIV2_DEBUG_MESSAGES
  862|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  863|       |#endif
  864|       |      // registerNsImpl is safe since we hold the lock
  865|      0|      registerNsImpl(xmp, uri.prefix_);
  866|      0|    }
  867|       |
  868|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  869|       |    // the toolkit here.  Every URI they contain was already registered while its
  870|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  871|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  872|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  873|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  874|       |    // serialization of struct fields that still carry the file's prefix.
  875|      0|    SXMPMeta meta;
  876|      0|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (876:26): [True: 0, False: 0]
  ------------------
  877|      0|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  878|      0|      XMP_OptionBits options = 0;
  879|       |
  880|      0|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (880:11): [True: 0, False: 0]
  ------------------
  881|       |        // Encode Lang Alt property
  882|      0|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  883|      0|        if (!la)
  ------------------
  |  Branch (883:13): [True: 0, False: 0]
  ------------------
  884|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  885|       |
  886|      0|        int idx = 1;
  887|      0|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (887:40): [True: 0, False: 0]
  ------------------
  888|      0|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (888:15): [True: 0, False: 0]
  ------------------
  889|      0|            printNode(ns, xmp.tagName(), specs, 0);
  890|      0|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  891|      0|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  892|      0|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  893|      0|          }
  894|      0|        }
  895|      0|        continue;
  896|      0|      }
  897|       |
  898|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  899|      0|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  900|      0|      if (!val)
  ------------------
  |  Branch (900:11): [True: 0, False: 0]
  ------------------
  901|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  902|      0|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  903|      0|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:37): [True: 0, False: 0]
  |  Branch (903:63): [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|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (906:30): [True: 0, False: 0]
  ------------------
  907|      0|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  908|      0|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  909|      0|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  910|      0|        }
  911|      0|        continue;
  912|      0|      }
  913|      0|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (913:11): [True: 0, False: 0]
  ------------------
  914|      0|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  915|      0|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (915:13): [True: 0, False: 0]
  |  Branch (915:33): [True: 0, False: 0]
  |  Branch (915:72): [True: 0, False: 0]
  ------------------
  916|      0|          printNode(ns, xmp.tagName(), "", options);
  917|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  918|      0|        } else {
  919|      0|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  920|      0|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  921|      0|        }
  922|      0|        continue;
  923|      0|      }
  924|       |      // Don't let any Xmpdatum go by unnoticed
  925|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  926|      0|    }
  927|      0|    std::string tmpPacket;
  928|      0|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  929|      0|                           padding);  // throws
  930|      0|    xmpPacket = std::move(tmpPacket);
  931|       |
  932|      0|    return 0;
  933|      0|  }
  934|  5.65k|#ifndef SUPPRESS_WARNINGS
  935|  5.65k|  catch (const Error& /* e */) {
  936|      0|    throw;
  937|      0|  } catch (const XMP_Error& e) {
  938|      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()
  ------------------
  939|      0|    return 3;
  940|      0|  }
  941|       |#else
  942|       |  catch (const XMP_Error&) {
  943|       |    return 3;
  944|       |  }
  945|       |#endif  // SUPPRESS_WARNINGS
  946|  5.65k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1108|   115k|                                                      const XmpProperties::XmpLock& lock) {
 1109|   115k|  std::string property;
 1110|   115k|  std::string::size_type idx = propPath.find(':');
 1111|   115k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1111:7): [True: 0, False: 115k]
  ------------------
 1112|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1113|      0|  }
 1114|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1115|   115k|  property = propPath.substr(idx + 1);
 1116|   115k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1117|   115k|  if (prefix.empty()) {
  ------------------
  |  Branch (1117:7): [True: 45.0k, False: 70.8k]
  ------------------
 1118|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1119|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1120|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1121|       |    // the property still gets a key; its URI is preserved per-instance.
 1122|  45.0k|    std::string toolkitPrefix;
 1123|  45.0k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1123:9): [True: 45.0k, False: 0]
  ------------------
 1124|  45.0k|      toolkitPrefix.pop_back();
 1125|  45.0k|      prefix = std::move(toolkitPrefix);
 1126|  45.0k|    }
 1127|  45.0k|  }
 1128|   115k|  if (prefix.empty()) {
  ------------------
  |  Branch (1128:7): [True: 0, False: 115k]
  ------------------
 1129|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1130|      0|  }
 1131|   115k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1132|   115k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  213|  14.6M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  214|  14.6M|    return key_ == xmpdatum.key();
  215|  14.6M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  207|  1.28M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  208|  1.28M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcmRKN5Exiv212DecodeParamsE:
   67|  23.0k|  static void check(const char* buf, size_t buflen, const DecodeParams& dp) {
   68|  23.0k|    XMLValidator validator(dp.max_recursion_depth());
   69|  23.0k|    validator.check_internal(buf, buflen);
   70|  23.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Em:
   79|  23.0k|      max_recursion_depth_(max_recursion_depth), parser_(XML_ParserCreateNS(nullptr, '@')) {
   80|  23.0k|    if (!parser_) {
  ------------------
  |  Branch (80:9): [True: 0, False: 23.0k]
  ------------------
   81|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   82|      0|    }
   83|  23.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  114|  23.0k|  void check_internal(const char* buf, size_t buflen) {
  115|  23.0k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (115:9): [True: 0, False: 23.0k]
  ------------------
  116|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  117|      0|    }
  118|       |
  119|  23.0k|    XML_SetUserData(parser_, this);
  120|  23.0k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  121|  23.0k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  122|  23.0k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  123|       |
  124|  23.0k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (124:9): [True: 3.71k, False: 19.3k]
  ------------------
  125|  3.71k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  126|  3.71k|    }
  127|       |
  128|  23.0k|    if (haserror_) {
  ------------------
  |  Branch (128:9): [True: 3.71k, False: 19.3k]
  ------------------
  129|  3.71k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  130|  3.71k|    }
  131|  23.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  170|   172k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  171|   172k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  172|   172k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  133|   172k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  134|   172k|    if (element_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (134:9): [True: 7.78k, False: 164k]
  ------------------
  135|  7.78k|      setError("Too deeply nested");
  136|  7.78k|    }
  137|   172k|    ++element_depth_;
  138|   172k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  176|   147k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  177|   147k|    static_cast<XMLValidator*>(userData)->endElement(name);
  178|   147k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  140|   147k|  void endElement(const XML_Char*) noexcept {
  141|   147k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (141:9): [True: 147k, False: 0]
  ------------------
  142|   147k|      --element_depth_;
  143|   147k|    } else {
  144|      0|      setError("Negative depth");
  145|      0|    }
  146|   147k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  182|   126k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  183|   126k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  184|   126k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  148|   126k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  149|   126k|    if (namespace_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (149:9): [True: 46.3k, False: 80.4k]
  ------------------
  150|  46.3k|      setError("Too deeply nested");
  151|  46.3k|    }
  152|   126k|    ++namespace_depth_;
  153|   126k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  188|  63.2k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  189|  63.2k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  190|  63.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  155|  63.2k|  void endNamespace(const XML_Char*) noexcept {
  156|  63.2k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (156:9): [True: 63.2k, False: 0]
  ------------------
  157|  63.2k|      --namespace_depth_;
  158|  63.2k|    } else {
  159|      0|      setError("Negative depth");
  160|      0|    }
  161|  63.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   89|  57.8k|  void setError(const char* msg) {
   90|       |#if XML_MAJOR_VERSION > 2 || (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION >= 9)
   91|       |    // This is a workaround for XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
   92|       |    // getting deprecated and replaced with 64-bit versions in Expat 2.9.0. Until all
   93|       |    // the platforms support the latest version Expat, we need to keep this code which
   94|       |    // uses the old versions.
   95|       |    const uint64_t errlinenum = XML_GetCurrentLineNumber64(parser_);
   96|       |    const uint64_t errcolnum = XML_GetCurrentColumnNumber64(parser_);
   97|       |#else
   98|  57.8k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   99|  57.8k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
  100|  57.8k|#endif
  101|       |
  102|  57.8k|#ifndef SUPPRESS_WARNINGS
  103|  57.8k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  57.8k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 57.8k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  57.8k|  LogMsg(LogMsg::info).os()
  ------------------
  104|  57.8k|#endif
  105|       |    // If this is the first error, then save it.
  106|  57.8k|    if (!haserror_) {
  ------------------
  |  Branch (106:9): [True: 3.71k, False: 54.1k]
  ------------------
  107|  3.71k|      haserror_ = true;
  108|  3.71k|      errmsg_ = msg;
  109|  3.71k|      errlinenum_ = errlinenum;
  110|  3.71k|      errcolnum_ = errcolnum;
  111|  3.71k|    }
  112|  57.8k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   85|  23.0k|  ~XMLValidator() {
   86|  23.0k|    XML_ParserFree(parser_);
   87|  23.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  965|  19.7k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  966|  19.7k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  967|  19.7k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (967:7): [True: 17.3k, False: 2.46k]
  ------------------
  968|  17.3k|    var = Exiv2::XmpValue::xsStruct;
  969|  17.3k|  }
  970|  19.7k|  return var;
  971|  19.7k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  985|  23.6k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  986|  23.6k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  987|  23.6k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (987:7): [True: 6.30k, False: 17.3k]
  ------------------
  988|  6.30k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (988:9): [True: 2.51k, False: 3.78k]
  ------------------
  989|  2.51k|      typeId = Exiv2::xmpAlt;
  990|  3.78k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (990:14): [True: 3.07k, False: 710]
  ------------------
  991|  3.07k|      typeId = Exiv2::xmpSeq;
  992|    710|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (992:14): [True: 710, False: 0]
  ------------------
  993|    710|      typeId = Exiv2::xmpBag;
  994|  6.30k|  }
  995|  23.6k|  return typeId;
  996|  23.6k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  998|  19.7k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  999|  19.7k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
 1000|  19.7k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1101|   169k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1102|   169k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  256|   388k|  ~Impl() = default;

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

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

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  16.7k|{
  625|  16.7k|	IgnoreParam(options);
  ------------------
  |  |  117|  16.7k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  16.7k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  16.7k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  16.7k|{
  647|       |
  648|  16.7k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     83|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 83, False: 16.6k]
  ------------------
  649|  16.6k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  16.6k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  16.6k|{
  664|  16.6k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  16.6k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  16.6k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  16.6k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  89.0k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 72.3k, False: 16.6k]
  ------------------
  670|  72.3k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 55.5k, False: 16.7k]
  ------------------
  671|  16.7k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  16.7k|	}
  673|       |
  674|  16.6k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  26.5k|{
  695|  26.5k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  26.5k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 10.3k, False: 16.1k]
  |  Branch (696:45): [True: 195, False: 10.1k]
  ------------------
  697|    195|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|    195|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  26.3k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 16.7k, False: 9.54k]
  |  Branch (700:21): [True: 703, False: 16.0k]
  ------------------
  701|    703|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    703|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  25.6k|	} else {
  703|  25.6k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  25.6k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  25.6k|	}
  706|       |
  707|  26.3k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   270k|{
  265|   270k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   270k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 269k, False: 824]
  |  Branch (269:28): [True: 110k, False: 159k]
  ------------------
  270|       |
  271|   110k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 59.7k, False: 50.3k]
  ------------------
  272|  59.7k|			term = kRDFTerm_li;
  273|  59.7k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 68, False: 50.2k]
  ------------------
  274|     68|			term = kRDFTerm_parseType;
  275|  50.2k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 16.1k, False: 34.0k]
  ------------------
  276|  16.1k|			term = kRDFTerm_Description;
  277|  34.0k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 2.88k, False: 31.1k]
  ------------------
  278|  2.88k|			term = kRDFTerm_about;
  279|  31.1k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 202, False: 30.9k]
  ------------------
  280|    202|			term = kRDFTerm_resource;
  281|  30.9k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 274, False: 30.7k]
  ------------------
  282|    274|			term = kRDFTerm_RDF;
  283|  30.7k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 1.53k, False: 29.1k]
  ------------------
  284|  1.53k|			term = kRDFTerm_ID;
  285|  29.1k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 2.00k, False: 27.1k]
  ------------------
  286|  2.00k|			term = kRDFTerm_nodeID;
  287|  27.1k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 69, False: 27.1k]
  ------------------
  288|     69|			term = kRDFTerm_datatype;
  289|  27.1k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 69, False: 27.0k]
  ------------------
  290|     69|			term = kRDFTerm_aboutEach;
  291|  27.0k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 66, False: 26.9k]
  ------------------
  292|     66|			term = kRDFTerm_aboutEachPrefix;
  293|  26.9k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 103, False: 26.8k]
  ------------------
  294|    103|			term = kRDFTerm_bagID;
  295|    103|		}
  296|       |
  297|   110k|	}
  298|       |
  299|   270k|	return term;
  300|       |
  301|   270k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  25.6k|{
  732|  25.6k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  25.6k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  25.6k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  58.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 33.7k, False: 24.3k]
  ------------------
  738|       |
  739|  33.7k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  33.7k|		switch ( attrTerm ) {
  742|       |
  743|    112|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 112, False: 33.6k]
  ------------------
  744|    179|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 67, False: 33.6k]
  ------------------
  745|  3.06k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 2.88k, False: 30.8k]
  ------------------
  746|       |
  747|  3.06k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     67|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 67, False: 2.99k]
  ------------------
  748|  2.99k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  2.99k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 2.98k, False: 11]
  |  Branch (750:24): [True: 2.80k, False: 177]
  ------------------
  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|  2.80k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  2.80k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  2.80k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 2.74k, False: 66]
  ------------------
  755|  2.74k|						xmpParent->name = (*currAttr)->value;
  756|  2.74k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 53, False: 13]
  ------------------
  757|     53|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     28|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 28, False: 25]
  ------------------
  758|     25|					}
  759|  2.80k|				}
  760|       |
  761|  2.96k|				break;
  762|       |
  763|  30.3k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 30.3k, False: 3.37k]
  ------------------
  764|  30.3k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  30.3k|				break;
  766|       |
  767|    310|			default :
  ------------------
  |  Branch (767:4): [True: 310, False: 33.4k]
  ------------------
  768|    310|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|    310|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  33.7k|		}
  771|       |
  772|  33.7k|	}
  773|       |
  774|  25.6k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   135k|{
  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|   135k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 676, False: 134k]
  ------------------
  371|    676|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    676|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   134k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   134k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   134k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   134k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   134k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 42.7k, False: 91.9k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  42.7k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  42.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  42.7k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  42.7k|#define kXMP_CreateNodes	true
  ------------------
  384|  42.7k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  42.7k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  26.4k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 26.4k, False: 16.2k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  42.7k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  42.7k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 42.7k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  42.7k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   134k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 75.2k, False: 59.3k]
  ------------------
  398|  75.2k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  75.2k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 73, False: 75.2k]
  ------------------
  399|     73|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     73|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  75.2k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   134k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   134k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 134k, False: 197]
  |  Branch (406:26): [True: 67, False: 130]
  ------------------
  407|   134k|		 xmpParent->children.push_back ( newChild );
  408|   134k|	} else {
  409|    197|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|    197|	}
  411|   134k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 197, False: 134k]
  ------------------
  412|    197|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    197|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 196, False: 1]
  |  Branch (412:22): [True: 1, False: 0]
  ------------------
  413|      0|		xmpParent->options |= kRDF_HasValueElem;
  414|      0|	}
  415|       |	
  416|   134k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 59.1k, False: 75.2k]
  ------------------
  417|  59.1k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     67|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 67, False: 59.0k]
  ------------------
  418|  59.0k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  59.0k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  59.0k|	}
  423|       |	
  424|   134k|	return newChild;
  425|       |
  426|   134k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  24.5k|{
  787|  24.5k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  24.5k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   277k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 253k, False: 23.9k]
  ------------------
  791|   253k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 179k, False: 74.6k]
  ------------------
  792|  74.6k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 611, False: 73.9k]
  ------------------
  793|    611|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    611|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  73.9k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  73.9k|	}
  797|       |
  798|  24.5k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  73.9k|{
  854|  73.9k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  73.9k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|    274|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 274, False: 73.7k]
  ------------------
  856|       |	
  857|  73.7k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 1.77k, False: 71.9k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  1.77k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  71.9k|	} else {
  863|       |
  864|       |		// Look through the attributes for one that isn't rdf:ID or xml:lang, it will usually tell
  865|       |		// what we should be dealing with. The called routines must verify their specific syntax!
  866|       |
  867|  71.9k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  71.9k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  71.9k|		XMP_VarString * attrName = 0;
  870|       |
  871|   100k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 47.9k, False: 52.3k]
  ------------------
  872|  47.9k|			attrName = &((*currAttr)->name);
  873|  47.9k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 20.2k, False: 27.7k]
  |  Branch (873:38): [True: 19.5k, False: 631]
  ------------------
  874|  47.9k|		}
  875|       |
  876|  71.9k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 19.5k, False: 52.3k]
  ------------------
  877|       |
  878|  19.5k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  19.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  19.5k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  19.5k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 336, False: 19.2k]
  ------------------
  882|    336|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  19.2k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 18.7k, False: 527]
  ------------------
  884|  18.7k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  18.7k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 0, False: 527]
  ------------------
  886|      0|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    527|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 217, False: 310]
  ------------------
  888|    217|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    310|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 10, False: 300]
  ------------------
  890|     10|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|    300|			} else {
  892|    300|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|    300|			}
  894|       |
  895|  52.3k|		} 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|  52.3k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 25.2k, False: 27.0k]
  ------------------
  901|       |
  902|  25.2k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  27.0k|			} else {
  905|       |			
  906|  27.0k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  27.0k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  71.4k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 54.3k, False: 17.1k]
  ------------------
  910|  54.3k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 9.96k, False: 44.3k]
  ------------------
  911|  54.3k|				}
  912|       |				
  913|  27.0k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 17.1k, False: 9.96k]
  ------------------
  914|  17.1k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  17.1k|				} else {
  916|  9.96k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  9.96k|				}
  918|       |			
  919|  27.0k|			}
  920|       |
  921|  52.3k|		}
  922|       |		
  923|  71.9k|	}
  924|       |
  925|  73.7k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  73.9k|{
  350|       |
  351|  73.9k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 22, False: 73.9k]
  |  Branch (351:42): [True: 34, False: 73.9k]
  ------------------
  352|  73.9k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  73.9k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  73.9k|{
  334|       |
  335|  73.9k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 34, False: 73.9k]
  |  Branch (335:39): [True: 34, False: 0]
  ------------------
  336|  73.9k|	return false;
  337|       |
  338|  73.9k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  73.9k|{
  317|       |
  318|  73.9k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 59.8k, False: 14.1k]
  |  Branch (318:40): [True: 218, False: 59.5k]
  ------------------
  319|  73.7k|	return false;
  320|       |
  321|  73.9k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  45.7k|{
 1190|  45.7k|	bool hasPropertyAttrs = false;
 1191|  45.7k|	bool hasResourceAttr  = false;
 1192|  45.7k|	bool hasNodeIDAttr    = false;
 1193|  45.7k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  45.7k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  45.7k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     81|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 81, False: 45.6k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  45.6k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  45.6k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   114k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 68.8k, False: 45.6k]
  ------------------
 1205|       |
 1206|  68.8k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  68.8k|		switch ( attrTerm ) {
 1209|       |
 1210|    709|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 709, False: 68.1k]
  ------------------
 1211|       |				// Nothing to do.
 1212|    709|				break;
 1213|       |
 1214|    168|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 168, False: 68.6k]
  ------------------
 1215|    168|				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: 168]
  ------------------
 1216|    168|				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: 168]
  ------------------
 1217|    168|				hasResourceAttr = true;
 1218|    168|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 168, False: 0]
  ------------------
 1219|    168|				break;
 1220|       |
 1221|    970|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 970, False: 67.8k]
  ------------------
 1222|    970|				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: 970]
  ------------------
 1223|    970|				hasNodeIDAttr = true;
 1224|    970|				break;
 1225|       |
 1226|  66.9k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 66.9k, False: 1.91k]
  ------------------
 1227|  66.9k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 937, False: 66.0k]
  ------------------
 1228|    937|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 3, False: 934]
  ------------------
 1229|    934|					hasValueAttr = true;
 1230|    934|					valueNode = *currAttr;
 1231|  66.0k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 40.0k, False: 25.9k]
  ------------------
 1232|  40.0k|					hasPropertyAttrs = true;
 1233|  40.0k|				}
 1234|  66.9k|				break;
 1235|       |
 1236|  66.9k|			default :
  ------------------
  |  Branch (1236:4): [True: 66, False: 68.7k]
  ------------------
 1237|     66|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     66|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  68.8k|		}
 1241|       |
 1242|  68.8k|	}
 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|  45.6k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  45.6k|	bool childIsStruct = false;
 1250|       |	
 1251|  45.6k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 1.09k, False: 44.5k]
  ------------------
 1252|  1.09k|		childNode->value = valueNode->value;
 1253|  1.09k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 165, False: 934]
  ------------------
 1254|  44.5k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 18.5k, False: 25.9k]
  ------------------
 1255|  18.5k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  18.5k|		childIsStruct = true;
 1257|  18.5k|	}
 1258|       |		
 1259|  45.6k|	currAttr = xmlNode.attrs.begin();
 1260|  45.6k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   114k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 68.6k, False: 45.5k]
  ------------------
 1263|       |
 1264|  68.6k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 1.08k, False: 67.5k]
  ------------------
 1265|  67.5k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  67.5k|		switch ( attrTerm ) {
 1268|       |
 1269|    709|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 709, False: 66.8k]
  ------------------
 1270|  1.67k|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 969, False: 66.6k]
  ------------------
 1271|  1.67k|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 67.5k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  65.9k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 65.9k, False: 1.67k]
  ------------------
 1278|  65.9k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 32.8k, False: 33.0k]
  |  Branch (1278:31): [True: 1.38k, False: 31.6k]
  ------------------
 1279|  34.2k|					AddQualifierNode ( childNode, **currAttr );
 1280|  34.2k|				} else {
 1281|  31.6k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  31.6k|				}
 1283|  65.9k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 67.5k]
  ------------------
 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|  67.5k|		}
 1290|       |
 1291|  67.5k|	}
 1292|       |
 1293|  45.6k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  36.1k|{
  484|  36.1k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 14, False: 36.1k]
  ------------------
  485|     14|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     14|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  36.1k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  36.1k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  36.9k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  36.9k|	const bool isLang = (name == "xml:lang");
  443|  36.9k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  36.9k|	XMP_Node * newQual = 0;
  446|       |
  447|  36.9k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  36.9k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 8.22k, False: 28.7k]
  ------------------
  450|  8.22k|			xmpParent->qualifiers.push_back ( newQual );
  451|  28.7k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 27.9k, False: 809]
  ------------------
  452|  27.9k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 27.9k, False: 13]
  ------------------
  453|  27.9k|				xmpParent->qualifiers.push_back ( newQual );
  454|  27.9k|			} else {
  455|     13|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     13|			}
  457|  27.9k|			xmpParent->options |= kXMP_PropHasLang;
  458|  27.9k|		} else {
  459|    809|			XMP_Assert ( isType );
  ------------------
  |  |  142|    809|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    809|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 669, False: 140]
  ------------------
  461|    669|				xmpParent->qualifiers.push_back ( newQual );
  462|    669|			} else {
  463|    140|				size_t offset = 0;
  464|    140|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 140, False: 0]
  ------------------
  465|    140|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|    140|			}
  467|    809|			xmpParent->options |= kXMP_PropHasType;
  468|    809|		}
  469|       |
  470|  36.9k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  36.9k|	return newQual;
  473|       |
  474|  36.9k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  17.4k|{
 1015|  17.4k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  17.4k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  17.4k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  19.7k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 2.53k, False: 17.2k]
  ------------------
 1021|  2.53k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  2.53k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 1.81k, False: 717]
  ------------------
 1023|  1.81k|			AddQualifierNode ( newChild, **currAttr );
 1024|  1.81k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 120, False: 597]
  |  Branch (1024:41): [True: 332, False: 265]
  ------------------
 1025|    452|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|    452|		} else {
 1027|    265|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    265|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  2.53k|	}
 1030|       |	
 1031|  17.2k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  17.2k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  17.2k|	size_t      textSize  = 0;
 1034|       |
 1035|  44.1k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 26.9k, False: 17.2k]
  ------------------
 1036|  26.9k|		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: 26.9k]
  ------------------
 1037|  26.9k|		textSize += (*currChild)->value.size();
 1038|  26.9k|	}
 1039|       |	
 1040|  17.2k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  44.1k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 26.9k, False: 17.2k]
  ------------------
 1043|  26.9k|		newChild->value += (*currChild)->value;
 1044|  26.9k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  17.2k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    217|{
 1087|       |
 1088|    217|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    217|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    217|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    217|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    437|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 241, False: 196]
  ------------------
 1095|    241|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    241|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 217, False: 24]
  ------------------
 1097|    217|			continue;	// ! The caller ensured the value is "Resource".
 1098|    217|		} else if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1098:15): [True: 3, False: 21]
  ------------------
 1099|      3|			AddQualifierNode ( newStruct, **currAttr );
 1100|     21|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (1100:15): [True: 0, False: 21]
  ------------------
 1101|      0|			continue;	// Ignore all rdf:ID attributes.
 1102|     21|		} else {
 1103|     21|			XMP_Throw ( "Invalid attribute for ParseTypeResource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1104|      0|		}
 1105|    241|	}
 1106|       |
 1107|    196|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    196|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 196]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    196|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL38RDF_ParseTypeCollectionPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1127|     10|{
 1128|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1129|       |
 1130|     10|	XMP_Throw ( "ParseTypeCollection property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1131|       |
 1132|      0|}	// RDF_ParseTypeCollectionPropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|    300|{
 1147|    300|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    300|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    300|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    300|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|    300|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    300|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  9.96k|{
  943|  9.96k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 9.67k, False: 290]
  |  Branch (943:21): [True: 0, False: 9.67k]
  ------------------
  944|       |	
  945|  9.96k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  9.96k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  9.96k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  10.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 143, False: 9.96k]
  ------------------
  951|    143|		XMP_VarString & attrName = (*currAttr)->name;
  952|    143|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 142, False: 1]
  ------------------
  953|    142|			AddQualifierNode ( newCompound, **currAttr );
  954|    142|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 1, False: 0]
  ------------------
  955|      1|			continue;	// Ignore all rdf:ID attributes.
  956|      1|		} else {
  957|      0|			XMP_Throw ( "Invalid attribute for resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  958|      0|		}
  959|    143|	}
  960|       |	
  961|  9.96k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  9.96k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  27.1k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 27.0k, False: 72]
  ------------------
  965|  27.0k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 9.89k, False: 17.1k]
  ------------------
  966|  27.0k|	}
  967|  9.96k|	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: 9.96k]
  ------------------
  968|  9.96k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     85|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 85, False: 9.87k]
  ------------------
  969|       |
  970|  9.87k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 203, False: 9.67k]
  ------------------
  971|    203|		newCompound->options |= kXMP_PropValueIsArray;
  972|  9.67k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 3.47k, False: 6.19k]
  ------------------
  973|  3.47k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  6.19k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 5.17k, False: 1.02k]
  ------------------
  975|  5.17k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  5.17k|	} else {
  977|  1.02k|		newCompound->options |= kXMP_PropValueIsStruct;
  978|  1.02k|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 881, False: 147]
  ------------------
  979|    881|			XMP_VarString typeName ( (*currChild)->ns );
  980|    881|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    881|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     72|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 72, False: 809]
  ------------------
  982|    809|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    809|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    809|		}
  985|  1.02k|	}
  986|       |
  987|  9.80k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  9.80k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 9.80k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  9.80k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 4.36k, False: 5.44k]
  ------------------
  991|  4.36k|		DetectAltText ( newCompound );
  992|  4.36k|	}
  993|       |
  994|  25.5k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 15.7k, False: 9.72k]
  ------------------
  995|  15.7k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     82|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 82, False: 15.7k]
  ------------------
  996|  15.7k|	}
  997|       |
  998|  9.80k|}	// 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|  12.5k|{
  568|  12.5k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  12.5k|	size_t unitCount = 0;
  570|       |
  571|  12.5k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  12.5k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 12.5k]
  ------------------
  573|  12.5k|	inUnit = *utf8In;
  574|  12.5k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 12.5k, 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|  12.5k|MultiByte:
  584|  12.5k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  12.5k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  12.5k|{
  517|  12.5k|	UTF8Unit  inUnit = *utf8In;
  518|  12.5k|	size_t    unitCount = 0;
  519|  12.5k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  12.5k|	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|  12.5k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  40.1k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 27.5k, False: 12.5k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  12.5k|	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: 12.5k]
  |  Branch (538:28): [True: 0, False: 12.5k]
  ------------------
  539|  12.5k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 12.5k]
  ------------------
  540|  12.5k|	unitCount = bytesNeeded;
  541|       |	
  542|  12.5k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  12.5k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  27.5k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 14.9k, False: 12.5k]
  ------------------
  546|  14.9k|		inUnit = *utf8Pos;
  547|  14.9k|		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: 14.9k]
  ------------------
  548|  14.9k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  14.9k|	}
  550|       |	
  551|  12.5k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 0, False: 12.5k]
  ------------------
  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|  12.5k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  12.5k|Done:	
  559|  12.5k|	*utf8Read = unitCount;
  560|  12.5k|	return;
  561|       |	
  562|  12.5k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   471k|{
   88|       |
   89|   471k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   471k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   471k|	const XMP_Uns8 * namePos   = nameStart;
   92|   471k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   471k|	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: 471k]
  ------------------
   97|       |
   98|   471k|	cp = *namePos;
   99|   471k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 470k, False: 780]
  ------------------
  100|   470k|		++namePos;
  101|   470k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 470k]
  ------------------
  102|   470k|	} else {
  103|    780|		cp = GetCodePoint ( &namePos );
  104|    780|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 780]
  ------------------
  105|    780|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  25.0M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 24.5M, False: 471k]
  ------------------
  110|  24.5M|		cp = *namePos;
  111|  24.5M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 24.5M, False: 7.53k]
  ------------------
  112|  24.5M|			++namePos;
  113|  24.5M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 90.7k, False: 24.4M]
  |  Branch (113:38): [True: 0, False: 90.7k]
  ------------------
  114|  24.5M|		} else {
  115|  7.53k|			cp = GetCodePoint ( &namePos );
  116|  7.53k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 901, False: 6.63k]
  |  Branch (116:41): [True: 0, False: 901]
  ------------------
  117|  7.53k|		}
  118|  24.5M|	}
  119|       |
  120|   471k|	return;
  121|       |
  122|   471k|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|  25.0M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  25.0M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 24.7M, False: 328k]
  |  Branch (33:23): [True: 24.7M, False: 0]
  |  Branch (33:40): [True: 237k, False: 90.7k]
  |  Branch (33:55): [True: 232k, False: 4.98k]
  |  Branch (33:71): [True: 4.98k, False: 90.7k]
  ------------------
   34|  90.7k|	return false;
   35|  25.0M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  8.31k|{
   20|  8.31k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  8.31k|	XMP_Uns32 cp;
   22|  8.31k|	size_t u8Len;
   23|  8.31k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  8.31k|	*utf8Str_io = u8Ptr + u8Len;
   25|  8.31k|	return cp;
   26|  8.31k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  8.31k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  8.31k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 7.71k, False: 606]
  |  Branch (43:24): [True: 1.00k, False: 6.70k]
  |  Branch (43:43): [True: 6.70k, False: 606]
  |  Branch (43:59): [True: 727, False: 5.97k]
  ------------------
   44|  6.58k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 5.97k, False: 606]
  |  Branch (44:24): [True: 3.64k, False: 2.33k]
  |  Branch (44:43): [True: 2.03k, False: 901]
  |  Branch (44:60): [True: 0, False: 2.03k]
  ------------------
   45|       |
   46|  2.93k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 2.03k, False: 901]
  |  Branch (46:25): [True: 1.45k, False: 584]
  |  Branch (46:46): [True: 584, False: 901]
  |  Branch (46:64): [True: 0, False: 584]
  ------------------
   47|  1.48k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 584, False: 901]
  |  Branch (47:26): [True: 0, False: 584]
  |  Branch (47:46): [True: 584, False: 901]
  |  Branch (47:64): [True: 0, False: 584]
  ------------------
   48|  1.48k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 584, False: 901]
  |  Branch (48:26): [True: 584, False: 0]
  |  Branch (48:46): [True: 0, False: 901]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    901|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 901]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 901]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    901|	return false;
   52|       |
   53|    901|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  90.7k|{
   59|       |	// ASCII following characters for an XML name.
   60|  90.7k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 47.6k, False: 43.0k]
  |  Branch (60:23): [True: 47.6k, False: 0]
  |  Branch (60:39): [True: 25.2k, False: 17.8k]
  |  Branch (60:54): [True: 17.8k, False: 0]
  ------------------
   61|      0|	return false;
   62|  90.7k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    901|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    901|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 606, False: 295]
  |  Branch (69:24): [True: 295, False: 0]
  |  Branch (69:41): [True: 295, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    901|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  62.6k|{
   88|       |
   89|  62.6k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  62.6k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  62.6k|	const XMP_Uns8 * namePos   = nameStart;
   92|  62.6k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  62.6k|	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: 62.6k]
  ------------------
   97|       |
   98|  62.6k|	cp = *namePos;
   99|  62.6k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 62.1k, False: 478]
  ------------------
  100|  62.1k|		++namePos;
  101|  62.1k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 62.1k]
  ------------------
  102|  62.1k|	} else {
  103|    478|		cp = GetCodePoint ( &namePos );
  104|    478|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 478]
  ------------------
  105|    478|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  11.0M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 11.0M, False: 62.6k]
  ------------------
  110|  11.0M|		cp = *namePos;
  111|  11.0M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 11.0M, False: 3.78k]
  ------------------
  112|  11.0M|			++namePos;
  113|  11.0M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 15.3k, False: 11.0M]
  |  Branch (113:38): [True: 0, False: 15.3k]
  ------------------
  114|  11.0M|		} else {
  115|  3.78k|			cp = GetCodePoint ( &namePos );
  116|  3.78k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 238, False: 3.54k]
  |  Branch (116:41): [True: 0, False: 238]
  ------------------
  117|  3.78k|		}
  118|  11.0M|	}
  119|       |
  120|  62.6k|	return;
  121|       |
  122|  62.6k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  11.0M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  11.0M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 11.0M, False: 48.2k]
  |  Branch (33:23): [True: 11.0M, False: 0]
  |  Branch (33:40): [True: 32.8k, False: 15.3k]
  |  Branch (33:55): [True: 31.0k, False: 1.88k]
  |  Branch (33:71): [True: 1.88k, False: 15.3k]
  ------------------
   34|  15.3k|	return false;
   35|  11.0M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  4.26k|{
   20|  4.26k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  4.26k|	XMP_Uns32 cp;
   22|  4.26k|	size_t u8Len;
   23|  4.26k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  4.26k|	*utf8Str_io = u8Ptr + u8Len;
   25|  4.26k|	return cp;
   26|  4.26k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  4.26k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  4.26k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 4.12k, False: 137]
  |  Branch (43:24): [True: 664, False: 3.46k]
  |  Branch (43:43): [True: 3.46k, False: 137]
  |  Branch (43:59): [True: 590, False: 2.87k]
  ------------------
   44|  3.01k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 2.87k, False: 137]
  |  Branch (44:24): [True: 1.59k, False: 1.27k]
  |  Branch (44:43): [True: 1.17k, False: 238]
  |  Branch (44:60): [True: 0, False: 1.17k]
  ------------------
   45|       |
   46|  1.41k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.17k, False: 238]
  |  Branch (46:25): [True: 678, False: 497]
  |  Branch (46:46): [True: 497, False: 238]
  |  Branch (46:64): [True: 0, False: 497]
  ------------------
   47|    735|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 497, False: 238]
  |  Branch (47:26): [True: 0, False: 497]
  |  Branch (47:46): [True: 497, False: 238]
  |  Branch (47:64): [True: 0, False: 497]
  ------------------
   48|    735|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 497, False: 238]
  |  Branch (48:26): [True: 497, False: 0]
  |  Branch (48:46): [True: 0, False: 238]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|    238|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 238]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 238]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|    238|	return false;
   52|       |
   53|    238|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  15.3k|{
   59|       |	// ASCII following characters for an XML name.
   60|  15.3k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 5.87k, False: 9.51k]
  |  Branch (60:23): [True: 5.87k, False: 0]
  |  Branch (60:39): [True: 6.60k, False: 2.90k]
  |  Branch (60:54): [True: 2.90k, False: 0]
  ------------------
   61|      0|	return false;
   62|  15.3k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|    238|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|    238|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 137, False: 101]
  |  Branch (69:24): [True: 101, False: 0]
  |  Branch (69:41): [True: 101, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|    238|}

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

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

WXMPUtils_ConvertToDate_1:
  339|    590|{
  340|    590|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPUtils_ConvertToDate_1" )
  ------------------
  |  |  235|    590|	AnnounceNoLock ( proc );								\
  |  |  236|    590|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|    590|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|    590|	try {													\
  |  |  238|    590|		wResult->errMessage = 0;
  ------------------
  341|       |
  342|    590|		if ( binValue == 0 ) XMP_Throw ( "Null output date", kXMPErr_BadParam); // ! Pointer is from the client.
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (342:8): [True: 0, False: 590]
  ------------------
  343|    590|		XMPUtils::ConvertToDate ( strValue, binValue );
  344|       |
  345|    590|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|    590|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|    590|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|    396|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|    396|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|    396|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|    396|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 396]
  |  |  |  |  ------------------
  |  |  |  |  270|    396|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|    396|	} 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|    590|	AnnounceExit();
  ------------------
  346|    590|}
WXMPUtils_ConvertToLocalTime_1:
  395|    194|{
  396|    194|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPUtils_ConvertToLocalTime_1" )
  ------------------
  |  |  235|    194|	AnnounceNoLock ( proc );								\
  |  |  236|    194|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|    194|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|    194|	try {													\
  |  |  238|    194|		wResult->errMessage = 0;
  ------------------
  397|       |
  398|    194|		if ( time == 0 ) XMP_Throw ( "Null output date", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (398:8): [True: 0, False: 194]
  ------------------
  399|    194|		XMPUtils::ConvertToLocalTime ( time );
  400|       |
  401|    194|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|    194|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|    194|	} 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|    194|	AnnounceExit();
  ------------------
  402|    194|}

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   369k|{
   40|   369k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 99.9k, False: 269k]
  ------------------
   41|       |
   42|   970k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 703k, False: 267k]
  ------------------
   43|   703k|		unsigned char ch = this->value[i];
   44|   703k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   703k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 543k, False: 159k]
  |  |  |  Branch (45:49): [True: 25.1k, False: 134k]
  |  |  |  Branch (45:67): [True: 132k, False: 1.45k]
  |  |  |  Branch (45:85): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|  1.45k|		return false;	// All the checks failed, this isn't whitespace.
   47|   703k|	}
   48|       |
   49|   267k|	return true;
   50|       |
   51|   269k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   686k|{
  428|       |
  429|   801k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 115k, False: 686k]
  ------------------
  430|   686k|	this->attrs.clear();
  431|       |
  432|   686k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   686k|{
  440|       |
  441|  1.23M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 552k, False: 686k]
  ------------------
  442|   686k|	this->content.clear();
  443|       |
  444|   686k|}	// 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|   373k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   373k|		int err = pthread_mutex_lock ( &mutex );
  125|   373k|		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: 373k]
  ------------------
  126|   373k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   373k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   373k|		int err = pthread_mutex_unlock ( &mutex );
  130|   373k|		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: 373k]
  ------------------
  131|   373k|	}
_Z16VerifySetOptionsjPKc:
  563|  1.11k|{
  564|       |
  565|  1.11k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 382, False: 728]
  ------------------
  566|  1.11k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 382, False: 728]
  ------------------
  567|  1.11k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 565, False: 545]
  ------------------
  568|       |	
  569|  1.11k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 1.11k]
  ------------------
  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|  1.11k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 0, False: 1.11k]
  |  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|  1.11k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 1.11k]
  |  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|  1.11k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 0, False: 1.11k]
  |  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|  1.11k|	return options;
  586|       |
  587|  1.11k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   179k|{
  663|   179k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   179k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   179k|	XMP_StringPtr	qualName, nameEnd;
  667|   179k|	XMP_VarString	currStep;
  668|       |		
  669|   179k|	qualName = nameEnd = NULL;
  670|   179k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  26.0M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 25.9M, False: 179k]
  ------------------
  672|  25.9M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 56.2k, False: 25.8M]
  |  Branch (672:29): [True: 124k, False: 25.7M]
  ------------------
  673|  25.9M|	}
  674|       |	
  675|   179k|	expandedXPath->clear();
  676|   179k|	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|   179k|	stepBegin = propPath;
  683|   179k|	stepEnd = stepBegin;
  684|  14.8M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 14.8M, False: 54.4k]
  |  Branch (684:29): [True: 14.8M, False: 818]
  |  Branch (684:50): [True: 14.7M, False: 124k]
  |  Branch (684:71): [True: 14.7M, False: 0]
  ------------------
  685|   179k|	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: 179k]
  ------------------
  686|   179k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   179k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   179k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   179k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 179k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   179k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   360k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 180k, False: 179k]
  ------------------
  700|       |
  701|   180k|		stepBegin = stepEnd;
  702|   180k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 56.2k, False: 124k]
  ------------------
  703|   180k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 180k]
  ------------------
  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|   180k|		stepEnd = stepBegin;
  708|       |
  709|   180k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 56.2k, False: 124k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|  56.2k|			qualName = stepBegin;
  713|  10.6M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 10.6M, False: 56.2k]
  |  Branch (713:31): [True: 10.6M, False: 0]
  |  Branch (713:52): [True: 10.6M, False: 0]
  |  Branch (713:73): [True: 10.6M, False: 0]
  ------------------
  714|  56.2k|			nameEnd = stepEnd;
  715|  56.2k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   124k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   124k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   124k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 124k, False: 0]
  |  Branch (723:30): [True: 124k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|   410k|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 410k, False: 0]
  |  Branch (726:32): [True: 410k, False: 0]
  |  Branch (726:53): [True: 286k, False: 124k]
  ------------------
  727|   124k|				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: 124k]
  ------------------
  728|   124k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   124k|			} 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|   124k|			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: 124k]
  ------------------
  774|   124k|			++stepEnd;
  775|       |			
  776|   124k|		}
  777|       |
  778|   180k|		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: 180k]
  ------------------
  779|   180k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   180k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   180k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 56.2k, False: 124k]
  ------------------
  782|       |
  783|  56.2k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 56.2k]
  ------------------
  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|  56.2k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 37.1k, False: 19.1k]
  ------------------
  788|  37.1k|				++qualName;
  789|  37.1k|				stepFlags = kXMP_QualifierStep;
  790|  37.1k|			}
  791|  56.2k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   124k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   124k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 124k]
  ------------------
  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|   180k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   180k|	}
  812|       |
  813|   179k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   355k|{
  829|   355k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   355k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   355k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|   808k|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 678k, False: 129k]
  ------------------
  834|   678k|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|   678k|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|   678k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|   678k|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 225k, False: 452k]
  ------------------
  837|   225k|			schemaNode = currSchema;
  838|   225k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 179k, False: 46.6k]
  ------------------
  839|   225k|			break;
  840|   225k|		}
  841|   678k|	}
  842|       |	
  843|   355k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 129k, False: 225k]
  |  Branch (843:28): [True: 26.9k, False: 103k]
  ------------------
  844|       |
  845|  26.9k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  26.9k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  26.9k|		XMP_StringPtr prefixPtr;
  847|  26.9k|		XMP_StringLen prefixLen;
  848|  26.9k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  26.9k|		XMP_Assert ( found );
  ------------------
  |  |  142|  26.9k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  26.9k|		UNUSED(found);
  851|       |
  852|  26.9k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  26.9k|		xmpTree->children.push_back ( schemaNode );
  854|  26.9k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 433, False: 26.4k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  26.9k|	}
  861|       |	
  862|   355k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   355k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   355k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   355k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   355k|	return schemaNode;
  865|       |	
  866|   355k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   280k|{
  882|   280k|	XMP_Node * childNode = 0;
  883|       |
  884|   280k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 67, False: 280k]
  ------------------
  885|     67|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     67|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 67, False: 0]
  ------------------
  886|     67|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     67|#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|   925k|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 843k, False: 81.9k]
  ------------------
  898|   843k|		XMP_Node * currChild = parent->children[childNum];
  899|   843k|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|   843k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|   843k|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 198k, False: 644k]
  ------------------
  901|   198k|			childNode = currChild;
  902|   198k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 198k, False: 783]
  ------------------
  903|   198k|			break;
  904|   198k|		}
  905|   843k|	}
  906|       |	
  907|   280k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 81.9k, False: 198k]
  |  Branch (907:27): [True: 436, False: 81.5k]
  ------------------
  908|    436|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|    436|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|    436|		parent->children.push_back ( childNode );
  910|    436|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 436, False: 0]
  ------------------
  911|    436|	}
  912|       |	
  913|   280k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   280k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   280k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   280k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   280k|	return childNode;
  916|       |	
  917|   280k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|  37.1k|{
  935|  37.1k|	XMP_Node * qualNode = 0;
  936|       |	
  937|  37.1k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|  37.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  87.5k|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 87.5k, False: 0]
  ------------------
  940|  87.5k|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  87.5k|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  87.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  87.5k|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 37.1k, False: 50.4k]
  ------------------
  943|  37.1k|			qualNode = currQual;
  944|  37.1k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 37.1k, False: 0]
  ------------------
  945|  37.1k|			break;
  946|  37.1k|		}
  947|  87.5k|	}
  948|       |	
  949|  37.1k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 0, False: 37.1k]
  |  Branch (949:26): [True: 0, False: 0]
  ------------------
  950|       |
  951|      0|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|      0|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|      0|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|      0|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|      0|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|      0|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|      0|		const bool isSpecial = isLang | isType;
  957|       |
  958|      0|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 0, False: 0]
  ------------------
  959|      0|			parent->options |= kXMP_PropHasLang;
  960|      0|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 0, False: 0]
  ------------------
  961|      0|			parent->options |= kXMP_PropHasType;
  962|      0|		}
  963|       |		
  964|      0|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 0, False: 0]
  |  Branch (964:38): [True: 0, False: 0]
  ------------------
  965|      0|			parent->qualifiers.push_back ( qualNode );
  966|      0|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 0, False: 0]
  ------------------
  967|      0|		} else {
  968|      0|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      0|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 0, False: 0]
  |  Branch (969:19): [True: 0, False: 0]
  ------------------
  970|      0|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      0|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 0, False: 0]
  ------------------
  972|      0|		}
  973|       |
  974|      0|	}
  975|       |	
  976|  37.1k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|  37.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|  37.1k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  37.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|  37.1k|	return qualNode;
  979|       |	
  980|  37.1k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   179k|{
 1063|   179k|	XMP_Node *     currNode = 0;
 1064|   179k|	XMP_NodePtrPos currPos;
 1065|   179k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   179k|	bool           leafIsNew = false;
 1067|       |	
 1068|   179k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   179k|	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: 179k]
  ------------------
 1071|       |	
 1072|   179k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   179k|	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|   179k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 179k, False: 0]
  ------------------
 1082|       |		
 1083|   179k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   179k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 0, False: 179k]
  ------------------
 1085|       |
 1086|   179k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   179k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 433, False: 179k]
  ------------------
 1087|    433|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    433|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|    433|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 433, False: 0]
  ------------------
 1089|    433|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|    433|		}
 1091|       |
 1092|   179k|	} 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|   179k|	try {
 1138|   539k|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 359k, False: 179k]
  ------------------
 1139|   359k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   359k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 0, False: 359k]
  ------------------
 1141|   359k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   359k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 436, False: 359k]
  ------------------
 1142|    436|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|    436|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|    436|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|    436|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 3, False: 433]
  ------------------
 1145|    436|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|    436|			}
 1147|   359k|		}
 1148|   179k|	} 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|   179k|EXIT:
 1156|       |
 1157|   179k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   179k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   179k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 436, False: 179k]
  ------------------
 1161|    436|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 436, False: 0]
  ------------------
 1162|    436|			currNode->options |= leafOptions;
 1163|    436|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|    436|	}
 1167|       |
 1168|   179k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 179k, False: 0]
  |  Branch (1168:26): [True: 0, False: 179k]
  ------------------
 1169|   179k|	return currNode;
 1170|       |	
 1171|   179k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  28.6k|{
 1344|  28.6k|	char * tagStart;
 1345|  28.6k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  28.6k|	tagStart = (char*) value->c_str();
 1350|   552k|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 545k, False: 6.50k]
  |  Branch (1350:45): [True: 523k, False: 22.1k]
  ------------------
 1351|   523k|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 463k, False: 59.9k]
  |  Branch (1351:28): [True: 13.1k, False: 450k]
  ------------------
 1352|   523k|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  28.6k|	tagStart = tagEnd;
 1357|  28.6k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 22.1k, False: 6.50k]
  ------------------
 1358|  1.44M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 1.41M, False: 26.6k]
  |  Branch (1358:45): [True: 1.41M, False: 1.97k]
  ------------------
 1359|  1.41M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.39M, False: 18.7k]
  |  Branch (1359:28): [True: 11.8k, False: 1.38M]
  ------------------
 1360|  1.41M|	}
 1361|  28.6k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 2.41k, False: 26.2k]
  ------------------
 1362|  2.41k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 2.29k, False: 111]
  |  Branch (1362:30): [True: 2.20k, False: 98]
  ------------------
 1363|  2.41k|		++tagStart;
 1364|  2.41k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 2.24k, False: 166]
  |  Branch (1364:30): [True: 1.03k, False: 1.21k]
  ------------------
 1365|  2.41k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  38.7k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 38.7k, Folded]
  ------------------
 1370|  38.7k|		tagStart = tagEnd;
 1371|  38.7k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 10.0k, False: 28.6k]
  ------------------
 1372|  38.7k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 28.6k, False: 10.0k]
  ------------------
 1373|  13.7M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 13.7M, False: 1.97k]
  |  Branch (1373:46): [True: 13.7M, False: 8.10k]
  ------------------
 1374|  13.7M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 13.6M, False: 48.0k]
  |  Branch (1374:29): [True: 59.0k, False: 13.6M]
  ------------------
 1375|  13.7M|		}
 1376|  10.0k|	}
 1377|       |	
 1378|  28.6k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|  1.60k|{
 1391|  1.60k|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|  1.60k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|  1.60k|	size_t itemNum;
 1394|  1.60k|	size_t itemLim = array->children.size();
 1395|  1.60k|	bool   hasDefault = false;
 1396|       |	
 1397|  8.47k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 7.32k, False: 1.14k]
  ------------------
 1398|       |	
 1399|  7.32k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 7.32k]
  ------------------
 1400|  7.32k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 7.32k]
  ------------------
 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|  7.32k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 457, False: 6.87k]
  ------------------
 1405|    457|			hasDefault = true;
 1406|    457|			break;
 1407|    457|		}
 1408|       |
 1409|  7.32k|	}
 1410|       |
 1411|  1.60k|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 457, False: 1.14k]
  ------------------
 1412|       |
 1413|    457|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 70, False: 387]
  ------------------
 1414|     70|			XMP_Node * temp = array->children[0];
 1415|     70|			array->children[0] = array->children[itemNum];
 1416|     70|			array->children[itemNum] = temp;
 1417|     70|		}
 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|    457|	}
 1423|       |	
 1424|  1.60k|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  4.36k|{
 1435|  4.36k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  4.36k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  4.36k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  13.2k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 11.4k, False: 1.73k]
  ------------------
 1440|  11.4k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  11.4k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 2.10k, False: 9.39k]
  |  Branch (1441:50): [True: 527, False: 8.86k]
  ------------------
 1442|  11.4k|	}
 1443|       |	
 1444|  4.36k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 4.23k, False: 127]
  |  Branch (1444:25): [True: 1.60k, False: 2.62k]
  ------------------
 1445|  1.60k|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|  1.60k|		NormalizeLangArray ( xmpParent );
 1447|  1.60k|	}
 1448|       |
 1449|  4.36k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   179k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   179k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   179k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   179k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   179k|	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: 179k]
  ------------------
  161|       |
  162|   179k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 179k]
  |  Branch (162:29): [True: 0, False: 179k]
  ------------------
  163|      0|		XMP_Throw ( "Top level name must not be a qualifier", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  164|      0|	}
  165|  14.8M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 14.7M, False: 179k]
  ------------------
  166|  14.7M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 14.7M]
  |  Branch (166:24): [True: 0, False: 14.7M]
  ------------------
  167|      0|			XMP_Throw ( "Top level name must be simple", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  168|      0|		}
  169|  14.7M|	}
  170|       |
  171|   179k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   179k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 179k]
  ------------------
  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|   179k|	XMP_StringPtr colonPos = propName;
  177|  10.8M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 10.8M, False: 438]
  |  Branch (177:30): [True: 10.6M, False: 179k]
  ------------------
  178|   179k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   179k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 438, False: 179k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|    438|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|    438|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|    438|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   179k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   179k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   179k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   179k|		XMP_VarString prefix ( propName, prefixLen );
  198|   179k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   179k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 179k]
  ------------------
  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|   179k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 120, False: 179k]
  ------------------
  203|    120|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|    120|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   179k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   179k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   179k|	}
  210|       |
  211|   179k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|  56.2k|{
  220|  56.2k|	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: 56.2k]
  ------------------
  221|       |
  222|  56.2k|	XMP_StringPtr colonPos = qualName;
  223|   253k|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 253k, False: 0]
  |  Branch (223:34): [True: 196k, False: 56.2k]
  ------------------
  224|  56.2k|	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: 56.2k]
  |  Branch (224:33): [True: 0, False: 56.2k]
  ------------------
  225|       |
  226|  56.2k|	VerifySimpleXMLName ( qualName, colonPos );
  227|  56.2k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|  56.2k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|  56.2k|	XMP_VarString prefix ( qualName, prefixLen );
  231|  56.2k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|  56.2k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 0, False: 56.2k]
  ------------------
  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|  56.2k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   359k|{
  395|   359k|	XMP_Node * nextNode = 0;
  396|   359k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   359k|	XMP_Index      index    = 0;
  398|   359k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   359k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   359k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   359k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 198k, False: 161k]
  ------------------
  403|       |
  404|   198k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   198k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 37.1k, False: 124k]
  ------------------
  407|       |	
  408|  37.1k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|  37.1k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|  37.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|  37.1k|		++qualStep;
  411|  37.1k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   124k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   124k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 0, False: 124k]
  ------------------
  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|   124k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 124k, False: 0]
  ------------------
  422|   124k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   124k|		} 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|   124k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 124k, False: 0]
  |  Branch (437:24): [True: 124k, False: 0]
  ------------------
  438|       |
  439|   124k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 124k]
  |  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|   124k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 124k, False: 0]
  |  Branch (464:27): [True: 124k, False: 0]
  ------------------
  465|       |	
  466|   124k|	}
  467|       |
  468|   359k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   359k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 359k, False: 0]
  |  Branch (468:26): [True: 436, False: 359k]
  ------------------
  469|    436|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|    436|	}
  471|       |	
  472|   359k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   359k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   359k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   359k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   359k|	return nextNode;
  475|       |	
  476|   359k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   124k|{
  249|   124k|	XMP_Index index = 0;
  250|   124k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   124k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   124k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|   410k|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 286k, False: 124k]
  ------------------
  255|   286k|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|   286k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|   286k|		index = (index * 10) + (indexStep[chNum] - '0');
  257|   286k|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 286k]
  ------------------
  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|   286k|	}
  261|       |
  262|   124k|	--index;	// Change to a C-style, zero based index.
  263|   124k|	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: 124k]
  ------------------
  264|       |
  265|   124k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 0, False: 124k]
  |  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|   124k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 124k]
  ------------------
  272|   124k|	return index;
  273|       |	
  274|   124k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|    436|{
  488|       |
  489|    436|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 0, False: 436]
  ------------------
  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|    436|}	// CheckImplicitStruct

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  19.3k|{
 1097|  19.3k|	if ( (buffer == 0) && (xmpSize != 0) ) XMP_Throw ( "Null parse buffer", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1097:7): [True: 0, False: 19.3k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  19.3k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 19.3k]
  ------------------
 1099|       |	
 1100|  19.3k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  19.3k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  19.3k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 19.3k, False: 0]
  ------------------
 1105|  19.3k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 19.3k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  19.3k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  19.3k|	}
 1108|       |	
 1109|  19.3k|	XMLParserAdapter& parser = *this->xmlParser;
 1110|       |	
 1111|       |	#if 0	// XMP_DebugBuild
 1112|       |		if ( parser.parseLog != 0 ) {
 1113|       |			char message [200];	// AUDIT: Using sizeof(message) below for snprintf length is safe.
 1114|       |			snprintf ( message, sizeof(message), "<!-- ParseFromBuffer, length = %d, options = %X%s -->",	// AUDIT: See above.
 1115|       |					   xmpSize, options, (lastClientCall ? " (last)" : "") );
 1116|       |			fwrite ( message, 1, strlen(message), parser.parseLog );
 1117|       |			fflush ( parser.parseLog );
 1118|       |		}
 1119|       |	#endif
 1120|       |		
 1121|  19.3k|	try {	// Cleanup the tree and xmlParser if anything fails.
 1122|       |	
 1123|       |		// Determine the character encoding before doing any real parsing. This is needed to do the
 1124|       |		// 8-bit special processing.
 1125|       |		
 1126|  19.3k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 19.3k, False: 0]
  ------------------
 1127|       |
 1128|  19.3k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 19.3k, False: 0]
  |  Branch (1128:39): [True: 19.2k, False: 71]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  19.2k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  19.2k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     71|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     71|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 71, False: 0]
  ------------------
 1139|       |
 1140|     71|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     71|				buffer += pendingOverlap;
 1142|     71|				xmpSize -= pendingOverlap;
 1143|     71|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     71|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 71]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     71|				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|     71|			}
 1153|       |
 1154|  19.3k|		}
 1155|       |		
 1156|       |		// We have the character encoding. Process UTF-16 and UTF-32 as is. UTF-8 needs special
 1157|       |		// handling to take care of things like ISO Latin-1 or unescaped ASCII controls.
 1158|       |
 1159|  19.3k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  19.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  19.3k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 19.3k]
  ------------------
 1162|       |		
 1163|      0|			if ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|       |				// Might have pendingInput from the above portion to determine the character encoding.
 1165|      0|				parser.ParseBuffer ( parser.pendingInput, parser.pendingCount, false );
 1166|      0|			}
 1167|      0|			parser.ParseBuffer ( buffer, xmpSize, lastClientCall );
 1168|       |			
 1169|  19.3k|		} else {
 1170|       |
 1171|       |			#if Trace_ParsingHackery
 1172|       |				fprintf ( stderr, "Parsing %d bytes @ %.8X, %s, %d pending, context: %.8s\n",
 1173|       |						  xmpSize, buffer, (lastClientCall ? "last" : "not last"), parser.pendingCount, buffer );
 1174|       |			#endif
 1175|       |
 1176|       |			// The UTF-8 processing is a bit complex due to the need to tolerate ISO Latin-1 input.
 1177|       |			// This is done by scanning the input for byte sequences that are not valid UTF-8,
 1178|       |			// assuming they are Latin-1 characters in the range 0x80..0xFF. This requires saving a
 1179|       |			// pending input buffer to handle partial UTF-8 sequences at the end of a buffer.
 1180|       |			
 1181|  19.3k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 71, False: 19.3k]
  ------------------
 1182|       |			
 1183|       |				// We've got some leftover input, process it first then continue with the current
 1184|       |				// buffer. Try to fill the pendingInput buffer before parsing further. We use a loop
 1185|       |				// for weird edge cases like a 2 byte input buffer, using 1 byte for pendingInput,
 1186|       |				// then having a partial UTF-8 end and need to absorb more.
 1187|       |				
 1188|     71|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     71|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 71, False: 0]
  ------------------
 1190|       |				
 1191|     71|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     71|				parser.pendingCount += pendingOverlap;
 1193|     71|				buffer += pendingOverlap;
 1194|     71|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     71|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 71]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     71|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     71|				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|     71|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 71, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     71|					parser.pendingCount = 0;
 1208|       |
 1209|     71|				} 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|     71|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  19.3k|			size_t bytesDone = ProcessUTF8Portion ( &parser, (XMP_Uns8*)buffer, xmpSize, lastClientCall );
 1240|       |
 1241|       |			#if Trace_ParsingHackery
 1242|       |				fprintf ( stderr, "   ProcessUTF8Portion handled %d additional bytes\n", bytesDone );
 1243|       |			#endif
 1244|       |			
 1245|  19.3k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 19.3k]
  ------------------
 1246|       |
 1247|      0|				XMP_Assert ( ! lastClientCall );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1248|      0|				size_t bytesLeft = xmpSize - bytesDone;
 1249|      0|				if ( bytesLeft > kXMLPendingInputMax ) XMP_Throw ( "Parser bytesLeft too large", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1249:10): [True: 0, False: 0]
  ------------------
 1250|       |
 1251|      0|				memcpy ( parser.pendingInput, &buffer[bytesDone], bytesLeft );	// AUDIT: Count is safe.
 1252|      0|				parser.pendingCount = bytesLeft;
 1253|      0|				return;	// Wait for the next buffer.
 1254|       |
 1255|      0|			}
 1256|       |
 1257|  19.3k|		}
 1258|       |		
 1259|  19.3k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 19.2k, False: 71]
  ------------------
 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|  19.2k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  19.2k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 16.7k, False: 2.48k]
  ------------------
 1269|       |
 1270|  16.7k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  16.7k|				NormalizeDCArrays ( &this->tree );
 1272|  16.7k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 16.7k]
  ------------------
 1273|  16.7k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  16.7k|				size_t schemaNum = 0;
 1277|  38.5k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 21.7k, False: 16.7k]
  ------------------
 1278|  21.7k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  21.7k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 21.7k, False: 0]
  ------------------
 1280|  21.7k|						++schemaNum;
 1281|  21.7k|					} 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|  21.7k|				}
 1286|       |				
 1287|  16.7k|			}
 1288|       |
 1289|  19.2k|			delete this->xmlParser;
 1290|  19.2k|			this->xmlParser = 0;
 1291|       |
 1292|  19.2k|		}
 1293|       |		
 1294|  19.3k|	} catch ( ... ) {
 1295|       |
 1296|  4.42k|		delete this->xmlParser;
 1297|  4.42k|		this->xmlParser = 0;
 1298|  4.42k|		prevTkVer = 0;
 1299|  4.42k|		this->tree.ClearNode();
 1300|  4.42k|		throw;
 1301|       |
 1302|  4.42k|	}
 1303|       |	
 1304|  19.3k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  19.3k|{
  811|  19.3k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 19.3k]
  ------------------
  812|       |	
  813|  19.3k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  19.3k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 19.3k]
  ------------------
  816|       |	
  817|       |		// These cases are:
  818|       |		//   00 nn -- -- - Big endian UTF-16
  819|       |		//   00 00 00 nn - Big endian UTF-32
  820|       |		//   00 00 FE FF - Big endian UTF 32
  821|       |
  822|      0|		if ( (length < 4) || (uniChar[1] != 0) ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (822:8): [True: 0, False: 0]
  |  Branch (822:24): [True: 0, False: 0]
  ------------------
  823|      0|		return kXMP_EncodeUTF32Big;
  824|       |		
  825|  19.3k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 19.3k, False: 0]
  ------------------
  826|       |	
  827|       |		// These cases are:
  828|       |		//   nn mm -- -- - UTF-8, includes EF BB BF case
  829|       |		//   nn 00 00 00 - Little endian UTF-32
  830|       |		//   nn 00 -- -- - Little endian UTF-16
  831|       |
  832|  19.3k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 19.3k, False: 0]
  ------------------
  833|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (833:8): [True: 0, False: 0]
  |  Branch (833:24): [True: 0, False: 0]
  ------------------
  834|      0|		return kXMP_EncodeUTF32Little;
  835|       |
  836|      0|	} else {
  837|       |	
  838|       |		// These cases are:
  839|       |		//   EF BB BF -- - UTF-8
  840|       |		//   FE FF -- -- - Big endian UTF-16
  841|       |		//   FF FE 00 00 - Little endian UTF-32
  842|       |		//   FF FE -- -- - Little endian UTF-16
  843|       |
  844|      0|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 0, False: 0]
  ------------------
  845|      0|		if ( uniChar[0] == 0xFE ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (845:8): [True: 0, False: 0]
  ------------------
  846|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (846:8): [True: 0, False: 0]
  |  Branch (846:24): [True: 0, False: 0]
  ------------------
  847|      0|		return kXMP_EncodeUTF32Little;
  848|       |
  849|      0|	}
  850|       |		
  851|  19.3k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  19.3k|{
  977|  19.3k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  19.3k|	const XMP_Uns8 * spanEnd;
  980|       |
  981|       |	// `buffer` is copied into this std::string. If `buffer` only
  982|       |	// contains valid UTF-8 and no escape characters, then the copy
  983|       |	// will be identical to the original, but invalid characters are
  984|       |	// replaced - usually with a space character.  This std::string was
  985|       |	// added as a performance fix for:
  986|       |	// https://github.com/Exiv2/exiv2/security/advisories/GHSA-w8mv-g8qq-36mj
  987|       |	// Previously, the code was repeatedly calling
  988|       |	// `xmlParser->ParseBuffer()`, which turned out to have quadratic
  989|       |	// complexity, because expat kept reparsing the entire string from
  990|       |	// the beginning.
  991|  19.3k|	std::string copy;
  992|       |		
  993|  74.7M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 74.7M, False: 19.3k]
  ------------------
  994|       |
  995|  74.7M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 74.3M, False: 372k]
  |  Branch (995:30): [True: 73.9M, False: 384k]
  |  Branch (995:52): [True: 72.6M, False: 1.32M]
  ------------------
  996|  72.6M|			copy.push_back(*spanEnd);
  997|  72.6M|			continue;	// A regular ASCII character.
  998|  72.6M|		}
  999|       |
 1000|  2.07M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 19.4k, False: 2.06M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  19.4k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  19.4k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 19.4k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  19.4k|				copy.append((const char*)spanEnd, uniLen);
 1010|  19.4k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  19.4k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|  2.06M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 372k, False: 1.68M]
  |  Branch (1026:36): [True: 364k, False: 1.32M]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   736k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   736k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   703k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   388k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 33.2k, False: 703k]
  |  Branch (1030:31): [True: 314k, False: 388k]
  |  Branch (1030:52): [True: 24.1k, False: 364k]
  ------------------
 1031|   372k|				copy.push_back(*spanEnd);
 1032|   372k|				continue;
 1033|   372k|			}
 1034|       |
 1035|   364k|			copy.push_back(' ');
 1036|       |		
 1037|  1.32M|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|  1.32M|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|  1.32M|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|  1.32M|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|  1.32M|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 76, False: 1.32M]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     76|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 76, False: 0]
  ------------------
 1048|     76|					copy.push_back('&');
 1049|     76|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     76|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|  1.32M|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 68.3k, False: 1.25M]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  68.3k|				copy.push_back(' ');
 1058|  68.3k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|  1.25M|			} else {
 1061|  1.25M|				copy.push_back('&');
 1062|  1.25M|			}
 1063|       |
 1064|  1.32M|		}
 1065|       |		
 1066|  2.07M|	}
 1067|       |	
 1068|  19.3k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  19.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  19.3k|	copy.push_back(' ');
 1070|  19.3k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  19.3k|	return length;
 1072|       |
 1073|  19.3k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  19.4k|{
  868|  19.4k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  19.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  19.4k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 19.4k]
  ------------------
  870|  19.4k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 19.4k]
  ------------------
  871|       |	
  872|  19.4k|	int byteCount = 2;
  873|  19.4k|	XMP_Uns8 firstByte = *charStart;
  874|  24.2k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 4.85k, False: 19.4k]
  ------------------
  875|       |	
  876|  19.4k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 19.4k]
  ------------------
  877|       |
  878|  43.7k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 24.2k, False: 19.4k]
  ------------------
  879|  24.2k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 24.2k]
  ------------------
  880|  24.2k|	}
  881|       |	
  882|  19.4k|	return byteCount;
  883|       |	
  884|  19.4k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|  1.32M|{
  898|  1.32M|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|  1.32M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|  1.32M|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 1.32M]
  ------------------
  900|  1.32M|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|  1.32M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|  1.32M|	size_t tailLen = bufEnd - escStart;
  903|  1.32M|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 76, False: 1.32M]
  ------------------
  904|       |	
  905|  1.32M|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 1.02M, False: 293k]
  ------------------
  906|       |	
  907|   293k|	XMP_Uns8 escValue = 0;
  908|   293k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   293k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 284k, False: 8.97k]
  |  Branch (910:27): [True: 1.95k, False: 282k]
  ------------------
  911|  1.95k|		escValue = *escPos - '0';
  912|  1.95k|		++escPos;
  913|   291k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 279k, False: 11.8k]
  |  Branch (913:34): [True: 2.34k, False: 277k]
  ------------------
  914|  2.34k|		escValue = *escPos - 'A' + 10;
  915|  2.34k|		++escPos;
  916|   289k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 268k, False: 21.0k]
  |  Branch (916:34): [True: 152k, False: 115k]
  ------------------
  917|   152k|		escValue = *escPos - 'a' + 10;
  918|   152k|		++escPos;
  919|   152k|	}
  920|       |	
  921|   293k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 255k, False: 38.3k]
  |  Branch (921:27): [True: 451, False: 255k]
  ------------------
  922|    451|		escValue = (escValue << 4) + (*escPos - '0');
  923|    451|		++escPos;
  924|   293k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 246k, False: 46.8k]
  |  Branch (924:34): [True: 1.28k, False: 245k]
  ------------------
  925|  1.28k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  1.28k|		++escPos;
  927|   292k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 235k, False: 56.4k]
  |  Branch (927:34): [True: 85.8k, False: 149k]
  ------------------
  928|  85.8k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|  85.8k|		++escPos;
  930|  85.8k|	}
  931|       |	
  932|   293k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 293k]
  ------------------
  933|   293k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 219k, False: 74.1k]
  ------------------
  934|       |	
  935|  74.1k|	size_t escLen = escPos - escStart + 1;
  936|  74.1k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 2.46k, False: 71.6k]
  ------------------
  937|       |	
  938|  71.6k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  71.6k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  71.4k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  69.9k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 264, False: 71.4k]
  |  Branch (938:29): [True: 1.49k, False: 69.9k]
  |  Branch (938:50): [True: 1.61k, False: 68.3k]
  ------------------
  939|       |	
  940|  68.3k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  71.6k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  19.2k|{
  152|  19.2k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  19.2k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 1.62k, False: 17.6k]
  ------------------
  155|  19.2k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 2.48k, False: 16.7k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  16.7k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  16.7k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  16.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  16.7k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 16.7k]
  ------------------
  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|  18.0k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 2.68k, False: 15.3k]
  ------------------
  168|  2.68k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  2.68k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 1.24k, False: 1.44k]
  |  Branch (169:42): [True: 136, False: 1.30k]
  ------------------
  170|  1.37k|				verStr = currAttr->value.c_str();
  171|  1.37k|				break;
  172|  1.37k|			}
  173|  2.68k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  16.7k|	unsigned long part;
  178|  27.6k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 12.0k, False: 15.5k]
  |  Branch (178:29): [True: 2.06k, False: 10.0k]
  |  Branch (178:48): [True: 8.77k, False: 1.26k]
  ------------------
  179|       |	
  180|  16.7k|	part = 0;
  181|  24.6k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 9.15k, False: 15.5k]
  |  Branch (181:28): [True: 8.09k, False: 1.06k]
  |  Branch (181:48): [True: 7.90k, False: 185]
  ------------------
  182|  7.90k|		part = (part * 10) + (*verStr - '0');
  183|  7.90k|		++verStr;
  184|  7.90k|	}
  185|  16.7k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 322, False: 16.4k]
  ------------------
  186|  16.7k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  16.7k|	part = 0;
  189|  16.7k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 930, False: 15.8k]
  ------------------
  190|  18.5k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 3.03k, False: 15.5k]
  |  Branch (190:28): [True: 2.08k, False: 947]
  |  Branch (190:48): [True: 1.82k, False: 264]
  ------------------
  191|  1.82k|		part = (part * 10) + (*verStr - '0');
  192|  1.82k|		++verStr;
  193|  1.82k|	}
  194|  16.7k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 123, False: 16.6k]
  ------------------
  195|  16.7k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  16.7k|	part = 0;
  198|  16.7k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 618, False: 16.1k]
  ------------------
  199|  19.9k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 4.37k, False: 15.5k]
  |  Branch (199:28): [True: 3.49k, False: 876]
  |  Branch (199:48): [True: 3.18k, False: 313]
  ------------------
  200|  3.18k|		part = (part * 10) + (*verStr - '0');
  201|  3.18k|		++verStr;
  202|  3.18k|	}
  203|  16.7k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 152, False: 16.6k]
  ------------------
  204|  16.7k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  16.7k|	part = 0;
  207|  16.7k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 742, False: 16.0k]
  ------------------
  208|  18.7k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 2.66k, False: 16.0k]
  |  Branch (208:28): [True: 2.50k, False: 157]
  |  Branch (208:48): [True: 1.96k, False: 541]
  ------------------
  209|  1.96k|		part = (part * 10) + (*verStr - '0');
  210|  1.96k|		++verStr;
  211|  1.96k|	}
  212|  16.7k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 82, False: 16.6k]
  ------------------
  213|  16.7k|	thiz->prevTkVer += part;
  214|       |	
  215|  16.7k|	return rootNode;
  216|       |	
  217|  16.7k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  5.12k|{
  112|       |
  113|       |	// Look among this parent's content for x:xmpmeta. The recursion for x:xmpmeta is broader than
  114|       |	// the strictly defined choice, but gives us smaller code.
  115|  17.7k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 15.0k, False: 2.70k]
  ------------------
  116|  15.0k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  15.0k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 9.30k, False: 5.70k]
  ------------------
  118|  5.70k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 2.41k, False: 3.29k]
  |  Branch (118:44): [True: 1, False: 3.29k]
  ------------------
  119|  5.70k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  2.70k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 2.70k, False: 0]
  ------------------
  122|  10.1k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 9.03k, False: 1.16k]
  ------------------
  123|  9.03k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  9.03k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 5.83k, False: 3.19k]
  ------------------
  125|  3.19k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 1.54k, False: 1.65k]
  ------------------
  126|  3.19k|		}
  127|  2.70k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  2.13k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 1.08k, False: 1.05k]
  ------------------
  131|  1.08k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  1.08k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 111, False: 975]
  ------------------
  133|  1.08k|	}
  134|       |	
  135|  1.05k|	return 0;
  136|       |
  137|  1.16k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  12.4k|{
  232|  12.4k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  12.4k|#define kXMP_ExistingOnly	false
  ------------------
  233|  12.4k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 10.7k, False: 1.70k]
  ------------------
  234|       |	
  235|  6.20k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 4.49k, False: 1.70k]
  ------------------
  236|  4.49k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  4.49k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  4.49k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 271, False: 4.22k]
  ------------------
  240|       |		
  241|  4.22k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 114, False: 4.11k]
  ------------------
  242|  4.11k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 69, False: 4.04k]
  ------------------
  243|    183|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  4.04k|		} else if (
  245|  4.04k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 84, False: 3.95k]
  ------------------
  246|  3.95k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 222, False: 3.73k]
  ------------------
  247|  3.73k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 76, False: 3.66k]
  ------------------
  248|    382|			arrayForm = kXMP_PropArrayIsAltText;
  249|  3.66k|		} else if (
  250|  3.66k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 189, False: 3.47k]
  ------------------
  251|  3.47k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 66, False: 3.40k]
  ------------------
  252|  3.40k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 66, False: 3.33k]
  ------------------
  253|  3.33k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 67, False: 3.27k]
  ------------------
  254|  3.27k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 123, False: 3.14k]
  ------------------
  255|  3.14k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 34, False: 3.11k]
  ------------------
  256|    545|			arrayForm = kXMP_PropValueIsArray;
  257|    545|		}
  258|  4.22k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 3.11k, False: 1.11k]
  ------------------
  259|       |		
  260|  1.11k|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|  1.11k|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|  1.11k|		dcSchema->children[propNum] = newArray;
  263|  1.11k|		newArray->children.push_back ( currProp );
  264|  1.11k|		currProp->parent = newArray;
  265|  1.11k|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  1.11k|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|  1.11k|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 382, False: 728]
  |  Branch (267:44): [True: 382, False: 0]
  ------------------
  268|    382|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    382|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    382|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 382, False: 0]
  ------------------
  271|    382|				currProp->qualifiers.push_back ( newLang );
  272|    382|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    382|		}
  276|       |
  277|  1.11k|	}
  278|       |	
  279|  1.70k|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  12.4k|{
  666|  12.4k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  12.4k|	XMP_Node * currSchema = 0;
  671|       |
  672|  12.4k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  12.4k|#define kXMP_ExistingOnly	false
  ------------------
  673|  12.4k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 30, False: 12.3k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     30|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     30|#define kXMP_ExistingOnly	false
  ------------------
  677|     30|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 30]
  ------------------
  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|     30|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     30|#define kXMP_ExistingOnly	false
  ------------------
  682|     30|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 30]
  |  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|     30|	}
  697|       |
  698|  12.4k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  12.4k|#define kXMP_ExistingOnly	false
  ------------------
  699|  12.4k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 55, False: 12.3k]
  ------------------
  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|     55|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|     55|#define kXMP_ExistingOnly	false
  ------------------
  703|     55|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 55]
  ------------------
  704|     55|	}
  705|       |
  706|  12.4k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  12.4k|#define kXMP_ExistingOnly	false
  ------------------
  707|  12.4k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 1.70k, False: 10.7k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|  1.70k|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.70k|#define kXMP_ExistingOnly	false
  ------------------
  710|  1.70k|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 154, False: 1.55k]
  ------------------
  711|    154|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|    154|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|    154|		}
  714|  1.70k|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  12.4k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  12.4k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  12.4k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  12.4k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  12.4k|	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|  12.4k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 1.22k, False: 11.1k]
  ------------------
  732|       |
  733|  1.22k|		bool nameIsUUID = false;
  734|  1.22k|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|  1.22k|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|  1.22k|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 197, False: 1.02k]
  |  |  ------------------
  ------------------
  737|       |
  738|    197|			nameIsUUID = true;
  739|       |
  740|  1.02k|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 648, False: 380]
  ------------------
  741|       |
  742|    648|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  15.2k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 15.0k, False: 241]
  ------------------
  744|  15.0k|				char ch = nameStr[i];
  745|  15.0k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 474, False: 14.5k]
  ------------------
  746|    474|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 75, False: 399]
  |  Branch (746:23): [True: 145, False: 254]
  |  Branch (746:36): [True: 76, False: 178]
  |  Branch (746:49): [True: 68, False: 110]
  ------------------
  747|    110|					nameIsUUID = false;
  748|    110|					break;
  749|  14.5k|				} else {
  750|  14.5k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 14.4k, False: 102]
  |  Branch (750:27): [True: 477, False: 13.9k]
  |  Branch (750:44): [True: 13.8k, False: 204]
  |  Branch (750:59): [True: 13.7k, False: 93]
  ------------------
  751|    297|					nameIsUUID = false;
  752|    297|					break;
  753|  14.5k|				}
  754|  15.0k|			}
  755|       |
  756|    648|		}
  757|       |		
  758|  1.22k|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 438, False: 787]
  ------------------
  759|       |
  760|    438|			XMP_ExpandedXPath expPath;
  761|    438|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|    438|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|    438|#define kXMP_CreateNodes	true
  ------------------
  763|    438|			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: 438]
  ------------------
  764|       |
  765|    438|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|    438|			idNode->value = tree.name;
  767|    438|			idNode->RemoveChildren();
  768|    438|			idNode->RemoveQualifiers();
  769|       |
  770|    438|			tree.name.erase();
  771|       |
  772|    438|		}
  773|       |
  774|  1.22k|	}
  775|       |
  776|  12.4k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  62.0k|{
  610|  62.0k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  62.0k|#define kXMP_ExistingOnly	false
  ------------------
  611|  62.0k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 56.8k, False: 5.23k]
  ------------------
  612|       |	
  613|  5.23k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.23k|#define kXMP_ExistingOnly	false
  ------------------
  614|  5.23k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 4.67k, False: 556]
  |  Branch (614:27): [True: 463, False: 93]
  ------------------
  615|       |	
  616|     93|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 0, False: 93]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     93|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  5.22k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 5.13k, False: 93]
  ------------------
  622|       |
  623|  5.13k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  5.13k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 580, False: 4.55k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|    580|			delete ( currChild );
  629|    580|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  4.55k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 2.78k, False: 1.77k]
  ------------------
  632|       |		
  633|  2.78k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 545, False: 2.23k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|    545|				delete ( currChild );
  637|    545|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  2.23k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  2.23k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  2.23k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 2.23k, False: 5]
  ------------------
  644|  2.23k|					currChild->qualifiers.push_back ( repairLang );
  645|  2.23k|				} else {
  646|      5|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|      5|				}
  648|  2.23k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  2.23k|			}
  651|       |
  652|  2.78k|		}
  653|       |
  654|  5.13k|	}
  655|       |
  656|     93|}	// RepairAltText

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

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

